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 |
|---|---|---|---|---|---|
2,595,108 | 2,595,109 | Printing Hindi characters as string in java results in error | <p>I print hindi characters as string in java and I'm getting an error. I save the java file in notepad uing UTF-8.</p>
<pre><code>public class MainClass {
public static void main(String args[]) throws Exception {
String s = "साहिलसाहिल";
System.out.print(s);
}
}
</code></pre>
<p>After compil... | java | [1] |
5,974,713 | 5,974,714 | IPhone SDK help with minigame | <p>right basically what ive got is an app which is a ball and bat and its how many bounces you can achieve, it works alright but there is one problem,</p>
<p>when the ball hits the side of the bat it throws it off course and its like the frame of the ball is bouncing in the frame of the bat, Here is my code in my main... | iphone | [8] |
387,334 | 387,335 | how to convert values of list of list to int in python 2.7 | <p>I have a list of list, such as</p>
<pre><code>T =[[0.10113], [0.56325], [0.02563], [0.09602], [0.06406], [0.04807]]
</code></pre>
<p>I would like to find the total sum of these numbers.</p>
<p>I am new to python programming, when I try a simple <code>int(T[1])</code> conversion, I get error </p>
<pre><code>TypeE... | python | [7] |
5,784,042 | 5,784,043 | Remove/Add LI to UL single redraw | <p>I'm new to JQuery/Javascript. Have a JSON object that contains an array of strings I want to add to an unordered list. First I need to remove all existing <code>li</code> children from the <code>ul</code>, then I want to add each element of my string array as a <code>li</code> - but I think it will be important to a... | jquery | [5] |
4,137,376 | 4,137,377 | How do I get more control of UIImageView animation? | <p>I'm trying to display a series of images in a animation where the duration between the images changes frame to frame. I can successfully animate images where the duration is the same. I've looked into subclassing UIImageView but it doesn't seem to allow you access anything that could be helpful.</p>
<p>I've also ... | iphone | [8] |
3,444,379 | 3,444,380 | Error in installing cphalcon | <p>When I install cphalcon in my Debian Linux with PHP 5.4.8,it says following error message:</p>
<p><strong>home/cphalcon/build/64bits/phalcon.c: In function ‘phalcon_escape_html’:
/home/cphalcon/build/64bits/phalcon.c:7140: warning: passing argument 3 of ‘php_escape_html_entities’ from incompatible pointer type
/usr... | php | [2] |
4,334,430 | 4,334,431 | How to get a range of objects in a selector | <p>If I have a list of 10 links, and I want to select all the links after the first 4, How?</p>
<p>I was looking at <a href="http://api.jquery.com/eq/" rel="nofollow"><code>:eq()</code></a> but that doesn't seem to solve my issue since its specific, rather than a range.</p>
<p>Look for something like <code>$("a:eq(&g... | jquery | [5] |
1,047,847 | 1,047,848 | How to get UIButton Target, Action and Control events? | <p>I am using UIImageView's with UIButtons a whole bunch. So, I created a custom class to permanently marry these two an make things a little simpler. It all works well until I decided to implement -(id)initWithObject:(AUIImageViewButton *) imageViewButton.</p>
<p>Clearly I need to copy all relevant properties from ... | iphone | [8] |
626,127 | 626,128 | Unexpected Symbol in string implode | <p>I am using implode to create a query string but there is an unexpected symbol appearing in it and im unsure where it is coming from</p>
<p>If anyone has any insight it would be much appreciated. </p>
<pre><code>$url = "https://mypay.com/billing/signup.cgi";
$key = "11";
$key .= "11";
$key .= "GBP";
$key .= "QQD... | php | [2] |
3,271,239 | 3,271,240 | How to save values of dynamically added textboxes into database in asp.net | <p>Hi
I have created no. of textboxes(that no entered by user in txtcount textbox) dynamically.
But i want to store those values into database. For that i used code in save button click event as follows :</p>
<pre><code>protected void btnsave_Click(object sender, EventArgs e)
{
// Check how many textboxes ... | asp.net | [9] |
4,095,034 | 4,095,035 | How to make Dynamic textbox multiline with 10 rows | <p>I have created dynamic textbox in code behind,but i want to make that textbox multiline with 10 rows,Could u plz tell how to make its TextMode as MultiLine.
I have tried following code:</p>
<p>TextBox _textDesc = new TextBox();</p>
<pre><code> _textDesc.ID = "textDesc_" + i.ToString();
... | asp.net | [9] |
4,836,670 | 4,836,671 | what's wrong with my jquery hasClass? | <pre><code><!DOCTYPE HTML>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>abc</title>
<script type="text/javascript" src="scripts/jquery_latest.js"></script>
<script type="text/javascript">
$(document).ready(function()
... | jquery | [5] |
3,521,725 | 3,521,726 | Generate a color object from string color | <p>I want to convert RGB string to hex-color code. For example :</p>
<pre><code> string rgb = rgb(0, 0, 255);
</code></pre>
<p>From above RGB I want to get:</p>
<pre><code> string hex = #0000FF;
</code></pre>
| c# | [0] |
275,977 | 275,978 | How to find character appearence in text | <p>How can i find with jquery how many times a character appear in text, for example i have the character <strong>1</strong> and the text <strong>143443143241</strong> so here the character 1 appear 3 times, how can i check that.</p>
| javascript | [3] |
4,647,267 | 4,647,268 | What is the diffrence between Java EE and (JSP and Servlet)? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1515190/relationship-between-jsp-and-jee-j2ee">Relationship between JSP and Java EE</a> </p>
</blockquote>
<p>I am working with JSP and Servlets but I always come across Java EE as a fully different thing. So ca... | java | [1] |
3,761,635 | 3,761,636 | Copy a file and paste it to the desired location | <p>I want to copy a file from say /mnt/sdcard/Pictures and paste to the location /mnt/sdcard/Pictures/myselection..
how to code it?? </p>
| android | [4] |
4,033,858 | 4,033,859 | ASP.NET what is [datamember] [datacontract] in class giving errors | <p>Im following a guide which tell me to create a simple class file and add following code</p>
<pre><code>[DataContract]
</code></pre>
<p>public class Footballers
{
[DataMember]
public string FirstName { get; set; }</p>
<pre><code>[DataMember]
public string LastName { get; set; }
[DataMember]
public DateTim... | asp.net | [9] |
303,041 | 303,042 | is there a c# qualification I can go for? | <p>I was wondering if there was any qualifications for c# , kind of like the Zend Qualification for PHP that would be recognised by an employer?</p>
| c# | [0] |
1,044,464 | 1,044,465 | Java: Need a hash Map where one supplies a function todo the hashing | <p>I would like to know of a Map that works like a regular HashMap/Hashtable except it takes a function which returns the hashcode and performs the equality test rather than letting the HashMap use Object.hashCode/equals. </p>
<p>I cant use TreeMap because the objects do not implement Comparable and there is no stable... | java | [1] |
2,821,640 | 2,821,641 | view xml data in jquery | <p>how do i display xml data using jquery? i don't need to parse it i just need to display it to the user on the page.</p>
<p>Here's my current code:</p>
<pre><code>$.ajax({
type: "POST",
dataType: "xml",
contentType: "application/json; charset=utf-8",
url: "Service2.svc/DoWork",
data: "{}",
p... | jquery | [5] |
2,716,258 | 2,716,259 | class method __instancecheck__ does not work | <p>I am using python 2.7.3 on Windows. I tried to override the <code>__instancecheck__</code> magic method as a class method. But I can not make it work.</p>
<pre><code>class Enumeration(int):
@classmethod
def __instancecheck__(cls, inst):
if type(inst) == cls:
return True
if isinst... | python | [7] |
1,332,985 | 1,332,986 | Comparing time using PHP | <p>I want to create an attendance system, in which the attendance based on following condition:</p>
<pre><code>// Conditions
define('LATE_COND', '1306566960'); // strtotime(date('09:16:00'))
define('HALF_COND', '1306576860'); // strtotime(date('09:16:00'))
define('LATE_CODE', '#FC9E4B');
define('HALF_CODE', '#CCFF33... | php | [2] |
125,899 | 125,900 | Cannot open attached file with '#' sign in the filename. Firebug prompts 'NetworkError: 401 Unauthorized' | <p>Cannot open attached file with '#' sign in the filename. Firebug prompts 'NetworkError: 401 Unauthorized'</p>
| asp.net | [9] |
2,837,407 | 2,837,408 | What does assigning variable to null do? | <p>In the following I get a compile time error that says "Use of unassigned local variable 'match'"
if I just enter string match; but it works when I use string match = null;
So what is the difference and in general, if a string is not being assigned a value right away should I be assigning to null like this?</p>
<pre... | c# | [0] |
1,195,771 | 1,195,772 | php issue in passing an array to Paypal | <p>I have an array of variables that I passing to Paypal via . The problem I have is when the Paypal screen loads the items, qty, price section is empty. Here is the code snippet for the passing:- (arrays cart_stock and cart_price hold the data to pass, $tmp_cart_count hold the total number of items to pass)</p>
<pre>... | php | [2] |
2,078,545 | 2,078,546 | jQuery Early Binding a Function Possible? | <p>I'm having a small issue with a bit of jQuery:</p>
<pre><code>function getQuickResults(terms)
{
var url = '/Search/PreviewSearch';
$.ajax({
type: "POST",
url: url,
data: { terms: terms },
dataType: "json",
error: function(xhr, status, error) {
alert(erro... | jquery | [5] |
731,831 | 731,832 | show table view data grouped by on iphone | <p>i am pulling data from xml so is that possible to show them group by??</p>
<p>i have no plsit right now i am showing data just as simple so now i want group by what should be the approach/concept??</p>
<p>i did something like this but no luck</p>
<p><strong>d*<em>o i need to do some sorting?? like using NSSortDes... | iphone | [8] |
269,861 | 269,862 | Strip Paragraph Tag | <p>In my image.php I am using this code to grab the image caption of each image. The problem is a paragraph tag ( <code><p></code> ) is being added around it and I don't want one to be. Could somebody tell me how to strip this tag?</p>
<pre><code><?php if ( !empty($post->post_excerpt) ) the_excerpt(); ?&... | php | [2] |
4,576,643 | 4,576,644 | How to select text node in DOM using jQuery? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/298750/how-do-i-select-text-nodes-with-jquery">How do I select text nodes with jQuery?</a> </p>
</blockquote>
<p>I have the following HTML:</p>
<pre><code><div id="main">17.00<span>%</span><... | jquery | [5] |
1,225,860 | 1,225,861 | Javascript windows.open error | <p>I have the following code at the end of my page. </p>
<pre><code><script>
$(".btn_fb").click(function() {
window.open("http://www.facebook.com/sharer.php?u="+document.URL+"&amp;t=<%hdl_Title%>", "Facebook", "width=660,height=400,scrollbars=no;resizable=no");
return false;
});
$(".btn_tw... | javascript | [3] |
765,868 | 765,869 | Python sys.modules contains a module which is not yet imported | <p>I'm trying to understand the difference between a loaded module vs. an imported module, if there is any.</p>
<p>I'm working in Python 2.7.3, and am just running Python from the command line.</p>
<p>If I execute:</p>
<p><code>import sys</code>
<code>sys.modules</code></p>
<p>I get a list which includes <code>os</... | python | [7] |
2,996,058 | 2,996,059 | pinterest sorcery | <p>maybe it's some kind of default behavior that I'm ignoring,
but at the moment I haven't the slightest idea of how once you click an element on the homepage of <a href="http://pinterest.com" rel="nofollow">http://pinterest.com</a> the url actually changes ie: <a href="http://pinterest.com/pin/60165344991931565/" rel=... | javascript | [3] |
4,574,168 | 4,574,169 | Can I make a methods caller return? | <p>If i have a method a() that call b(x):</p>
<pre><code>int d = 0;
void a(){
int c = b(x);
d = c;
}
int b(x){
if(somecondition){
return x;
}else{
retrun null;
}
}
</code></pre>
<p>Is there any way I can write the function <code>b(x)</code> so that it makes <code>a()</code> retur... | java | [1] |
2,540,505 | 2,540,506 | Android how to display English for phone with any languages | <p>I'm developing an app and would like to use only English (for now) for all different languages on a user phone.</p>
<p>Is that by default the (values/strings.xml) will be used for all or do I have to copy/replicate all the (values/strings.xml, values-es/strings.xml, values-fr/strings.xml, etc.) with English in them... | android | [4] |
1,028,869 | 1,028,870 | Convert Python List to Column in CSV | <p>I have a list of values (v1, v2, v3) and I want to write these to a column called VALUES in a csv. I'm using csvreader and csvwriter to get as far as I have. I've only figured out how to write them to rows using csvwriter.writerow.</p>
| python | [7] |
103,738 | 103,739 | counting http requests | <p>I want to count the number of all *.png requests on my site. Where/what files do I modify? Both 'success' and 'Not found' results should be counted.</p>
| php | [2] |
3,369,664 | 3,369,665 | Default constructors and POD | <p>I got what POD means, and I know that when I declare a structure in C++ as</p>
<pre><code>struct f {};
</code></pre>
<p>there's a default constructor, a default copy constructor, a default destructor, etc.. (if I got this correctly)</p>
<p>My question is: how can I declare a POD structure with just plain data (li... | c++ | [6] |
4,187,843 | 4,187,844 | Shading effect in menu Background | <p>Can I have Image as background of Menu in Android?</p>
| android | [4] |
5,346,500 | 5,346,501 | Linking button to launch activity | <p>Im trying to link up the array[1] to launch an activity but its showing me an error on this line <br> Intent i1 = new Intent(this, Difficulty.class); If any one sees where im going wrong help me please
<br> <br>the error reads "The constructor Intent(new DialogInterface.OnClickListener(){}, Class) is undefined" </p>... | android | [4] |
2,847,199 | 2,847,200 | Find out the number of arguments passed to a function consisting of default values for arguments in python | <p>Consider the following python function:</p>
<pre><code>def fun(x=0,y=1,z=1):
print x,y,z
fun(2)
</code></pre>
<p>Is there a way i can find out within the function how many arguments were actually passed to it,which in the above case is 1 ?</p>
<p>Please Help
Thank You</p>
| python | [7] |
5,739,737 | 5,739,738 | creating a tmp file in python | <p>I have this function that references the path of a file:</p>
<pre><code>some_obj.file_name(FILE_PATH)
</code></pre>
<p>where FILE_PATH is a string of the path of a file, i.e. 'H:/path/FILE_NAME.ext'</p>
<p>I want to create a file FILE_NAME.ext inside my python script with the content of a string:</p>
<pre><code>... | python | [7] |
4,089,376 | 4,089,377 | What is the base for making chat program | <p>Hi
I need to build chat program that will work in internal LAN
something like Messenger
where I can get sample code or help ?</p>
<p>thank's in advance</p>
| c# | [0] |
487,151 | 487,152 | Android: How to solve slow response after clicking TabWidget | <p>I have four Tab at the top of my apps<br>
The content of the fourth tab is that it will get data from sql server and then display in listview<br>
since the amount of data retrieved is quite big, it takes 2-3 sec<br>
The problem is that:<br>
After I click the fourth tab, it has no response, then after 2-3sec, it disp... | android | [4] |
232,143 | 232,144 | I have a method which only needs to be executed once in PHP but will be called twice. How do I structure this? | <p>I have a method in PHP which calls a SOAP service, parses some data and returns it.</p>
<p>It will return the same data - it asks how many records in a data object.</p>
<p>I need to call it twice with a pass.</p>
<p>My question is, what is best practice for structuring this in PHP? I've tried to see if the functi... | php | [2] |
3,963,138 | 3,963,139 | Avoid (limit) low memory force close of an activity | <p>I have a problem with an activity force close in android when memory fell down.</p>
<p>My activity has a button that calls a particular class, where some tasks are performed in a separate thread (it should take up to 10').
On the emulator I have no problem, but on the phone sometimes the activity went closed for l... | android | [4] |
3,291,350 | 3,291,351 | Perfom a task when my app restored from background | <p>I need to do some network request when user restores my app from background (for example: worked with app - pressed home button - home screen - switched to my app again via task manager or clicked app icon). I don't want this to be triggered by screen rotate or simple change of current activity by startActivity(). W... | android | [4] |
2,094,815 | 2,094,816 | C++ random numbers | <p>How can I use random numbers in Linux and C++?</p>
<p>I have found some code I would like to use, it has the line</p>
<pre><code>srand((unsigned)time(0));//seed
</code></pre>
<p>but gcc says</p>
<blockquote>
<p>board.cpp:94:24: error: ‘time’ was not declared in this scope</p>
</blockquote>
<p>I have included ... | c++ | [6] |
5,465,007 | 5,465,008 | Jquery .focus() not working without tabindex attribute of div | <p>How can I make jquery <code>.focus()</code> to work without setting tabindex of a div</p>
<pre><code> $("#msgdiv").focus();
<div id="msgdiv" tabindex="100"> </div>
</code></pre>
<p>what is the best practise for this</p>
<p>what i want to achieve: After changing the password i want to display the ack... | jquery | [5] |
1,095,513 | 1,095,514 | async http requests servicing | <p>My page sends several HTTP requests in background. The requests are triggered by some user actions. Some user actions can cause redirect - and here we have a problem: we want redirect to happen only when all the requests were sent.</p>
<p>The question is: is there any Javascript library you can recommend that would... | javascript | [3] |
5,108,252 | 5,108,253 | Invoking J2EE web services from iPhone | <p>Is it possible to Invoke J2EE web services from iPhone? and how?</p>
| iphone | [8] |
5,311,502 | 5,311,503 | How to run the program during lock screen on Android | <p>I am writing a program that reuqire to do something during lock screen, I am wondering how to make this happen. For example, like phone receiving message, alarm ringing, or anti-viruse app scaning the phone during "lock screen"</p>
| android | [4] |
430,290 | 430,291 | Android - How to make slide menu like facebook, spotify and Google + | <p>I want to add a slide menu to my app like the facebook app. I read alot of things on the internet about librarys but none worked for me.
What is the best thing/library that i can use for this and can someone maybe explain me how to use it?</p>
<p><strong>Edit</strong>
This is my layout:</p>
<pre><code><Relativ... | android | [4] |
2,116,759 | 2,116,760 | How to update multiple instances asp.net website | <p>We have a server with IIS which runs about 20 instances of our asp.net website. Whenever I make an update at the moment I have to manually update those instances. This is obviously not scalable. </p>
<p>What are the best practices doing this? I was thinking putting a map on the server and let the other instances wa... | asp.net | [9] |
1,720,775 | 1,720,776 | Is it possible to detect users timezone and adjust time stamps showed? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/863474/automatically-detect-users-current-local-time-with-javascript-or-php">Automatically detect user's current local time with JavaScript or PHP</a> </p>
</blockquote>
<p>I had this idea of detecting the c... | php | [2] |
3,242,829 | 3,242,830 | PHP check which directory/ php scripts are loaded | <p>Is there anyway for this PHP script to know what are the scripts or directories that are currently loaded? I am talking about my scripts, not specific module</p>
<p>The reason I ask this is because, due to the layers and layers of <code>include</code>s ( now don't get me started on what <code>include</code> or <cod... | php | [2] |
5,072,834 | 5,072,835 | Undo redirect of stdout with dup2 | <p>The following code is writing both "A" and "B" to the file "out.txt", with the first call to open returning 3 and second call returning 4.</p>
<p>What I expected is for "A" to be written to the file and "B" to be written to the screen. I also expected open to return 3 in each case.</p>
<p>What should I do to fix t... | c++ | [6] |
3,988,564 | 3,988,565 | How to read the xml file being used by another process in asp.net | <p>I'm working on asp.net application.
In my application I'm tryin to read one xml file which is used by some ohter c++ process.
But I'm getting the error like file is being used by another process.</p>
<p>I tried as follows.</p>
<pre><code>FileStream fs = new FileStream(Server.MapPath("./" + webPageXml),FileMode.Ope... | asp.net | [9] |
5,687,406 | 5,687,407 | error: cannot find symbol IOUtils.copy(in, out); | <p>Using Apache ANT to built. Included the commons-io-2.4.jar in classpath.
Compiler shows this error:</p>
<pre><code> error: cannot find symbol
[javac] IOUtils.copy(in, out);
</code></pre>
<h2>EDIT - code</h2>
<pre><code>File f1 = new File("c:\\json\\user.json");
File f2 = new File("c:\\json\\user1.jso... | java | [1] |
2,663,537 | 2,663,538 | Is it safe to use WakefulIntentService 0.3.0 for pre-2.0 device support? | <p>My app supports users down to 1.6 (API level 4) and I want to use WakefulIntentService for scheduled background checks of required data. From a <a href="http://commonsware.com/blog/2010/12/28/wakefulintentservice-updated.html" rel="nofollow">blog post on Dec. 28 2010</a>, Mark indicates the reasoning for dropping s... | android | [4] |
963,083 | 963,084 | onclick has a dependency on i value of for loop. How do I remove it? | <p>I'm writing a simple calculator in JavaScript. I have buttons for 0 to 9, +, -, *, /, =, and C for clear. I want to assign event handlers to each button's onclick. Since the buttons for 0 to 9 have very similar event handlers, I used a for loop to assign to each button's onclick:</p>
<pre><code>/* one, two, three, ... | javascript | [3] |
5,221,755 | 5,221,756 | Deadlock situation | <p>I have some trouble understanding the concept of deadlock situation in this program.
I am getting the output as :
Entered amethod
Entered bmethod
and then the deadlock situation occurs.
Now since my amethod is a synchronized method, shouldn't it execute first completely i.e. by calling bsum method and then start t... | java | [1] |
4,911,207 | 4,911,208 | jQuery Hiding element based on previous row td value | <p>I have a table like this:</p>
<pre><code><table>
<tr>
<td>
<a href="/payinvoice/1">Pay Invoice 1</a>
<span class="paid hidden">False</span>
</td>
</tr>
<tr>
<td>
<a href="/pay... | jquery | [5] |
546,871 | 546,872 | Is there an Android utility for storing a static map? | <p>I've got a common use-case wherein a user selects one item out of many (say, on a spinner or autocomplete list), then enters the data. For example, let's say the user selects a country. Ultimately, the data I want is the country code, not the country name; but the users will want to select based on name, not code.... | android | [4] |
4,332,136 | 4,332,137 | How is animation accomplished in these apps? | <p>Most of the Android users use the <a href="http://www.talkandroid.com/23387-go-sms-for-android-is-a-clean-alternative-sms-app/" rel="nofollow">GO SMS</a> app, and the iPhone users use their normal messaging app (Android rocks). Now, whenever a user types a message and presses the send button, the message's edit text... | android | [4] |
4,339,527 | 4,339,528 | I am getting listView.getChildCount(), is 0 after setting the arrayadapter? | <p>I want to load images from facebook and populate in listview, i am able to get list of friends and their info but i want to set image i am getting getChildCount() 0 , please help,</p>
<pre><code> public static ArrayList<FBUser> fbUserArrayList;
public static Drawable sharedDrawable;
public void on... | android | [4] |
1,504,090 | 1,504,091 | How do i clone a java byte array? | <p>I have a byte array which i want to copy/clone to avoid calling code from modifying my internal representation. </p>
<p>How do i clone a java byte array?</p>
| java | [1] |
2,363,127 | 2,363,128 | Calculate days between two day_of_week : Android | <p>I have a query regarding to find out which is day (in given list) is nearest day from today.</p>
<p>For example </p>
<pre><code>day_list is Mon, Tue, Fri, Sat
and today is Wed
</code></pre>
<p><em>Now If we calculate days on paper,</em></p>
<pre><code>Wed to Mon = 5 days
Wed to Tue = 6 days
Wed to Fri = 2 days
W... | android | [4] |
3,207,495 | 3,207,496 | is there an error in this class prototype (java) | <pre><code>Class AddMe extends JProgressBar implements TableCellRenderer
{
public AddMe (int max,int min)//constructor
{
super(min,max);
}
}
</code></pre>
| java | [1] |
5,258,129 | 5,258,130 | Is this considered best coding practice? | <p>I have seen a video tutorial in C# and I followed it to learn C#. However, I am not sure if the author does follow best practice or not. What I asked myself about is why didn't he create a method to print the speed rather than Console.WritLine that in two different methods As follow:</p>
<pre><code>using System;
us... | c# | [0] |
532,642 | 532,643 | Returning multiple items from a function call in PHP | <p>Is it possible to return multiple items from a function - and assign them to several variables in a single statement - like can be done in some languages (e.g. Python) ?</p>
<p>For example, can I have something like this:</p>
<pre><code>a, b, c,d = foo();
</code></pre>
| php | [2] |
1,740,198 | 1,740,199 | Can you fake out Array.isArray() with a user-defined object? | <p>I'm curious about whether there is any way to fake out <code>Array.isArray()</code> with a user-defined object.</p>
<p>From the book JavaScript Patterns:</p>
<pre><code>Array.isArray([]); // true
// trying to fool the check
// with an array-like object
Array.isArray({
length: 1,
"0": 1,
slice: function () {... | javascript | [3] |
5,813,598 | 5,813,599 | Converting a sbyte to char cls-compliantly | <p>I have C# wrapper of a C Library. It has a method that returns an sbyte that is supposed to represent a char. I can use Convert.ToChar but this is not CLS-compliant. What is the best practice for converting this sbyte to a char compliantly?</p>
| c# | [0] |
3,922,905 | 3,922,906 | Jquery change elements values? | <p>I have 5 divs. </p>
<pre><code><div class="wx-temp">89 <sup>°F</sup></div>
<div class="wx-temp">91 <sup>°F</sup></div>
<div class="wx-temp">87 <sup>°F</sup></div>
<div class="wx-temp">90 <sup>°F</sup></div>
<div class... | jquery | [5] |
828,218 | 828,219 | Event from JAva Script to objective c | <p>I am developing a map application for iPhone.I am using google maps API to develop this,by adding the java script file to the resource.My problem is that I need to catch an event defined in the java script. for eg: I need to cath the following event in java script
"GEvent.addListener(poly, "click", function(latlng,... | iphone | [8] |
3,705,691 | 3,705,692 | res\layout\Contact_us.xml: Invalid file name: must contain only [a-z0-9_.] | <pre><code>public class main extends Activity {
/** Called when the activity is first created. */
EditText username,password1;
Button sub;
String uname,pass;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
sub = (Button) findVi... | android | [4] |
1,667,478 | 1,667,479 | PHP calculate age | <p>I'm looking for a way to calculate the age of a person, given their DOB in the format dd/mm/yyyy.</p>
<p>I was using the following function which worked fine for several months until some kind of glitch caused the while loop to never end and grind the entire site to a halt. Since there are almost 100,000 DOBs goin... | php | [2] |
5,019,993 | 5,019,994 | Metaheuristic Algorithm vs evolutionary algorithm? | <p>what is the difference between "meta-heuristic" and "evolutionary" algorithm? applications for each, with sample code?</p>
<p>i thought i can use artificial immune system for particular problem how can we frame it based on those algorithm? </p>
| java | [1] |
5,375,747 | 5,375,748 | how i get col index on mouse down of class in jquery | <pre><code><table>
<tr class="csstablelisttd">
<td>
</td>
<td>
15
</td>
</tr>
<tr class="csstablelisttd">
<td>
</td>
<td>
30
</td>
</tr>
<tr class="csstablelisttd">
<td>
<... | jquery | [5] |
3,183,330 | 3,183,331 | Empty output file | <p>I have the following which, no matter what I have in the input file, gives me an empty file in the end, but I have no idea why, so I'd like to ask for your help if possible, thank you.</p>
<pre><code> import re
import sys
import os
if len(sys.argv) > 1 :
inf = sys.argv[1]
if os.... | python | [7] |
808,122 | 808,123 | How to run the Linux "cd" command from Java? | <p>I want to write a Java program to delete ~12 directories or files which are under my home directory. I am able to do this by using </p>
<pre><code>Process proc = Runtime.getRuntime().exec("rm -rf *path*")
</code></pre>
<p>But I have to run this command 12 times or I can keep it in loop. What I really want is to h... | java | [1] |
1,378,171 | 1,378,172 | Nested Usercontrols and ViewState | <p>I have a UserControlParent that dynamically loads UserControlChild.</p>
<p>In the UserControlChild, I store a value using the ViewState object by doing a </p>
<pre><code>ViewState["count"] = myCount;
</code></pre>
<p>On Postbacks, the ViewState returns a null. Is this because the UserControlChild is being loaded ... | asp.net | [9] |
2,367,378 | 2,367,379 | Why Linearlayout needs to be wrapped in scrollview to make it scrollable.? | <p>Why can't setting the view's xml attribute <code>android:scrollbars="horizontal|vertical"</code> make LinearLayout scrollable.?</p>
| android | [4] |
122,802 | 122,803 | How to check if an object is null | <p>Here is my code:</p>
<pre><code>public static class SerializationUtil
{
public static string Serialize(object obj)
{
if (obj == null)
return string.Empty;
StringWriter writer = new StringWriter();
new System.Web.UI.LosFormatter().Serialize(writer, obj);
return wr... | c# | [0] |
4,363,427 | 4,363,428 | implementing Grid menu in android app | <p>Hello everyone i am trying to implement android Grid menu .I am following this <a href="http://mytelcoit.com/2010/02/programming-android-create-icon-with-text-using-gridview-and-layout-inflater/" rel="nofollow">link</a></p>
<p>I am getting errors although i have imported all thing . I want to ask where i suppose to... | android | [4] |
5,418,544 | 5,418,545 | What is the difference between sys and os.sys | <p>What is the difference between <code>sys</code> and <code>os.sys</code> in python? I have seen many projects using <code>sys</code> when they have imported <code>os</code>. When I tried <code>dir(sys)</code> and <code>dir(os.sys)</code> they had same functions and their output was same.</p>
<p>I often see code usin... | python | [7] |
5,959,984 | 5,959,985 | Basic java print | <p>Please note the print statements, in the code segments below. My question is how come If I try to add two doubles in the print statement it prints incorrectly, but if I add them outside the print statement and store the result in a variable than I am able to print it correctly.</p>
<p>Why does this work and print o... | java | [1] |
5,973,874 | 5,973,875 | refreshing and reloading an Activity from a Service without exiting the Activity, Android appwidget | <p>Good day, I have an activity which i navigate to from an icon on an appwidget using pending Intents. Everything is being done in a service class. Now, the activity has a refresh button which when pressed, it sends an intent that calls the onStart() method on the service to update itself and perform some web operatio... | android | [4] |
3,633,297 | 3,633,298 | Java compatibility | <p>I'm running the same code on two machines. One (windows 7 64) uses:</p>
<pre><code>java version "1.7.0"
java<TM> SE Runtime Environment <build 1.7.0-b147>
Java HotSpot<TM> 64-Bit Server VM <build 21.0-b17, mixed code>
</code></pre>
<p>and the other (linux 64) uses:</p>
<pre><code>java vers... | java | [1] |
5,333,319 | 5,333,320 | Poker Hand Evaluator | <p>I have a method the determines a flush, just want some opinions. It looks through an poker hand array, compares the suits, and counts every time a card is matched, and if it is 4, then it returns true. Is there a more efficient way to do this?</p>
<pre><code>public boolean isFlush(PlayingCard[] hand)
{
... | java | [1] |
2,985,381 | 2,985,382 | FALSE if statements | <p>I'm looking for a good explanation for what is the differences/advantages to using which of the following:</p>
<p><code>if (!$whatever)</code> or <code>if ($whatever == FALSE)</code></p>
| php | [2] |
3,601,415 | 3,601,416 | result is disappeared when mobile orientation is changed | <p>in my application result displayed in Text view is disappeared when mobile orientation is changed,for this what can i do.i want my application in both modes means portrait and landscape.for this what can i do.Give me some suggestions.Thanks in advance</p>
| android | [4] |
5,892,798 | 5,892,799 | OO PHP question regarding arrays | <p>I'm trying to learn object oriented PHP by porting some of the simple exercises I've learnt in Java to PHP. This is one of them, to calculate the total salary of 3 people. </p>
<p>I'm apparently having a problem with the array in the family class - php gives an error about "Undefined variable: a_family" on line 32.... | php | [2] |
4,675,029 | 4,675,030 | How to bring back library functions which have been deleted? | <p>Suppose I do this</p>
<pre><code>import cmath
del cmath
cmath.sqrt(-1)
</code></pre>
<p>I get this</p>
<pre><code>Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'cmath' is not defined
</code></pre>
<p>But when I import <code>cmath</code> again, I am able to u... | python | [7] |
3,663,146 | 3,663,147 | Class attribute or argument's default value | <p>I've found the following open source code in Python:</p>
<pre><code>class Wait:
timeout = 9
def __init__(self, timeout=None):
if timeout is not None:
self.timeout = timeout
...
</code></pre>
<p>I'm trying to understand if there are advantages of the code above vs using default argument's val... | python | [7] |
2,427,317 | 2,427,318 | EditText inside of ListView causes redraw? | <p>I have a ListView containing an EditText per item.<br />
I set <code>android:descendantFocusability="afterDescendants"</code> on the ListView so I am able to type on the SoftwareKeyboard.
As long as I type only whitespaces everything is fine. The issue comes as soon as I start typing real words. That's when the litt... | android | [4] |
2,767,273 | 2,767,274 | Apply a Row major Order for a set of 3D data | <p>Well I am stuck on a problem, where I need to write a set of data file in row major order. The data are 3D concentration points so to say in x, y and z and they are all computed into:
Pac = [Pac[0], Pac[1], Pac[2]]</p>
<p>So I tried to do the following To read these data in row major order:</p>
<pre><code>fp = ope... | python | [7] |
3,522,665 | 3,522,666 | php hello world in eclipse not working | <p>I have created a simple hello world php app in eclipse with the name od FirstPHP
when i try to run it as "run as php web page"
it tries opening the page<br>
<a href="http://localhost/FirstPhp/first.php" rel="nofollow">http://localhost/FirstPhp/first.php</a>
in eclipse web browser<br>
and got the messag... | php | [2] |
1,742,520 | 1,742,521 | Delegate Example From C# In Depth Confusion | <p>I am looking at this example: </p>
<pre><code>List<Product> products = Product. GetSampleProducts() ;
products.Sort(
(first, second) => first.Name.CompareTo(second. Name)
) ;
foreach (Product product in products)
{
Console. WriteLine(product) ;
}
</code></pre>
<p>What function is actually called i... | c# | [0] |
3,709,254 | 3,709,255 | Format a nested list in place | <p>I have the following list of tuples --</p>
<pre><code>[('one',[1,2,5,3,9,8]), ('two',[9,8,5,1])]
</code></pre>
<p>And need to sort the nested list, while keeping the ordering of the tuples as is --</p>
<pre><code>[('one',[1,2,3,5,8,9]), ('two',[1,5,8,9])]
</code></pre>
<p>The way that I am currently doing this i... | python | [7] |
5,821,971 | 5,821,972 | PHP regex doesn't match? | <p>I have the following RegEx</p>
<p><code>@version:\'(?:CKEditor )?([\d\.]+)(?:.+revision:\'([\d]+))?@</code></p>
<p>And it should match</p>
<p><code>version:"4.0 Beta"</code></p>
<p>and return 4.0 Beta</p>
<p>But it doesn't seem to be working? Am I missing something?</p>
| php | [2] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.