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 |
|---|---|---|---|---|---|
3,719,515 | 3,719,516 | What's the point of a main function and/or __name__ == "__main__" check in Python? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/419163/what-does-if-namemain-do">What does <if __name__==”__main__”:> do?</a> </p>
</blockquote>
<p>I occasionally notice something like the following in Python scripts:</p>
<pre><code>if __name... | python | [7] |
388,923 | 388,924 | Is it possible to have a member pointer to an array in a struct? | <p>Is it possible to have a member pointer to an array in a struct? I would like to do something like below:</p>
<pre><code>struct A
{
int array[10];
int sizeOfArray;
};
template<int size>
class B
{
public:
B(int (A::*arrayLocation)[size],
int A::*arraySize):
memberArray... | c++ | [6] |
2,781,160 | 2,781,161 | What's the point of FILL_AND_STROKE? | <p>Android newb here, so I'm trying out the android graphics classes.
I wanted to draw some arcs/circles with a fill color and black outline.
The Paint class has a style for FILL_AND_STROKE, but there doesn't seem to be a way to set the fill color vs. stroke color. So as far as I can tell it's the same as FILL?</p>
<... | android | [4] |
387,576 | 387,577 | How to get a list of unchecked checkboxes when submitting a form? | <p>I have this code for example :</p>
<pre><code>$b = "";
while ($row = mysql_fetch_array($rows)) {
if ($row['enabled'] == 1) {
$b = "checked";
} else {
$b = "":
}
</code></pre>
<p>echo "<\input name='nam[$row[id]]' type='checkbox... | php | [2] |
5,537,598 | 5,537,599 | Access a List in JUnit Test Case | <p>I have this ParkingLot.java</p>
<pre><code> public class ParkingLot {
private final int size;
private Car[] slots = null;
List<String> list = new ArrayList<String>();
public ParkingLot(int size) {
this.size = size;
this.slots = new Car[size];
}
public List licenseWithAParticularColour(String... | java | [1] |
2,909,442 | 2,909,443 | Should all the using directives for namespaces be inside the namespace? | <p>Microsoft StyleCop provided a warning when the using directives for namespaces are provided outside of the namespace. Is this really required as my view on this is that using dircetives for namespaces is for providing a alias name for namespace and for removing the need for providing the namespace name when a class/... | c# | [0] |
5,162,819 | 5,162,820 | How to handle conditional-imports-dependent exceptions? | <p>I'm wondering what is the most elegant way to handle exceptions that depend on a conditional import.
For example:</p>
<pre><code>import ldap
try:
...
l = ldap.open(...)
l.simple_bind_s(...)
...
except ldap.INVALID_CREDENTIALS, e:
pass
except ldap.SERVER_DOWN, e:
pass
</code></pre>
<p>In the... | python | [7] |
2,368,495 | 2,368,496 | Invoking a service on other java application running on the same machine | <p>I created a command line interface on a small java application I created for personal use.
For the moment the cli is resided in the same project as the original application but I'm planning to extract it into it's own project, effectively building 2 separate executable jars enabling me to start the cli as needed and... | java | [1] |
524,300 | 524,301 | Java Index Array Out of Bounds Exception | <p>This loop is strange. </p>
<p>I ran this in Java, it gives an Index out of bounds exception. I can't find an <code>int l</code> declaration anywhere in the source code and i can't figure out what it is and found out that it is legal for it to be declared this way.</p>
<p>But the deal here is, i don't understand wh... | java | [1] |
6,002,785 | 6,002,786 | Javascript performance consideration. Is dot operator faster than subscript notation? | <p>Is dot operator faster than subscript notation?</p>
<pre><code>var obj = {x: '5'};
obj.x = 'some value';
obj['x'] = 'some value';
</code></pre>
| javascript | [3] |
793,795 | 793,796 | Figure out the element in the a table (using class) when using jquery | <p>I am using a table grid in my HTML and while clicking on a specific <code>col</code> in each row, I dynamically create an additional row using <code><tr></code>. The additional row is used to submit data to the server and remove it after submit. Now I would like in addition to this that the row number of the t... | jquery | [5] |
5,246,817 | 5,246,818 | how to change html image src by j-query | <p>view.aspx </p>
<pre><code><img src ="~/UserControls/Vote/Images/Arrow Up.png" id = "voteupoff"
runat = "server" alt ="vote up"
class="voteupImage" style="height: 45px; width: 45px"/>
</code></pre>
<p>i wnat to change it src ~/UserControls/Vote/Images/aftervoteupArrowUp.png when click on ... | jquery | [5] |
4,271,511 | 4,271,512 | How to move a movie from Camera Roll to app's Documents folder? | <p>How can I copy/move a movie from Camera Roll to an app's own Documents folder?</p>
| iphone | [8] |
2,147,946 | 2,147,947 | Set custom color to the Table row according to table data by jQuery | <p>I am facing a problem regarding jquery Heat Color. i want to set a custom color to the all row according to a table data of that row.The is generated in run time.i set a hidden text field and comparing with this value set a particular color.i am using the code..</p>
<p>$("#tblreg > tbody > tr").heatcolor()//for eve... | jquery | [5] |
5,566,039 | 5,566,040 | jQuery .show()/.hide() not working | <p>I am trying to use jQuery hide and show functions. It didn't really work. Here is my code:</p>
<pre><code> $("button#demoButton").click(function () {
$("p#demo").hide("slow");
});
</code></pre>
<p>Edit: When I clicked button, nothing happened.</p>
| jquery | [5] |
4,434,245 | 4,434,246 | Alternative to using KSOAP for accessing WebService from Android application due to KSOAP jar size | <p>I am adding <strong>ksoap2-j2se-full-2.1.2.jar</strong> as external jar into Android project & accessing the <strong>SOAP API</strong> to access <strong>.NET webservices from Android application</strong>.
<strong>The size of the ksoap2-j2se-full-2.1.2.jar is 96 KB</strong> & so I dont want to increase the si... | android | [4] |
3,371,793 | 3,371,794 | document.write is stopping me from printing | <p>When I create a document using javascript document.write</p>
<p>this is an iframe</p>
<p>then i call iframe.print()</p>
<p>nothing happens no error and no print dialog.</p>
<p>how can I print?</p>
<pre><code>MyFrame.document.write('<html><body>'+HTMLText + '</body></html>');
document.get... | javascript | [3] |
3,876,386 | 3,876,387 | "Unable to load DLL ..... Invalid access to memory location" error | <p>I am using a third party .dll (<a href="http://www.soft.tahionic.com/" rel="nofollow">from this website</a>) which generates Hardware ID. I am using it as per the <a href="http://www.soft.tahionic.com/download-hdd_id/hardware%20id%20programming%20source%20code/how%20to%20call%20it.html#dotnet_C#" rel="nofollow">dire... | c# | [0] |
4,407,481 | 4,407,482 | How to Adjust the size of text in the TextView? | <p>I have look to a lot of tutorial to how to adjust a textView but i don't really a
understand how?</p>
<p>i am using a simple Activity that have a TextView that i went it to be the bigger as possible
That is the class </p>
<pre><code>public class Zoom extends Activity
{
private String productName;
public void onC... | android | [4] |
3,505,974 | 3,505,975 | Trouble playing audio files in javascript array | <p>I'm trying to create a button which when clicked plays an audio file and then when it's clicked again plays the next file in my array. I get it to play but when I click it the second time it plays both the first file AND the second. When I press it the third time it plays the first, second and third. Seems like I ne... | javascript | [3] |
4,379,225 | 4,379,226 | running several system commands in parallel | <p>I write a simple script that executes a system command on a sequence of files.
To speed things up, I'd like to run them in parallel, but not all at once - i need to control maximum number of simultaneously running commands.
What whould be the easiest way to approach this ?</p>
| python | [7] |
2,102,461 | 2,102,462 | Java apache commons collections primitives import issues | <p>I have commons-primitives-1.0.jar added as external executable jar on my eclipse.<br>
So i am able to <code>import org.apache.commons.collections.primitives.ArrayUnsignedShortList;</code></p>
<p>and I have a function </p>
<pre><code>private void start() {
_nexts = new ArrayList(_iterators.size());
for (... | java | [1] |
2,586,075 | 2,586,076 | c# Validation for login | <p>My script isnt checking the requirement can u help me out with this?
I'm trying to make it run the script before it run the onclick to check if login is right.</p>
<pre><code> <script type="text/javascript">
function checkform() {
var name = document.getElementsByTagName("UserName");
... | asp.net | [9] |
4,628,970 | 4,628,971 | window.location affected by escape key? | <p>I have a timer to refresh the page, and it's working:</p>
<pre><code>updateCountdown = function() {
if (Variables.Seconds == Infinity) {
} else if (Variables.Seconds == 0) {
$countdown.text('Bam!');
window.location.replace(Variables.PageName);
} else {
$countdown.text(Variables.S... | javascript | [3] |
4,650,121 | 4,650,122 | How to avoid repeted creation Jquery wrapper? | <p>Is there any way to avoid using <code>$("#check1")</code> second time in below statement? </p>
<pre><code>$("#check1").prop("checked",!$("#check1").prop("checked"));
</code></pre>
<p>By any trick can I do something like below?</p>
<pre><code>$("#check1").prop("checked",!this.prop("checked"));
</code></pre>
| jquery | [5] |
2,247,135 | 2,247,136 | Decrease text size if too long | <p>I have a couple textviews, I would like to limit them to a certain visual length, say 50% width of screen. If the text reaches 50% of the screen, I would like to do something to stop it from continuing across the screen. I thought maybe if it hits that limit, to just decrease the textsize for every character so that... | android | [4] |
4,920,956 | 4,920,957 | call method name and body from sql server | <p>i want to call a method using MethodInfo and MethodBody Class of System.Reflection and the name and body of the method is in sql server how can i do that please help</p>
<pre><code> SqlConnection con = new SqlConnection(GlobalData.GetConnectionString());
SqlCommand cmd = new SqlCommand("select C... | c# | [0] |
5,853,408 | 5,853,409 | how to run app in background while phone is in any state | <p>i want to build recycle bin app
for that my app observe
all the deleted events that happens
in phone and make a notification to the user is that a particular file is deleted.
for this reason app should be run in background without displaying any ui to the user.</p>
| android | [4] |
4,323,404 | 4,323,405 | Why can't I increment a variable of an enumerated type? | <p>I have a enumerated type <code>StackID</code>, and I am using the enumeration to refer to an index of a particular vector and it makes my code easier to read. </p>
<p>However, I now have the need to create a variable called <code>nextAvail</code> of type <code>StackID</code>. (it actually refers to a particular sta... | c++ | [6] |
1,712,351 | 1,712,352 | Dynamically create Instance fields for a JavaScript Object | <p>I have a dynamically-created list of strings called 'variables'. I need to use these strings as the instance variables for an array of JavaScript objects.</p>
<pre><code>var objectsArr = [];
function obj(){};
for (var i=0; i<someNumberOfObjects; i++ ) {
...
objectsArr[i] = new Object();
... | javascript | [3] |
6,014,138 | 6,014,139 | substr not working? php | <p>Unfortunately I can't point you to a live example. But I've got a form that submits a bunch of data to the database.</p>
<p>I retrieve the 'date' field with </p>
<pre><code>genesis_custom_field('date')
</code></pre>
<p>and the output date is "mm/dd/yyyy" e.g., 02/19/2012</p>
<p>so shouldn't </p>
<pre><code>echo... | php | [2] |
3,916,498 | 3,916,499 | How can I turn this jquery into a function? | <p>I would like to turn the below jquery code into a function so i could add links to the list and not have to touch the jquery. I'm assuming I will have to put the image name into the <code><a href></code> tag somewhere.</p>
<p>html code</p>
<pre><code><img id="storyimg" src="1.png" alt="img" />
<ul c... | jquery | [5] |
5,623,459 | 5,623,460 | How to get display keyboard event in android | <p>I have GridView <code>android:layout_height="match_parent"</code> with Editboxes, in <code>LinearLayout</code> with <strong>fix android:layout_height</strong>.</p>
<p>When I touch editbox, appears keyboard.</p>
<p><strong>How to change android:layout_height in LinearLayout when keyboard appears and when disappears... | android | [4] |
5,281,055 | 5,281,056 | Convert into database date in java | <p>I want to convert user entered date 31-12-2012 into PostgreSQL date format. i am appending date 'day-month-year' (31-12-2012)</p>
| java | [1] |
5,953,638 | 5,953,639 | Preventing multiple clicks from initiating animate | <p>I have a div box that if I double click will expand to the entire page. If I press a button that is produced once the div has expanded, the div box will minimize back to its original size. However, if I double click the div box, the event will be triggered twice, expanding the div box then immediately minimizing it.... | jquery | [5] |
706,744 | 706,745 | How to disable webview zoom out? | <p>I am loading javascript file in webview but If I double click a web view, it zooms out. Is there any way to disable that? </p>
<p>Thanks
Monali</p>
| android | [4] |
1,363,811 | 1,363,812 | Video storing giving warnings | <p>how to save a video file into sdcard?
I tried using the documentation procedure but it didnt helped me.
So i wet to another procedure but its giving a</p>
<blockquote>
<p>08-06 13:50:08.218: V/stopped here here(899): /mnt/sdcard/myfolder/abcmyCapturedVideoooo.3gp (Permission denied) </p>
</blockquote>
<p>warni... | android | [4] |
880,086 | 880,087 | Looking for duplicate in local text file | <p>please could someone help me with this duplicate checking function. I'm still quite fresh when it comes to PHP, so please excuse me, if this is a simple fix.</p>
<p>I'm storing a list of email addresses to a file called list.txt. Here is the content of the file (each on a new line):</p>
<pre><code>bob@foo.com
sam@... | php | [2] |
5,885,992 | 5,885,993 | how do I create a popup menu like when you push the bookmark icon in safari.. SEE PIC | <p>Hope this isn't a lame question but for the life of me I cannot figure out how to make a pop-up button menu like the image I've attached from my phone. Any help is appreciated!</p>
<p><img src="http://i.stack.imgur.com/lj9RK.png" alt="http://i.stack.imgur.com/pMbRg.png"></p>
| iphone | [8] |
5,590,424 | 5,590,425 | JavaScript prototype.init craziness | <p>Could someone please explain the significance of prototype.init function in JavaScript and when it is called during object instantiation?</p>
<p>Why would you want to overwrite it with an empty function?</p>
<p>I am reading the JavaScript for Web book and am stuck on the this for the past few hours...what is piece... | javascript | [3] |
5,090,351 | 5,090,352 | Changing onClick to be random | <p>I'm looking to make the handler OnClick to just be random instance instead of requiring user interaction.</p>
<pre><code>// add the canvas in
document.body.appendChild(mainCanvas);
document.addEventListener('mouseup', createFirework, true);
document.addEventListener('touchend', createFirework, true);
// and ... | javascript | [3] |
718,815 | 718,816 | JavaScript remove array | <p>I tried doing <code>delete weapons[i];</code> but even do when I do <code>weapons.length</code> I still get 1. Even though it should be 0. How do I definitely remove an array from <code>weapons[]</code> array?</p>
<p>I comb over the weapons array by doing this:</p>
<pre><code> for (var i = 0, setsLen = weap... | javascript | [3] |
4,150,322 | 4,150,323 | Split String and multiply 8 | <p>I am having trouble with this. The user needs to enter a string and then I need to count the string and multiply the same string. For example, if the user entered the string The quick brown fox jumps over the lazy dog;<br>
The output should look like this, The = 22% quick = 11% brown = 11% fox = 11% jumps = 11% over... | c# | [0] |
5,500,520 | 5,500,521 | Load Google Map in iPhone Application | <p>How can I load a google Map in my iPhone application?</p>
<p>Here I don't require entire web page, but just the graph part (zoomable).</p>
<p>any sample code link.(if available).</p>
<p>Thanks in advance.</p>
| iphone | [8] |
1,824,877 | 1,824,878 | document.addForm.submit() not working in firefox | <p>addForm is used as the form id, but the form submit is not working in firefox.</p>
<pre><code>$(function() {
var date = $("#todo_due").val();
var text = $("#todo_due").val();
if (date && text) {
document.addForm.submit();
} else if (!date && !text) {
new Messi('{$LANG.main.todo_validat... | jquery | [5] |
5,350,211 | 5,350,212 | DeliveryNotificationOptions won't work on gmail and hotmail | <p>I am using SmtpClient to send a message through a gmail account, I set DeliveryNotificationOptions to DeliveryNotificationOptions.OnSuccess, the message sent ok, but there is no delivery notifiacton. I also tried hotmail, still no delivery notification. However the same code works fine on outlook exchange server.</p... | c# | [0] |
1,852,191 | 1,852,192 | How do inner classes work in c#? | <p>If I have a class like:</p>
<pre><code>public class C1
{
public class SC1 {}
public class SC2 {}
public class C1()
{
}
}
</code></pre>
<p>Why can't I do this:</p>
<pre><code>C1 c1 = new C1();
c1.SC1.somePropety = 1234;
</code></pre>
| c# | [0] |
5,995,694 | 5,995,695 | How to get url, that app try to reach? | <p>I would like to know, how to get url, that app try to reach?</p>
<p>For example if "Angry Bird" try to reach www.ab.com/update.txt i would like to know about this.</p>
<p>Thanks.</p>
| android | [4] |
227,186 | 227,187 | How to clear edit box in grid view | <p>I have Gridview in my activity. Data adapter for my GridView:</p>
<pre><code>private class EfficientAdapter extends BaseAdapter {
...
public View getView(int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if (convertView == null) {
co... | android | [4] |
3,735,268 | 3,735,269 | portable code between windows and linux | <p>I have an aplication written for linux,and i want to make it to execute under windows too. So how can i make a specific line in code to execute only if the programs runs under windows ? I know its somehting with #ifdef... Thanks</p>
| c++ | [6] |
5,560,102 | 5,560,103 | accessing "models" of a javascript object | <p>I have an object that looks like this in my javascript console:</p>
<pre><code>r {length: 1, models: Array[1], _byId: Object, constructor: function, model: function…}
_byId: Object
length: 1
models: Array[1]
0: r
_changing: false
_events: Object
_pending: fals... | javascript | [3] |
5,986,454 | 5,986,455 | Preferred way of declaring and converting primitives to strings | <p>I have 3 options:</p>
<ol>
<li>Declare <code>double member</code> and later when I have to pass <code>String</code> use <code>member + ""</code>.</li>
<li>Declare <code>double member</code> and later when I have to pass <code>String</code> use <code>Double.toString(member)</code>.</li>
<li>Declare <code>Double memb... | java | [1] |
5,067,683 | 5,067,684 | super.clone() Queries? | <p>Kindly clarify me for the following questions.</p>
<ol>
<li>Does <code>super.clone()</code> perform Deep copying or shallow copying?</li>
<li>In the below example, why don't we need class <code>CompositeObjCloneMe</code> as cloneable? Does <code>cObj</code> won't be cloned while trying to clone <code>CloneMe</code>... | java | [1] |
5,879,001 | 5,879,002 | Android - Is this Code correct? | <p>is the below mentioned code correct</p>
<pre><code>public boolean checkRecipe(CharSequence recipename) throws SQLException
{
Cursor checkRecursor=rDb.query(true, DATABASE_TABLE, new String[]{KEY_TITLE},
KEY_TITLE+"="+recipename, null, null, null, null, null);
if(checkRecursor!=... | android | [4] |
4,305,441 | 4,305,442 | iPhone saving a web page to Home Screen | <p>I have iOS5 on my iPhone4 and when I tried to save a web page to the home screen I pressed the icon at the bottom and was given a list of options. None of the options was to Add to Home Screen. The options I see are Add Bookmark, Add to Reading List, Mail Link to this Page, Tweet and Print. </p>
<p>I have always... | iphone | [8] |
5,819,849 | 5,819,850 | PHP Warning inside CMD | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5709066/php-warning-wbexec">PHP Warning: wbExec</a> </p>
</blockquote>
<p>How should I deal with the message "PHP Warning: wbExec: Could not run application C:\foldername_path1\filename1.phpw in C:\foldername_pa... | php | [2] |
503,767 | 503,768 | c++ unorderd_map got me seg fault | <pre><code>#include <unordered_map>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
unordered_map <string, int> setupDictionary(vector<string> book)
{
unordered_map<string, int> table;
fo... | c++ | [6] |
1,218,279 | 1,218,280 | What is a better way to save the items of the playlist? | <p>In my music player if you add songs to the playlist , program first creates a directory by the name of playlist and then a <code>.txt</code> file. In this file , it adds the path or name of the song added in the playlist.Each entry is on a new line.So if i create a playlist named "Ghazals" and add 100 songs into tha... | java | [1] |
4,828,739 | 4,828,740 | Complicated way of Javascript function | <p>I observe a different (different for me) way to write function of javascript or jquery,,,you guys kindly guide me about the working of this one.</p>
<pre><code>(function ()
{
//some statements of javascript are sitting here
//some statements of javascript are sitting here
//some statements of javascript are sittin... | javascript | [3] |
3,292,744 | 3,292,745 | What will be the fastest way to access an element from a collection? | <p>What will be the fastest way to access an element from a collection?</p>
<p>I am thinking should be in the order (low to high):</p>
<p>Indexing an Array <= indexing a collection/list <= use key on Dictionary</p>
<p>But I am not sure... </p>
<p>1) Is indexing an array has same speed as indexing a list?</p>... | c# | [0] |
2,901,540 | 2,901,541 | "maximum recursion depth exceeded" when "property" is applied to instance variable "self.x" | <p>I was reading property(), which I understand is attribute access goes through the method specified in property().
But I got "RuntimeError: maximum recursion depth exceeded", when executed the following code.</p>
<pre><code>class Property(object):
def __init__(self):
self.x = "Raj"
def gettx(self):... | python | [7] |
3,657,121 | 3,657,122 | Error in function prototype | <p>Why does this code result in error?</p>
<pre><code>class CommonRuntine
{
public:
struct TProcess;
TProcess GetProcessByName(LPCSTR ProcessName);
};
</code></pre>
<p>It says "<strong>E2293 ) Expected</strong>" on the "<em>};</em>" bit</p>
<p>PS : LPCSTR is a type</p>
| c++ | [6] |
198,194 | 198,195 | alert when clicking on disabled tag | <p>i disable any input and select with this code:</p>
<pre><code> var elements = ['#lbl1' ,'#lbl2','#lbl3','#lbl4','#lbl5','#lbl6','#lbl7'];
jQuery.each(elements, function(element) {
$(elements[element]).attr('disabled', true);
});
</code></pre>
<p>now, i want to if user clicking on the disabled tags alert ... | jquery | [5] |
5,786,013 | 5,786,014 | How to replace whitespaces with dashes | <p>My idea is to remove special characters and html codes and replace the whitespaces to dashes
let us doing it step by step</p>
<pre><code>$text = "Hello world)<b> (*&^%$#@! it's me: and; love you.<p>";
</code></pre>
<p>now i'm want the output become <code>Hello-world-its-me-and-love-you</code>
I've ... | php | [2] |
3,953,120 | 3,953,121 | What library can I use to implement event driven programming in Python? | <p>Maybe something like Django signals that doesn't depend on Django.</p>
<p>Django signals can be used to <a href="http://larrymyers.com/articles/4/django-signals-and-caching" rel="nofollow">clear cache on saving a model</a>, I'm trying to do the same.</p>
| python | [7] |
4,328,556 | 4,328,557 | How to get the inner html value | <pre><code>var str_f = document.getElementById("" + j + "").innerHTML;
<p>
<span style="color: red">advertising cctv/bust</span>
<span style="color: red">a</span>tion
</p>
</code></pre>
<p>how can i get the value</p>
| javascript | [3] |
3,963,255 | 3,963,256 | How to enable User to surf during ASP.NET DLL upload | <p>I am using ASP.NET as the backend for windows phone browser. Sometime I need to make changes on the ASP.NET Pages WHILE users are surfing the website. I want to know how can I provide un-interrupted service to user in such a way they can surf during ASP.NET DLL uploading process:</p>
<p><strong>Assume</strong></p>... | asp.net | [9] |
30,512 | 30,513 | Java Call constructor multiple times | <p>I have a class that's essentially like:</p>
<pre><code>class Child extends Parent {
public void reinitialize() {
super(); // illegal
}
}
</code></pre>
<p>Basically, I want to call the constructor again to reinitialize. I can't refactor out the initialization code into its own method, because <code>Parent<... | java | [1] |
5,322,222 | 5,322,223 | Create a list (of tuples?) from two lists of different sizes | <p>I am stuck trying to perform this task and while trying I can't help thinking there will be a nicer way to code it than the way I have been trying.</p>
<p>I have a line of text and a keyword. I want to make a new list going down each character in each list. The keyword will just repeat itself until the end of the l... | python | [7] |
5,785,342 | 5,785,343 | Python - Indentation error while using IDLE and if - else block, works fine on command line | <p>I get the following indentation error</p>
<pre><code>>>> number = 35
>>> if number == 35:
print 'true'
else:
File "<pyshell#130>", line 3
else:
^
IndentationError: unindent does not match any outer indentation level
>>>
</code></pre>
<p>This happens only on IDL... | python | [7] |
3,948,617 | 3,948,618 | Javascript dynamic table (delete row) | <p>can anyone help me in deleting table row.
I have a dynamic table created for to do list rows are added dynamically using the array.
also delete button is added for every row and my question is how would you remove the row form the table while the button is pressed. All the data has to be removed form the array.
Than... | javascript | [3] |
4,858,639 | 4,858,640 | jquery scrollable displays all items | <p>I am trying to create a basic list using jQuery scrollable, but I have a problem in that the entire list is being displayed - not a subset as supposedly defined by the 'size' parameter in scrollable().</p>
<p>I am testing in Chrome, and it does not detect any javascript errors. Futhermore, the list seems to be capt... | jquery | [5] |
1,385,574 | 1,385,575 | Increase size of the image view (android) | <p>I have an imageview that loads and image in the xml. </p>
<p>I was wonder, how can I programmatically increase the image size ( or reduce it) by scale of 2? (so double it or make it half size)</p>
<p>Please help
Thanks</p>
| android | [4] |
4,497,520 | 4,497,521 | iphone image. multiple touches/drag | <p>The problem im facing rightnow is that in an above portion i have scrollview which have different images clicking on it will clone a same image on to the screen. i have enable touches so i can drag it, but when i clicked another image and it comes to the screen i can drag that anotther image but not the previous one... | iphone | [8] |
1,267,465 | 1,267,466 | PHP SQL Syntax Check if theres a match | <p>I am trying to query the db in php and get if there is a match / success but it's not resulting in success although it should so I've thinking there's a syntax error?</p>
<p>Here is the code:</p>
<pre><code>if ($db_found) {
$SQL = "SELECT * FROM wp_users where user_login='.$user.'";
$result = mysql_query($... | php | [2] |
2,040,469 | 2,040,470 | jQuery - Are there Multiview/Column plugins that are not using jQuery Mobile? | <p>I keep searching the web and almost all of the plugins are using <a href="http://jquerymobile.com/" rel="nofollow">jQuery Mobile</a>.</p>
<p>Are there any other Multiview/Column plugins that are generic?</p>
| jquery | [5] |
3,796,798 | 3,796,799 | What does "\u7cfb\u7edf\u7e41\u5fd9\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002" mean? | <p>I post some parameters to a PHP page and return some message, looks like <code>\u7cfb\u7edf\u7e41\u5fd9\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002</code>, I don't know what that means?</p>
| php | [2] |
2,410,065 | 2,410,066 | PHP Linkify Links In Content | <p>I've been working on a little project, and I find myself in a position where I need a php function which can linkify URLs in my data, while enabling me to set some exceptions on links I don't want to linkify. Any idea of how to do this?</p>
| php | [2] |
3,845,773 | 3,845,774 | How do I learn Java5 or Java6? | <p>I'm a very experienced Java programmer who has spent my entire time working with Java 1.4 and earlier. Where can I find a quick reference that will give me everything I need to know about the new features in Java5 and later in a quick reference?</p>
| java | [1] |
58,040 | 58,041 | How to keep radio selected states when hitting browser back button? | <p>I am handling a survey multistep form with many radio sets.</p>
<p>They have some default states</p>
<p>User operates over them to select his preferences.</p>
<p>Now the client wants when hitting either browser back button or the side navigator links (a set of links pointing to previous stages of the survey) to h... | php | [2] |
3,515,148 | 3,515,149 | Should the "sub"-activities in a TabActivity bind services? | <p>I am building an application based on a tabbed activity. There are about 12 tabs at any given time.</p>
<p>I have built a download service, for my own use, which requires binding to it. I've found a few questions about the issue binding Services from tabs, but I haven't found anything discussing the best way to des... | android | [4] |
2,000,223 | 2,000,224 | Do you have to release IBOulets in dealloc? | <p>Do you have to release IBOulets in dealloc? I'm not sure on this one because I didn't do the alloc and typically you only release for something you called alloc on. Anyone know?</p>
| iphone | [8] |
620,003 | 620,004 | When and why should $_REQUEST be used instead of $_GET / $_POST / $_COOKIE? | <p>Question in the title.</p>
<p>And what happens when all 3 of $_GET[foo], $_POST[foo] and $_COOKIE[foo] exist? Which one of them gets included to $_REQUEST?</p>
| php | [2] |
5,060,012 | 5,060,013 | returning two values | <p>How can I modify this:</p>
<pre><code>if ( reader.GetString( reader.GetOrdinal( "Status" ) ) == "Yes" )
{
return true; // Return Status + Date it was Completed
}
else
{
return false; // Return Status + null Date.
}
</code></pre>
<p>To return two values? Currently it returns the column 'Status' from the da... | asp.net | [9] |
5,909,320 | 5,909,321 | how to unblock specific usb port | <p>I have block all usb through this code. It will block all usb port.</p>
<pre><code> RegistryKey key = Registry.LocalMachine.OpenSubKey
("SYSTEM\\CurrentControlSet\\Services\\UsbStor",true);
if (key != null)
{
key.SetValue("Start", 4, RegistryValueKind.DWord);
}... | c# | [0] |
5,557,494 | 5,557,495 | jQuery UI: - Switch Class but add a hover effect? | <p>I have the following jQuery code to add a class to "p" tags within an "li" when you hover over them... but how can i make this more interesting by adding a transition effect rather than just a straight switch?</p>
<p>code:</p>
<pre><code>$(document).ready(function() {
$('li').hover(function() {
$('p', ... | jquery | [5] |
3,601,684 | 3,601,685 | $ not defined error in jquery | <p></p>
<pre><code><script type= "text/javascript">
//<!CDATA[[
$(init);
function init() {
$("#heading").load("head.html");
$("#menu").load("menu.html");
$("#content1").load("story.html");
$("#content2").load("story2.html");
$("#footer").load("footer.html");
};
//]]>
</script>
</code>... | jquery | [5] |
5,861,321 | 5,861,322 | Request superuser rights to edit file | <p>I'm planing an app where i need to edit a system file.</p>
<p>I can only edit that file with root rights. I have a rooted dev phone with Superuser.apk installed. Other apps that require root do request root access on first start.
I want to do the same but I can't find any hints on how to request superuser rights fo... | android | [4] |
3,830,902 | 3,830,903 | remove parent (header) of button, and add textarea in its place | <p>I have this html right now:</p>
<pre><code><h1><span class = 'highlight'><input type='image' class='removeall' src='remove.png'>
<input type='image' class='edit' src='edit.png'>
{$result['title']}</span></h1>
<form action = "addin.php" method="get">
<textarea na... | jquery | [5] |
2,803,100 | 2,803,101 | android large screen support | <p>In order to fit different resolution, I use the layout-480 * 320 layout-800 * 480 layout-1280 * 720 under the res folder, my test machine is a galaxy nexus, a resolution of 1280 * 720, galaxy nexus load the layout-800 * 480 folder and don not load 1280 * 720 folder why?</p>
| android | [4] |
5,578,715 | 5,578,716 | can i make a panel transparent for a certain key color like the forms c#? | <p>i have a panel and i wanna make it transparent for a color key (black) and place a flash in it with black background color, then i can still show the form under it</p>
| c# | [0] |
3,571,141 | 3,571,142 | java servlet programming errror | <pre><code>C:\Tomcat5.5\webapps\WEB-INF\classes>javac MyServlet.java
MyServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
MyServlet.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
MyServlet.java:5: cannot find symbol
symbol: class HttpServlet
public class ... | java | [1] |
5,256,742 | 5,256,743 | e.Cancel does not work | <p>I have VS 2010 and want to cancel the form closing event via a Yes|No|Cancel dialog, but when I put the e.Cancel in the event handler for the dialog box, I get an error that says "'System.EventArgs' does not contain a definition for 'Cancel' and no extension method 'Cancel' accepting a first argument of type 'System... | c# | [0] |
3,669,433 | 3,669,434 | Zend: best way to implement custom form validation? | <p>I have a few custom form validation rules I wish to apply. Things like ensuring the password has one capital letter, at least one number, and a symbol.</p>
<p>Where would be best to implement these custom validation rules?</p>
<p>I am currently validating them in a controller, but obviously that won't scale very w... | php | [2] |
1,358,174 | 1,358,175 | characters and files in C++ | <p>I have to make a program where the filename is composed of two parts: the first one is fixed and the second one can change during the program e.g "fixpart_integer.dat". I tried to do this in C++ but I did not succeed. The fisrt probelm is: how can i convert a number to a char ; and how can i concanate these 2 charac... | c++ | [6] |
4,269,906 | 4,269,907 | PHP sleep() function killing script after some time | <p>I am experiencing a problem when using sleep() function in php for a long period of time, if i test the following code all runs perfectly:</p>
<pre><code><?php
set_time_limit(0);
$i = 0;
while($i < 10) {
echo $i.'<br />';
if($i == 5){
echo 'sleeping 5 secs<br />';
... | php | [2] |
4,466,012 | 4,466,013 | file() VS file_get_contents() which is better? PHP | <p>I just want to know how to improve the speed of the web application I am creating.</p>
<p>I am also open to other suggestions.</p>
<p>fread or file_get_contents??</p>
| php | [2] |
5,579,902 | 5,579,903 | How to pass multiple parameters values from one php page to another | <p>Below is the setup I am using:</p>
<p>I have this button(submit):</p>
<pre><code><input type="submit" name="pageaction" class="contact_list_uploadcsv_btn" value="Send SMS" />
</code></pre>
<p>pageaction: is a switch case"Send SMS" in the controller.php, so when the user press "Send SMS" it will perform th... | php | [2] |
781,009 | 781,010 | Take a ScreenShot from Android Device as iPhone | <p>I have a problem that I have to make an Android App which take a screenshot of Android device same as iPhone does. So, Is it possible to make such kind of Android App? If yes, then provide me some suggestions or example for doing the same.</p>
<p>Thanks in advance.</p>
| android | [4] |
3,394,634 | 3,394,635 | what is the error in this code and why? | <pre><code>class Person {
String name = “No name";
public Person(String nm) { name = nm; }
}
class Employee extends Person {
String emplD = “0000”;
public Employee(String id) { empID = id; }
}
public class EmployeeTest {
public static void main(String[ ] args)
{
Employee e = new Employee(... | java | [1] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.