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,701,801 | 2,701,802 | TO initiate Python shell | <p>You can use subprocess.call("/usr/bin/python") to open Python shell within a piece of Python code. Now my question is is it possible to predefine some variables/functions before initialization of this shell? In other words, inside Python code, I can define a bunch of useful variables and functions and I want them to... | python | [7] |
2,682,050 | 2,682,051 | Javascript counter issue | <p>I'm working now with site with paralaxx effect. I catch mouse position from window. If mouse on top window.InnerHeight / 100 * 20 i will get window.mouseposition = "top" and window.mouseposition = "bottom". </p>
<p>I have issue in function i get broken counter.</p>
<p>But when dom is loaded, i have var currentSli... | javascript | [3] |
2,849,747 | 2,849,748 | Why is mktime() returning unexpected results? | <pre><code>$date['start'] = date("o-m-d", mktime(0, 0, 0, 1, 1, 2010));
$date['end'] = date("o-m-d", mktime(0, 0, 0, 2, 1, 2010));
</code></pre>
<p>Each element contains <code>2009-01-01</code>, <code>2010-02-01</code> respectively. Why is the first element returning 2009, when it has been specified as 2010?</p>
<p>W... | php | [2] |
1,292,683 | 1,292,684 | How can I provide an iPhone app that will be integrated into a customer's project without providing the source code? | <p>I would like to provide my client a native iPhone application module that he could integrate within his own iPhone application.</p>
<p>I don't want to provide the source code.</p>
<p>How can I achieve this?</p>
| iphone | [8] |
4,724,521 | 4,724,522 | how to i input a sentence so that the program will recognize the sentence as a single word? | <p>lets say i input : 'dog is mammal'</p>
<p>i would like to search for this sentence in a text document. How do i do this in java ?</p>
<pre><code> System.out.println("Please enter the query :");
Scanner scan2 = new Scanner(System.in);
String word2 = scan2.nextLine();
String[] array2 = word2.split(" ... | java | [1] |
5,233,869 | 5,233,870 | how can I customize and change the background color of spinner in android? | <p>I want to change the background color of spinner and customize spinner. When I used this code in xml android:background="#000000" the color changed but the arrow on the spinner disappears. How can I cuztomize spinner and change the background color without disappearing the arrow?</p>
| android | [4] |
5,857,912 | 5,857,913 | How to know if no object has focus? | <p>How do I find out if no object has focus?</p>
<p>Example scenario: The page reloads and I run a function which will say if any object has focus or no one has it.</p>
<p>Just asking here because google didn't help.</p>
| javascript | [3] |
1,025,893 | 1,025,894 | Can I shrink this code with an array or loop? | <p>Forgive me, I hope this question isn't too obvious, I'm a javascript noob.</p>
<p>I have javascript code that takes numbers from an xml sheet and displays them in td elements on an html page. It works but I think it could be condensed into an array or a loop to be more efficient.</p>
<p>Is there a better way to wr... | javascript | [3] |
359,857 | 359,858 | This function is only working sometimes | <pre><code>function getYoutubeVideoId($url) {
$urlParts = parse_url($url);
if($urlParts === false)
return false;
if(isset($urlParts['host']) && strtolower($urlParts['host']) === 'youtu.be')
return ltrim($urlParts['path'], '/');
if(isset($urlParts['query'])) {
parse_str... | php | [2] |
4,599,236 | 4,599,237 | Is it good practice to require the type in a class template to respond to a certain func? | <p>The std lib has types in class templates that requires the type to override certain OPERATORS, for exmple, the type we use in std::map requires the type to support the < operator.</p>
<p>But is it good to require certain FUNCTIONS? Consider this silly example</p>
<pre><code>template <typename T> struct Fo... | c++ | [6] |
2,613,762 | 2,613,763 | Content Script cross domain or message passing | <p>I am writing a javascript extention that modifies a website. The extention adds a button to the website, and when clicked it modifies the page content. My script has to send cross domain xmlhttprequests to websiteB, and gets permissions upon installation to do so. </p>
<p>My problem is that the code that runs in th... | javascript | [3] |
2,445,739 | 2,445,740 | Calling an Async function multiple times | <p>I have an Async function</p>
<pre><code>function AsyncFunc(args){
//does some async work here
}
</code></pre>
<p>then I call this function multiple times in a <code>for</code> loop:</p>
<pre><code>for(var i=0; i<10; i++)
{
AsyncFunc(i);
}
</code></pre>
<p>Does this create multiple copies of the <code>... | javascript | [3] |
5,445,151 | 5,445,152 | how do I send a line through the server in a loop? | <pre><code>Socket s1=new Socket("localhost",3001);
System.out.println("Client process");
byte b[]=new byte[150];
int n=4;
BufferedReader BR=new BufferedReader(new InputStreamReader(s1.getInputStream()));
String str=new String();
while((str=BR.readLine())!=null)
{
System.out.println();
System.out.println(str);
}... | java | [1] |
5,161,444 | 5,161,445 | changing background of link when clicked using jquery | <p>I have 4 links with background color that i need to be changed when i click , i use this code to change the background :</p>
<p>jquery :</p>
<pre><code>$(document).ready(function() {
$('#content_area').load($('.pm_class:first').attr('href'));
$('.pm_class').click(function() {
var href = $(this).attr('href... | jquery | [5] |
449,318 | 449,319 | Issue in Calling Service | <p>Here is my service class</p>
<pre><code> import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
public class Communicationservice extends Service {
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-g... | android | [4] |
1,051,045 | 1,051,046 | C# array within a struct | <p>Want to do this:
(EDIT: bad sample code, ignore and skip below)</p>
<pre><code>struct RECORD {
char[] name = new char[16];
int dt1;
}
struct BLOCK {
char[] version = new char[4];
int field1;
int field2;
RECORD[] records = new RECORD[15];
char[] filler1 = new char[24];
}
</code></pre>
... | c# | [0] |
2,921,404 | 2,921,405 | how to get all primitive type of an object | <p>I wanna have all properties of an object which have primitive type, and if the object has a relation to another class , I wanna have the primitive properties of this another class too</p>
<p>the problem is if entity A has entity B and B has A, what can I do</p>
<p>in simple case by using reflection I can get first... | c# | [0] |
3,799,147 | 3,799,148 | PHP to pseudocode? | <p>Is there a tool for converting PHP source to pseudocode automatically?</p>
<p>I implemented some algorithm and i want to have its standard independent-language pseudocode. please help me to find the tool,if any.</p>
<p>Edit: </p>
<p>for example, the PHP source is:</p>
<pre><code>$A=array('b');
array_unshift($A,'... | php | [2] |
5,947,433 | 5,947,434 | Making a listadapter that supports integers | <p>im trying to implement a listAdapter that supports integer Arraylists by extending the baseAdapter, when initialize the activity my app crashes. Since im new to android i was wondering if anybody could spot something wrong with my implementation</p>
<pre><code>package com.test.testapp;
import java.util.ArrayList;... | android | [4] |
1,303,316 | 1,303,317 | How to access to given element in Json | <p>I am new to Json. please tell me how to access following element. this is my Json </p>
<pre><code>var data = {"student":[{"fname":"mad", "sname":"cha"}, {"fname":"sun", "sname":"ban"}, {"fname":"sha", "sname":"kiri"}]};
</code></pre>
<p>so how I access to the <code>"mad"</code>value.</p>
<p>actually this is what ... | javascript | [3] |
3,359,349 | 3,359,350 | Long running PHP methods - how to handle? | <p>Here's my scenario. During signup for my app - i trigger a few PHP method calls that are long running (e.g. get UserFriendLikes, etc using OpenGraph API). </p>
<p>I want the methods to run in the background without the user noticing it - and leave the method to complete at its own time. </p>
<p>Whats the best way ... | php | [2] |
4,391,276 | 4,391,277 | java.util.NoSuchElementException even though input file has data | <p>I have written this code to find out an output and i am running this using Runtime in a servlet. It shows java.util.NoSuchElementEception even though i have checked that input file has some data:</p>
<pre><code>public class Sec1q10 {
static int fact(int n) {
int p = 1;
if (n != 1) {
p = n * fact(n ... | java | [1] |
5,131,011 | 5,131,012 | What's the best way to defer actions after a request in ASP.NET? | <p>I'm writing an ASP.NET application. When a specific kind of request is being handled, I want to schedule a method to be called in a certain number of minutes after the request is handled. The postponed method does not need to communicate with the client that made the original request, it is just intended to do some... | asp.net | [9] |
2,764,110 | 2,764,111 | How to Declare Folder Path? | <p>I have a desktop application using Swing library. Application is running a batch file. So I created a <code>lib</code> folder in main project directory and put batch file in it. To run this, I am showing <code>lib\a.exe</code> to run this. It is working on my laptop. I exported .jar and put lib folder next to it. It... | java | [1] |
4,982,425 | 4,982,426 | how to disable/enable group of linkbutton | <p>I need to disable 4-5 linkbuttons when one of the linkbutton is clicked.On one linkbutton click disable a group of linkbutton and when a session turns null enable all the linkbutton back to enable mode.I tried few methods none of it is truly disabling the linkbutton.</p>
| asp.net | [9] |
2,466,839 | 2,466,840 | What are all of the possible values of the textStatus parameter in the callback function of jQuery .load? | <p>I am utilising the callback function of jQuery's <a href="http://api.jquery.com/load/" rel="nofollow">.load</a> method to run certain code if the <code>textStatus</code> parameter of the <code>.load</code> method is equal to a certain string.</p>
<p><strong>e.g. I have</strong></p>
<pre><code>jQuery("#myContainer"... | jquery | [5] |
4,723,697 | 4,723,698 | .net windows service | <p>I have created my c# console application as windows service and installed the service in remote server which is 32 bit machine and has 2GB RAM.
To this server application many clients are connected and gets the data from server.
The problem is sometimes the server machine is down and unable to access the data, th... | c# | [0] |
3,522,482 | 3,522,483 | How to compare two dates in php and echo newer one? | <p><strong>How to compare two dates in php and echo newer one?</strong></p>
<p>My dates are in the following format: <code>date("F j, Y, g:i a");</code> which give us <code>August 12, 2011, 9:45 am</code>.</p>
<p>My dates are as follow:</p>
<ul>
<li>date 1 <code>$created</code></li>
<li>date 2 <code>$updated</code> ... | php | [2] |
3,894,577 | 3,894,578 | Target div with jQuery | <p>I have modified my code to streamline it a bit better. I need to be able to hide "old" span and show "new" one when "change" is clicked. I tried using siblings() but it does not appear to work. Am I missing something here:</p>
<pre><code>$(".new").hide();
$('.change').click(function() {
$(".new").hide();
$... | jquery | [5] |
953,520 | 953,521 | How Get Message from TCP/IP Python? | <p>how do I get the message that more than two messages in the buffer in the TCP / IP connection in python if I use the XML-RPC. I've tried using Cherrypy if the message is received by a normal state if more than one it will not get the message.</p>
| python | [7] |
4,396,721 | 4,396,722 | What are the differences between using array offsets vs pointer incrementation? | <p>Given 2 functions, which should be faster, if there is any difference at all? Assume that the input data is very large</p>
<pre><code>void iterate1(const char* pIn, int Size)
{
for ( int offset = 0; offset < Size; ++offset )
{
doSomething( pIn[offset] );
}
}
</code></pre>
<p>vs </p>
<pre><code>v... | c++ | [6] |
1,841,042 | 1,841,043 | How can I fire a jQuery event when scrolling? | <p>I'm so close to having my menu figured out. I've followed the instructions given by jQuery for Designers on <a href="http://jqueryfordesigners.com/fixed-floating-elements/" rel="nofollow">Fixed Floating Elements</a>. I want to extend this by putting the Site Title above the menu I've created when you scroll. </p>
<... | jquery | [5] |
626,324 | 626,325 | How to display a particular word in bold using jquery? | <p>How to display a particular word in bold using jquery.</p>
<pre><code>function OnSuccess(response) {
var user = $('#username').val();
if (response.d == 1) {
$('#result').text(user + ' already Exists');
$('#Button1').attr('disabled', true);
} els... | jquery | [5] |
5,309,586 | 5,309,587 | jquery toggle on multiple divs only working on first element | <p>ive created a page but it's only toggling the first div and the other 2 arent working... can't work out why! Thanks in advance</p>
<pre><code>var levelopen=false;
$(document).ready(function() {
$('.contentlevel').hide();
$('#levelopener').click(function(){
if(levelopen==false)
{
... | jquery | [5] |
5,643,180 | 5,643,181 | JQuery text() is not working in Internet Explorer 7 | <p>I developed a simple webapp using asp.net, C# and jquery and I'm testing my app using Internet Explorer 7. I used ajax to retrieve data from the server. But calling the text() of jquery is not working, instead it will call the val() method, for example I created a drop down list called NameDrp, then,</p>
<pre><code... | jquery | [5] |
3,770,056 | 3,770,057 | How do I deal with a forced close message on Android? | <p>I am having trouble debugging my app that causes a pop-up "Forced close" message every time I try to use my android app. How can I go around it ?</p>
| android | [4] |
2,662,726 | 2,662,727 | arrays using python | <p>I have 2 arrays. query_array and stem_array.
stem_array has elements in format (word | synonyms). the query_array has words in it.</p>
<p>I want to check if the query_array has words that are contained in the synonyms part of the stem_array and if yes, then map the synonym to the actual word.</p>
<p>for eg: query_... | python | [7] |
1,759,180 | 1,759,181 | Has get_object_vars changed in version 5.4? | <p>I used to get all public vars from a class inside a class with a Closure like this:</p>
<pre><code>Class myClass
{
public $foo;
private $bar;
private function GetFields()
{
$lambda = function( $obj ) { return get_object_vars( $obj ); };
return $lambda( $this );
}
public function SomeFunction()... | php | [2] |
2,341,249 | 2,341,250 | Replace values in a URI query string | <p>I have part of a query string that I want to make a replacement in. I want to use <code>preg_replace</code> but am kind of hung up on the regex. </p>
<p>Can someone please help? What I need replaced are the GET vars.</p>
<p>Here is the string:</p>
<pre><code>bikeType=G&nikeNumber=4351
</code></pre>
| php | [2] |
4,129,857 | 4,129,858 | Using interpreter to lookup module 'sys' in Python | <p>So I just installed the python interpreter and wanted to use the help(sys) feature to get more information about the sys module, but I got this error and had no idea what went wrong.</p>
<pre><code>C:\Users\Jake>python
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help... | python | [7] |
774,119 | 774,120 | Display number int in Python | <p>How to display numbers integer in python ?
For example:</p>
<pre><code>number1 = raw_input('Write one number: ')
number2 = raw_input('Write other number: ')
result = number1 + number2
print "The sum of the numbers is: %d" % result # here, display the result of the operatio n.
</code></pre>
| python | [7] |
4,385,165 | 4,385,166 | Java iterating through all the files and only the unique RAR archives in a directory | <p>How can I iterate over over all the RAR archives in a directory. I know how to iterate over the files in a directory but I'm only interested in RAR archives. If they were simple RAR archives with the extension <code>.rar</code> it wouldn't be an issue but my directories can have multiple spanned archives and I only ... | java | [1] |
4,377,847 | 4,377,848 | Encrypt a query string inside of an anchor tag | <pre><code>echo '<a class="bigbtn" href="'.'videoview.php?song_id='.$video['song_id'].'&'.'title='.$video['VideoTITLE'].'&'.'group='.$video['GroupName'].'&'.'artist='.$video['ByArtist'].'"></a>' ;
</code></pre>
<p>what is the best way to encrypt the link when appear in the browser a that user c... | php | [2] |
3,426,196 | 3,426,197 | How to check ensure a array does not contain the same element twice | <p>I have a loop which assigns randomly generated integers into an array.
I need a way to ensure the same integer is not input into the array twice.</p>
<p>I figured creating a loop inside the overall loop would work but I am unsure on what to execute here.</p>
<pre><code>int wwe[] = new int[9];
for(int i = 0; i <... | java | [1] |
3,970,497 | 3,970,498 | How to disable GestureListener in android? | <p>I have implemented GestureListener, and it is working perfectly, but how can I remove GestureListener from my view?</p>
<pre><code>@Override
public boolean onTouchEvent(MotionEvent event) {
if ( event.getAction() == MotionEvent.ACTION_UP ) {
// remove gestureDetector
} else {
mGestureDetec... | android | [4] |
1,266,454 | 1,266,455 | Should I cache the return value of a getter if it is just a simple delegate? | <p>For example:</p>
<p>I'm creating a CSV file and I have a <code>CsvOptions</code> object which holds several parameters for the CSV file creation.</p>
<pre><code>if (cells.hasNext()) {
output.write(csvOptions.getDelimiter());
}
</code></pre>
<p>The <code>csvOptions</code> is just a simple container object, tha... | java | [1] |
4,943,333 | 4,943,334 | Initializing Dynamic Array of Strings (C++) | <p>I am working on assignment to create a container class for a dynamic array of strings. I know that it would be much easier/better done with std::vector, but that is not the point. I am having a problem finding the right way to initialize my array in the constructor. The way it is below, I am still being warned by th... | c++ | [6] |
195,009 | 195,010 | Application does not run on Nexus 7 but runs on other devices | <p>I have made an application that runs on android phones and emulators pretty well, but it gives me an error when I run it on Nexus 7 :</p>
<p>Here is my logcat report :</p>
<pre><code>java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.aks.mobilereagents/com.aks.mobilereagents.MobileReagentsAc
ti... | android | [4] |
1,357,508 | 1,357,509 | c# find image in html and download them | <p>i want download all images stored in html(web page) , i dont know how much image will be download , and i don`t want use "HTML AGILITY PACK" </p>
<p>i search in google but all site make me more confused ,</p>
<p>i tried regex but only one result ... , </p>
| c# | [0] |
5,305,039 | 5,305,040 | how to upgrade php version | <p>I am using crimson editor which is simply a text editor which uses php version 5.2.13 (I know its old). But I want to update the php version to atleast 5.3 because I want to use the fileinfo command which only works on version 5.3 and beyond.</p>
<p>So my question is how can I upgrade the phpversion easily and safe... | php | [2] |
4,107,699 | 4,107,700 | can we access properties from constructor | <p>I am working on a CSharp code where in constructor i need to access properties of that class. Logically it looks troublesome to me since i will be accessing properties of the object that hasn't is still under construction.</p>
<p>Its an old code using c# version 4.0 and i am kind of refactoring it so that's why can... | c# | [0] |
349,314 | 349,315 | Disable page refresh | <p>I need to prevent users from refreshing a page.</p>
<ol>
<li>I have scripted in such a way that there is no 'forward' or 'backward' movement required.</li>
<li>However, if one refreshes the page, 'everything' starts from the beginning.
<ul>
<li>To save everything before page refresh and restore them after is not id... | javascript | [3] |
3,926,086 | 3,926,087 | Android: How do I register applications that are not running, with a service? | <p>Background: Android provides a nice method of backing up data. To have the data of an application backed up whenever a system-wide backup is performed, an application should have a backup agent specified as an attribute of it's application tag, in the applications manifest.</p>
<pre><code><application android:l... | android | [4] |
3,395,184 | 3,395,185 | How to show div based value from dropdown on click? | <p>I'm trying to show some different divs based on the value a user has choosen, when he/she clicks the "go-button". Here is my script:</p>
<pre><code>$(document).ready(function(){
$('#divarea1').hide();
$('#divarea2').hide();
$('#divarea3').hide();
$('#go-button').click(function() {
var whatToShow = $('#dro... | jquery | [5] |
4,683,012 | 4,683,013 | Running a piece of code when Notification deleted | <p>I'm trying to figure out how to run a piece of code when a notification gets cleared.
I've found that the Notification class provides a deleteIntent which is run when the notification is cleared, but I have been unable to find any resource that explains how I could go about getting this to run a piece of code within... | android | [4] |
3,234,047 | 3,234,048 | Run simple php file or call a single php fuction(same as simple php file) which is better? | <p>I have 2 php files (both's output are same)
I'st file code</p>
<pre><code><?php
function sampleCode()
{
//code here
}
//end function
sampleCode();
?>
</code></pre>
<p>II'nd file code</p>
<pre><code><?php
//code here
?>
</code></pre>
<p>which is better and less use cpu when i don't need to recall or i... | php | [2] |
1,615,717 | 1,615,718 | Problems with Relative layout | <p>I am trying to place two components. The first one (Edittext) should expand till the next component (a submit Button). How do I do this? My XML is as follows...
The problem is that the Edittext expands to fill the screen and hides the button:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
</code></pre>... | android | [4] |
1,508,432 | 1,508,433 | Javascript trouble parseFloat and if/ else loop | <p>So working on some code and I'm not spotting the issue with my loop in the second function it keeps returning 40, I think the loop is written correctly. I'm guessing its the value passed within the if and else condition? if (par_hour < 40) which comes from parseFloat</p>
<pre><code> function addEmployee()
{
va... | javascript | [3] |
1,128,496 | 1,128,497 | How to Refresh GridView? | <p>How to Refresh Grid view?</p>
<p>I was download image from RSS Site using Image Loader Class but the main Problem is the images was displayed in grid view after i was scrolling the grid view many times otherwise default image is displayed.</p>
<p>Please Help me.</p>
| android | [4] |
5,043,836 | 5,043,837 | Jquery passing function values to a ajax function | <p>I've two jQuery UI date pickers and a drop down box.</p>
<p>Each of them are a function. Now how do i take the three function variable and pass it to AJAX function?</p>
<p>I tried defining var a global but this is not working.</p>
<p><strong>Below is dummy example code</strong></p>
<pre><code>$('selector').subm... | jquery | [5] |
2,298,360 | 2,298,361 | How to Stop a Service in Android when the application is not running. | <p>I have Started my service in one of my main activity class.The problem is that when my application is not running I want to Stop my service.How can i implement this.Is there any option to stop it without stopping it using any button click or other click events of the control.</p>
<p>Also is there any way to indicat... | android | [4] |
534,812 | 534,813 | Android Mobile number and Wi-Fi MAC address | <p>I want to know Mobile number and Wi-Fi-Address .Howis this possible.Can anyone Help me</p>
| android | [4] |
883,793 | 883,794 | Need to flash the screen GREEN for 5 secs | <p>I have a particular requirement.</p>
<pre><code>if(condition true){
Flash the screen GREEN for 5 secs
}else{
Flash the screen RED for 5 secs
}
</code></pre>
<p>Could anyone please help in this regard?</p>
| android | [4] |
4,009,446 | 4,009,447 | inserting characters at the start and end of a string | <p>I am new and trying to find a way to insert a number of L's at the beginning and end of a string. So if I have a string which says </p>
<p>"where did I put my cupcake this morning" </p>
<p>And I want to insert 1 L at the start and 2 L's at the end, so it looks like: "Lwhere did I put my cupcake this morningLL" How... | python | [7] |
3,237,751 | 3,237,752 | Shutdown BlueCove stack programmatically | <p>Is there any way to shutdown the BlueCove stack, in my application user can able to start, stop and restart the bluetooth server whenever they wish, for that I can able to start the server, listen for connection, accept message from the client. But when I try to stop and restart the BlueCove, I'm gettting BluetoothS... | java | [1] |
2,651,684 | 2,651,685 | How to randomly place 2 unique points on a 2D array? | <p>The picking itself is easy, but I'm having trouble making sure I can't place the points on the same spot. I could of course re-random, but is there a better way? Thanks a lot!</p>
| c++ | [6] |
4,315,689 | 4,315,690 | Android: there is an error when i click on my editText | <p>I am working in android. i have a problem. my application crashes when i click on my text box second time.</p>
<p>this is my Logcat message:</p>
<pre><code>java.lang.IndexOutOfBoundsException: setSpan (4 ... 4) ends beyond length 0
android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:943)
and... | android | [4] |
4,427,722 | 4,427,723 | how to show tab bar like iphone | <p>how to show tab bar below of the screen like in iphone in android?</p>
| android | [4] |
5,381,965 | 5,381,966 | What is the difference if I put Main() inside a struct instead of a class? | <p>What is the difference if I put the static method <code>Main()</code> inside a struct instead of a class?</p>
<pre><code>struct Program
{
static void Main(string[] args)
{
System.Console.WriteLine("Hello World");
}
}
</code></pre>
<p>If there is no difference, why did Microsoft choose a class f... | c# | [0] |
1,614,309 | 1,614,310 | js creating abstract class | <p>i am trying to create a abstract class (mimicking oops) in js using below declaration. If i use prototype keyword for every method below it fails (see case-1 below) however when i use without prototype keyword it works not sure am i declaring it correclty.. however same declaration works when js file is declared to ... | javascript | [3] |
552,691 | 552,692 | In Js How to wrap all last childred of an oject tree? | <p>Just wanted to write some recursion but can't check if the child is in fact some finite thing, when checking throught jQuery.isPlainObject , just getting a saparate letters as a childs , like I want "this is error message" - to be a last child , but can't detect it</p>
| javascript | [3] |
4,452,470 | 4,452,471 | Developing a polling mechanism | <p>In C#, what is the best way to create a polling mechanism? So I have some code which can periodically do some action.</p>
<p>This is for web services so any UI-related solutions won't apply.</p>
<p>Thanks</p>
| c# | [0] |
310,606 | 310,607 | howto change method indexer to propoties of indexer? | <pre><code>public ArrayList choiceArray = new ArrayList();
public UC_RadioX Item(int index)
{
return (UC_RadioX)choiceArray[index];
}
</code></pre>
<p>when i used</p>
<pre><code> cc.Item(0).Checked = true;
cc.Item(1).Checked = true;
</code></pre>
<p>howto change method to propoties... | c# | [0] |
4,048,975 | 4,048,976 | deep copy cloning via serialization | <p>I came accross this:</p>
<p><a href="http://www.codeproject.com/KB/tips/SerializedObjectCloner.aspx" rel="nofollow">http://www.codeproject.com/KB/tips/SerializedObjectCloner.aspx</a></p>
<p>and would like to use it to deep copy a object graph. Is it sufficient to mark all the classes that potentially participate i... | c# | [0] |
5,838,873 | 5,838,874 | Which approach is "better" (in terms of optimization and complexity) | <p>Suppose that whe have some object, derived from these class instances</p>
<pre><code>class A
{
...
private b //list of object of class B
}
class B
{
...
private c //list of object of class C
}
class C
{
...
private id
}
</code></pre>
<p>Now, somewhere in my code, I've got this situation</p>
<pre><code>functi... | php | [2] |
2,111,941 | 2,111,942 | PHP Security on Forms and DOM Manipulation | <p>I was having an interesting discussion with a fellow co-worker about security in PHP.</p>
<p>Let's say a person has a PHP site running with a standard HTML form. An attacked decides to use Chrome Developer tools and add in the DOM <code>enctype="multipart/form-data"</code> and a <code>file input</code>. </p>
<p>Th... | php | [2] |
778,584 | 778,585 | How do I control the alignment of formatted text in Java? | <p>I'm knocking my head here using System.out.printf and I really don't understand something that seems that it should be much more simple.</p>
<pre><code>public class main{
public static void main(String args[]){
double dog = 3.85;
double cat = 333.85;
System.out.printf("Hola:%7.1f\n",dog... | java | [1] |
3,154,354 | 3,154,355 | destructor of a singleton class is called twice! | <p>i have the code as below :</p>
<pre><code> class Singleton {
private:
int i;
static bool stnflag;
static Singleton* single;
Singleton(int a)
{
i=a;
}
public:
static Singleton* getinstance(int);
void function();
~S... | c++ | [6] |
4,202,468 | 4,202,469 | Call class method while instantiating? | <p>I don't know how to describe it better so the title might be a bit confusing.</p>
<p>I would like to know if it is possible to instantiate a class by using <code>... = new MyClass()</code> and to call non static methods of this class instantly while instantiating?</p>
<p>For example something like that:</p>
<pre>... | c# | [0] |
786,868 | 786,869 | How to display Current Location ADDRESS in textbox? | <p>I've created this Textbox, and a Button beside it. I've also linked this Button to a class which display a map with the longitude, latitude, a push pin etc. But i have a question, how do i make this textbox such that it auto generate the current location address ? </p>
| android | [4] |
1,106,359 | 1,106,360 | How to get the html header values like h1 using html parser dom? | <p>how to get the header value like h1 or h2 which lies inside a div having some class name using simple html parser dom?
ex: - <code><html>
<body>
<div class="somename">
<h1>MyText</h1>
</div>
</body>
... | php | [2] |
5,340,471 | 5,340,472 | ImageButton doesn't scale / adapt according to different resolutions | <p>I have a imagebutton placed inside a RelativeLayout.
However I can't seem to figure out what I need to do in order for the button to scale according to different resolutions.</p>
<p>Here's the content of my activity_main.xml:</p>
<pre><code><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/andro... | android | [4] |
4,903,476 | 4,903,477 | Reading a javascript script, why so many $ (dollar signs)? | <p>I am trying to decipher a .js script and I am finding it filled with $ throughout? Is there any reason to use this? I'm pretty new to JavaScript.</p>
| javascript | [3] |
5,558,791 | 5,558,792 | Isinstance() doesn't work | <p>For some reason I can't get isinstance() to work on Python 2.7.2</p>
<pre><code>def print_lol(the_list, indent=False, level=0):
for item in the_list:
if isinstance(item, list):
print_lol(item, indent, level+1)
else:
print(item)
</code></pre>
<p>And when I compile and run... | python | [7] |
1,851,427 | 1,851,428 | How to execute the loop for specific time | <p>How can i execute the a particluar loop for specified time</p>
<pre><code>Timeinsecond = 600
int time = 0;
while (Timeinsecond > time)
{
// do something here
}
</code></pre>
<p>How can i set the time varaible here, if i can use the Timer object start and stop method it doesnot return me time in seconds</p>
... | c# | [0] |
5,256,425 | 5,256,426 | A simple script that works for hover, but why can't I get it to work for clicks? | <p>I have a very simple js script that works for hovers, but I want to convert the hover into a click feature. When I try to switch hover to click though, it does not work.</p>
<p>Here is the complete example script just for reference. When someone hovers over this class, a little text with a background appears below.... | jquery | [5] |
3,882,096 | 3,882,097 | jQuery code difference | <p>Let me start by saying that I'm not a JavaScript programer or a jQuery guru by any means, I'm actually just starting with jQuery.</p>
<p>I have the two following jQuery codes:</p>
<pre><code>$('.tipTrigger').hover(function(){
$(this).toggleClass('active').prev('.tipText').stop(true, true).fadeToggle('fast');
... | jquery | [5] |
654,747 | 654,748 | Android: Fetching an XML from a web service: Threads | <p>Fetching an XML from a web service in background and displaying a progress bar in front while the xml is being downloaded in Android</p>
| android | [4] |
3,296,935 | 3,296,936 | getelementbyid and tagname and classname | <p>I want to know how you can get element using pure javascript.</p>
<p>I have my code below:</p>
<pre><code> <html>
<body>
<div id="abc" class="xy"> 123 </div>
<p id="abc" class="xyz"> 123 </p>
<span id="foo" cl... | javascript | [3] |
3,617,344 | 3,617,345 | JSObject: Download it or available in JRE 1.6? | <p>This is a question from a Java noob.</p>
<p>I have eclipse open (JRE 1.6), <a href="http://svn.littleshoot.org/svn/littleshoot/trunk/client/applet/src/main/java/LittleShootApplet.java">I have copied this code into an eclipse class</a>.</p>
<p>The line in question is this:</p>
<pre><code>import netscape.javascript... | java | [1] |
1,869,845 | 1,869,846 | Script doesnt recognize the file even though the file is present | <p>I am trying to open a file "test_msm8974.sh" from the root directory using the following code,even though the file is present I keep getting the error beow,is there a better way to implement this or suggestions on why the script is not finding it?</p>
<pre><code>try:
with open("test_" + target + ".sh") as f: pa... | python | [7] |
123,637 | 123,638 | Question related to UITextView | <p>How to adjust height of textview programetically as we are typing the text
textview should increase upwards with no limit.UIScrollview for textview is disable in our case.We are giving scroll for entire view to see upward contents in textview</p>
| iphone | [8] |
3,298,434 | 3,298,435 | Is there a way to take a memory dump on app crash? | <p>I am busy writing an app and I have noticed that it sometimes crashes, and when it does and I get back to my computer then I only have the stack trace.</p>
<p>Is there a way for me to take a memory dump of the app at crash time?</p>
<p>Thanks</p>
| android | [4] |
5,984,531 | 5,984,532 | How to Listview updated after delete database? | <pre><code>ListView lv = (ListView) findViewById(R.id.list);
lv.refreshDrawableState();
</code></pre>
<p>is not working.</p>
| android | [4] |
3,208,117 | 3,208,118 | Export a webpage using query and php | <p>I have tables and images in a php webpage.
I want to export all the data to pdf.
Can anybody tel me how do I export the data to pdf using jquery?</p>
<p>Thank You</p>
| jquery | [5] |
1,980,275 | 1,980,276 | Exception while parsing Date | <p>I'm getting a datetime from a webservice, wich is actually pulling the data from a sqlserver db, the problem is I'm getting a parse exception when I try to convert the string to Date:</p>
<p>Here is my code: </p>
<pre><code>String tschedule = json.getString("ScheduledFor");
String tduration = json.getString("Durat... | android | [4] |
4,602,891 | 4,602,892 | Problems trying to assign **varname to *varname[]. c++ | <p>In my .h, I have a variable, <code>Texture ** skyboxTextures</code>. I assign some texture pointers in one method, and use them right away:</p>
<pre><code>Texture *skt[] = {
tleft,
tright,
tfront,
tback,
tup,
tdown
};
skyboxTextures = skt;
for(int i = 0; i < 6; i++)
{
skyboxTextures... | c++ | [6] |
111,235 | 111,236 | Why is REL not detected in a jQuery attribute selector | <p>If I use the following selector I get no results</p>
<pre><code>$(".itemSearchModule .cmsItemList[rel='myRelValue']")
</code></pre>
<p>for the following html snippet</p>
<pre><code><div class="itemSearchModule">
<ul class="cmsItemList" rel="myRelValue">
<li>something</li>
<... | jquery | [5] |
2,140,025 | 2,140,026 | .load() now loading live data into the div in IE9 works fine in FF and chrome | <p>After adding a new data I am reloading the div with new data. IT works fine in FF and chrome but it load crap data in IE9.</p>
<pre><code>$('#tabledata').load('load.php');
</code></pre>
| jquery | [5] |
4,558,996 | 4,558,997 | Looping through Javascript Method and add data to the Method | <p>I have a Array of Month Values inside JavaScript .</p>
<pre><code>var myarray = new Array();
myarray2.push("January");
myarray2.push("February");
myarray2.push("March");
myarray2.push("April");
myarray2.push("May");
myarray2.push("Jun");
myarray2.push("Jul");
myarray2.push("Aug");
myarray2.push("Sept");
myarray2.... | javascript | [3] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.