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 |
|---|---|---|---|---|---|
5,300,022 | 5,300,023 | How to convert an Integer[] to an int[]? | <pre><code>// how to convert this
Integer[] array = {1, 2};
// to this
int[] array = {1, 2};
</code></pre>
<p>I'm working on code that has the second form, and I need to modify how the array is read. Not knowing enough of Java, I would rather just convert than risk bugs.</p>
| java | [1] |
2,117,674 | 2,117,675 | What is out-of-band callback? | <p>What is an out-of-band callback?
Is this similar to AJAX? Please explain..</p>
<p>Thanks.</p>
| asp.net | [9] |
3,298,782 | 3,298,783 | change window location | <p>My code opens a new window with the name <code>radio</code> I am curious to know how I can change the url for this window automatically every hour from <code>radio.php</code> to <code>/server2/radio.php</code></p>
<pre><code><a href="#" onclick="RadioLink('radio.php','radio','width=300,height=150')">Play Radi... | javascript | [3] |
1,932,942 | 1,932,943 | Why onKey event double processing in Android? | <p>I wonder why onKey event is double processing when I logging it. Here is my coding. </p>
<pre><code>ed1.setOnKeyListener(new View.OnKeyListener()
{
Integer count = 0;
String typeWord = "";
public boolean onKey(View v, int keyCode, KeyEvent event)
{
count++;
char c ... | android | [4] |
4,664,661 | 4,664,662 | Issue in switching from one activity to other | <p>I have Activity1 Activity2 Activity3 activities in my application.</p>
<p>now I want to switch from Activity3 to Activity1.</p>
<p>How do I proceed?</p>
<p>And also, how to finish an activity from another activity?</p>
| android | [4] |
111,562 | 111,563 | triggering jquery on dynamic elements | <p>I'm trying to trigger a <code>.show</code> on a div, when a link has a dynamically added class and it's parent has the class <code>pdSelectedSwatch</code> which is added on selection(click).</p>
<p>example code:</p>
<pre><code><li class="pdSelectedSwatch">
<a href="javascript:void(0)" class="outOfStoc... | jquery | [5] |
1,375,691 | 1,375,692 | height of an element javascript | <p>I would like to adjust the size of an element in the opposite direction, so the code below does adjust it, but it enlarges it from current position to bottom, I want current position to top. What would be an efficient way of doing this? thanks</p>
<pre><code>var ele=document.getElementById('mydiv');
ele.style.heigh... | javascript | [3] |
2,076,716 | 2,076,717 | jquery array stored check box not responding | <p><img src="http://i.stack.imgur.com/RSElA.jpg" alt="enter image description here">I have 4 group of checkboxes, in which i am grouping all this 4 in to an array, after i stored the group checkboxes, i can't add the event to those boxes, i think i am doing something wrong.. any one correct my code?</p>
<p>what i want... | jquery | [5] |
391,330 | 391,331 | Decorators in Python | <p>I am just learning python, and I am currently playing with Tornado framework. I see this class:</p>
<pre><code>class AuthHandler(BaseHandler, tornado.auth.GoogleMixin):
@tornado.web.asynchronous
def get(self):
if self.get_argument("openid.mode", None):
self.get_authenticated_user(self.as... | python | [7] |
5,657,563 | 5,657,564 | PHP Zip code matching | <p>How can I have it if a zip is entered that I have a page for go to the page for the zip and if not then go to another page? I'm new to PHP and don't know how to start. </p>
| php | [2] |
523,762 | 523,763 | List loop cannot be accessed | <p>I have a new list which have at least 5 objects. I am trying to copy the elements of the new list to the old one. The problem here is that loop never accessed.</p>
<pre><code>foreach (JobPosition Position in JobPositionsListNew)
{
JobPositionsList.Add(
new JobPosition(
Position.SetGetPositio... | c# | [0] |
1,034,451 | 1,034,452 | Classical Inheritance implement in javascript | <p>What I am trying to do is inherit the <code>id</code> and <code>name</code> from the <code>TField</code> and override the <code>render</code> function of the <code>TField</code>. I want to know if this is the stardard way to implement inheritance in JavaScript.</p>
<pre><code>var TField=function(jData)
{
this.id... | javascript | [3] |
548,224 | 548,225 | Regex result not show up in C#? | <p>I tried to parsing query from google that comming to mysite but its not showing up, but according <a href="http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx" rel="nofollow">http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx</a>, and with re... | c# | [0] |
5,686,159 | 5,686,160 | Animation of different images in list | <p>I have different images, say 100 images or so. Now, I want to apply animation on them. I want my ImageView to get each image after specified interval but when the change of image occurs, each image should FadeIn or FadeOut. I place my images in @drawable/[list_of_images].xml file as:</p>
<pre><code><animation-li... | android | [4] |
3,597,997 | 3,597,998 | How to pass an arraylist as a request parameter so that i can fetch the values through request parameter | <p>I have a method in a java class that returns an ArrayList of a particular class type. How can it be passed as a request parameter?</p>
| java | [1] |
5,812,749 | 5,812,750 | How do I access System.Web.Http.Current.Response from a within a thread? | <p>I have a ASP.NET page with a WebMethod that creates an object and runs one of the object's methods in a new thread.</p>
<p>I need to access the <code>System.Web.HttpContext.Current.Response.ContentType</code> property from within this thread. </p>
<p>Each time I (try to) access it, I receive a <code>NullReferenceE... | asp.net | [9] |
5,455,405 | 5,455,406 | how do i receive messages sent to gtalk? | <p>im making an application that needs to get received messages that were sent to google chat. is there an api for working with google chat?</p>
<p>can someone please give me an example in C# how do i receive gtalk messages? im sorry the xmpp documentation is too complex and i do not understand where to start</p>
| c# | [0] |
2,624,209 | 2,624,210 | pass value from gridview to stored procedure | <p>I had stored procedure which get data where Id=@id and the @id which pass to stored from gridview I tried to do that but I couldnot please any one help me</p>
<p></p>
<p>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{</p>
<pre><code> using (SqlConnection con = Connection.GetC... | c# | [0] |
5,551,081 | 5,551,082 | Which file Mode enumerator should john use in the constructor of the file stream class? | <p>John need td write a program in C# for file handling. He wants to write a code to open an existing file. If the file does not exist, an error message should be shown. Which file Mode enumerator should john use in the constructor of the file stream class?</p>
<ol>
<li>Open</li>
<li>OpenOrCreate</li>
<li>CreateNew</l... | c# | [0] |
2,034,993 | 2,034,994 | Python: Object identity assertions thrown by differences in import statement notations | <p>When checking an object's identity, I am getting assertion errors because the object creation code imports the object-defining module under one notation (<code>base.other_stuff.BarCode</code>) and the identity-checking code imports that same module under a different notation (<code>other_stuff.BarCode</code>). (Ple... | python | [7] |
2,776,790 | 2,776,791 | Join two lists of dictionaries around a single non-unique key | <p>I have 2 lists of dictionaries, say:</p>
<pre><code>l1 = [{"customer":"amy", "order":2}, {"customer":"amy", "order":3}, {"customer":"basil", "order":4}]
l2 = [{"customer":"amy", "died":"who fell down the stairs"}, {"customer":'basil', "died":"assaulted by bears"}]
</code></pre>
<p>I am looking for an elegant way o... | python | [7] |
164,301 | 164,302 | showing and hiding something on slide toggle in jquery | <p>i have a panel having slide toggle effect on click of a button along with this slide toggle i am also hiding one div on the click event what i want when the panel slide down that div should hide and when panel slide up the div reappear how to do this</p>
| jquery | [5] |
1,777,585 | 1,777,586 | Restore Python class to original state | <p>I have a class where I add some attributes dynamically and at some point I want to restore the class to it's pristine condition without the added attributes.</p>
<p>The sistuation:</p>
<pre><code>class Foo(object):
pass
Foo.x = 1
# <insert python magic here>
o = Foo() # o should not have any of the previo... | python | [7] |
515,529 | 515,530 | Troubleshooting "call_user_func_array() expects parameter 2 to be array, string given" error | <pre><code>if( array_key_exists( $fn, $this->_request ) ){
if( $array ){
$result = call_user_func( $func, $args );
}else{
$result = call_user_func_array( $func, $args );
}
if( !empty( $GLOBALS['xhrErrorHandlerText'] ) ){
$error = 'PHP Error Message: ' . addslashes( $GLOBALS['xhrErrorHandlerText'] );
}
}e... | php | [2] |
5,553,730 | 5,553,731 | How to use large audio file size of more than 15 MB in android | <p>I wanted to use very audio files of each abt 15 MB in android. Is there a way where I can optimize my audio files before using them or shd i directly stream from internet for every file. Pls suggest if thr is any way that i can make the user to use audio files without any time lag.</p>
| android | [4] |
2,012,686 | 2,012,687 | Move files to server | <p>How is it possible to move files from a folder to web server through FTP, using ASP.Net with C# ?</p>
| asp.net | [9] |
3,700,081 | 3,700,082 | how to make UIView animation? | <p>I have implemenetd one animation application.In which there is one main view and another is subview in that view.There is also one button.When user touch on that button i want to disply subview with animation.That view must be display from bottom to top.How it possible.I dont know how it possible.</p>
| iphone | [8] |
3,887,222 | 3,887,223 | How to create a layer menu? | <p>How to create a layer menu? I want to create a custom menu,but I do not know how to create a layer,For example, a Imagebutton is pressed to display a list of menu.like this:</p>
<p><a href="http://ss12.sinaimg.cn/orignal/5d8cb30ag8f47eca43a5b&690" rel="nofollow">http://ss12.sinaimg.cn/orignal/5d8cb30ag8f47eca43... | android | [4] |
3,419,428 | 3,419,429 | Java: Easiest way to convert Calendar to String and back | <p>My application uses an API that accepts only a <code>Map<String, String></code>. Therefore, all objects must be converted to this form before they can be passed to the API.</p>
<p>This is quite trivial for simple classes like <code>Boolean, BigDecimal</code> etc. But it is proving somewhat problematic for con... | java | [1] |
3,030,347 | 3,030,348 | How to make a copy of a text file that located in another server | <p>How to make a copy of a text file that located in another server , in php</p>
| php | [2] |
5,364,535 | 5,364,536 | What does while (true){ mean in PHP? | <p>I've seen this code, and I've no idea what it means.</p>
<pre><code>while(true){
echo "Hello world";
}
</code></pre>
<p>I know what a while loop is, but what does while(true) mean? How many times will it executed. Is this not an infinite loop?</p>
| php | [2] |
1,099,224 | 1,099,225 | How can I access the button placed in datalist I want to access button text that's bind with the database table field | <pre><code><asp:DataList ID="DataList2" runat="server" DataSourceID="SqlDataSource2" onitemcommand="DataList2_ItemCommand">
<ItemTemplate>
<div class="style49">
<table style="width:100%;">
<tr>
<td class="style50">
<as... | c# | [0] |
3,638,821 | 3,638,822 | Finding an image in a folder with subfolders which contains a post value | <p>I am using Jquery to post a value to a page which should then search a folder and its sub-folders to see where the file exists.</p>
<p>The start of the filename will always have something like "HAV_" and then the product code...</p>
<pre><code>HAV_345GG.jpg
</code></pre>
<p>I need to take the posted value which i... | php | [2] |
5,939,256 | 5,939,257 | How to sort NSMutableArray in ascending order, iPhone? | <p>I have SQLite Database(DB) and made this to model class and taken the data of DB in NSMutableArray. My DB is similar to this DB.
<strong>StudentName | RegisterNumber | DatesOfJoin(DoJ)</strong>
I am displaying the DoJ in tableView successfully, but I wanna sort the DatesOfJoin in Ascending order and Descending order... | iphone | [8] |
5,489,603 | 5,489,604 | calculator in c++ adding function | <p>So my program makes a random <code>(x,y)</code> arrays, what i want to do is to make <code>x</code> a real number and <code>y</code> imaginary number and add them:
my main program</p>
<pre><code> #include "complx.h"
int main(){
const int n = 2;
Complex a[n]; ... | c++ | [6] |
3,535,633 | 3,535,634 | City Name Fetching Via GetLocality | <p>I am developing an android application in which i have to fetch the current city name from server. I have achieved this in my following code. the problem is when i try to fetch the current city name and if internet connection slow at that time application is being force closed. can anyone help me how to Prevent my ... | android | [4] |
859,917 | 859,918 | Python Packager | <p>What is the easiest way to package Python programs into stand-alone executables?</p>
| python | [7] |
2,670,962 | 2,670,963 | What is the difference between #import and #include in C++? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/172262/c-include-and-import-difference">C++ include and import difference</a> </p>
</blockquote>
<p>Can someone explain the difference and where may I use one versus the other?</p>
| c++ | [6] |
4,592,439 | 4,592,440 | Enable "postage stamp" compatibility mode | <p>Is there a way to enable the postage stamp compatibility mode for my app? I want to port it on all tablets. Using the "Zoom to fill screen" mode is available only from the 3.2 version, so the 3.0 and 3.1 tablets won't be handled. I've tried to set the targetSdkVersion and minSdkVersion attributes to 3, but it has no... | android | [4] |
1,973,312 | 1,973,313 | What does this block of obfuscated JavaScript do? | <p>I've seen a block of JavaScript code, that return an alert message with 1 on page load. Here is the code</p>
<pre><code>($=[$=[]][(__=!$+$)[_=-~-~-~$]+({}+$)[_/_]+
($$=($_=!''+$)[_/_]+$_[+$])])()[__[_/_]+__
[_+~$]+$_[_]+$$](_/_)
</code></pre>
<p>Can someone please explain what's going on here?</p>
| javascript | [3] |
4,631,917 | 4,631,918 | Editing a C# resource file of a compiled assembly | <p>I have a resource file where I am storing connection string etc for a class library (I cant use an App.config, don't ask why!?!).
It was my assumption (might be a stupid one) that I would be able to modify the .rex file out side of the complied assembly at runtime to be able to change connection string through envir... | c# | [0] |
771,566 | 771,567 | Are there any new/updated Java web development frameworks to watch for? | <p>I know recently Spring 3.0 was released which brought about a nice new set of features and ease of web development with their MVC package. However are there any new frameworks on the horizon and/or new versions of other frameworks that a web developer should have their eyes on?</p>
<p>I heard about the Stripes fram... | java | [1] |
4,789,893 | 4,789,894 | disable keypad after entering text in textfield | <p>I am new to iphone;</p>
<p>what i did is creating a 10 labels with corresponding text fields.</p>
<p>when i click on text field keypad is open.</p>
<p>But it covers the bottom 4 textfields.</p>
<p>I can't able to enter text to those fields.</p>
<p>i need when i click textfield in front of keypad screen moves u... | iphone | [8] |
3,479,709 | 3,479,710 | for loop control | <p>hey all
i want to know if there anyway that i control the for loop so if i push the button more than one time the program dose not freez and do the for loop again</p>
| c# | [0] |
3,848,960 | 3,848,961 | How to read table values in text? | <p>I am tryig to read from the textboxes in a table. How can I do it? I have the following code, but it`s not working.</p>
<pre><code><table id="dataTable">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
</thead>
... | jquery | [5] |
5,892,715 | 5,892,716 | Questions on Javascript hoisting | <p>While I was reading about Javascript hoisting, I tried the following. I am not sure why the first one and second one output differently. Thanks in advance. (I am not even sure that this is related to hoisting. )</p>
<pre><code>var me = 1;
function findme(){
if(me){
console.log( me );//output 1
}
consol... | javascript | [3] |
1,757,473 | 1,757,474 | Javascript srcElement property on IE9 | <p>I have some images in a <code>div</code> object, when mousedown event fired I use <code>n.srcElement</code> to catch the image object.</p>
<p>In Firefox it would be <code>n.target</code></p>
<p>However <code>IE9</code> doesn't work on both <code>n.target</code> and <code>n.srcElement</code> because IE9 will return... | javascript | [3] |
4,289,947 | 4,289,948 | Dictionary for the language of javascript | <p>Is there a dictionary for the language of javascript?</p>
<p>Eg if I want to lookup what "catch" is/means/does in javascript.</p>
<p>And also to get a good overview of ALL the "words" of the language to see what "words" you have missed.</p>
| javascript | [3] |
4,867,317 | 4,867,318 | Why this copy-constructor is invoked in the program? | <pre><code>#include <iostream>
#include <string.h>
using namespace std;
class withCC
{
public:
withCC() {}
withCC(const withCC&) {
cout<<"withCC(withCC&)"<<endl;
}
};
class woCC
{
enum {bsz = 100};
char buf[bsz];
public:
woCC(const char* msg = 0) {
... | c++ | [6] |
4,017,164 | 4,017,165 | how to use com.android.mms.transaction package in my app | <p>I am working on MMS app, I need to use "com.android.mms.transaction" this package in my app..</p>
<p>please suggest me which JAR file I need to include my app to access this package..</p>
| android | [4] |
3,952,298 | 3,952,299 | Take text by class name Jquery | <p>I need to get 2 as number for future using (2)</p>
<pre><code><div class="pageCont">
<span class="link">
<span class="page">
<span class="page active">2</span>
</div>
</code></pre>
<p>I have tried <code>alert(jQuery(".page active").text());</code> do not work because I use 2 par... | jquery | [5] |
2,442,939 | 2,442,940 | Changing the next button of softkeybord to Search | <p>I want to change the next button of virtual keyboard to search button , is there any way to change the text of that next button to Search button.</p>
| android | [4] |
398,358 | 398,359 | python naming convention for plugins, i.e. non-top-level packages | <p>I'm wondering if there is naming convention for non-top-level python packages, i.e. so called plugins or extensions. According to PyPI the plugins, mostly, named with dash(-) or dot(.)</p>
<p>e.g.:
most django plugins named with dash while plone/zope and many others prefer the dot, WTF? :)</p>
<p>Thanks!</p>
| python | [7] |
5,098,097 | 5,098,098 | Limit Javascript script Internet access | <p>I have a webpage with a master script that connects, via AJAX, to a remote server and downloads unsecure JS scripts (let's call them slave scripts), to be executed lately on the client. I would like to limit the Internet access slave scripts have; e.g. they can communicate just with the remote server.</p>
<p>Do you... | javascript | [3] |
2,135,487 | 2,135,488 | Extract value between HTML-tags using JavaScript | <p>How can I extract the value between the tags (49% in message) using Javascript?
I will first parse the JSON with JSON.parse.</p>
<pre><code>{
"id": "189180337778229046",
"from": {
"name": "My FB page",
"category": "Automobiles and parts",
"id": "189180337778229046"
},
... | javascript | [3] |
4,382,003 | 4,382,004 | "this" in c# constructor? | <p>When referenced in the constructor, does the keyword this refer to the instance of the class being created?</p>
<p>For instance, I have a list of all instances of a certain class. If I put
MyList.Add(this);
at the end of the constructor, will that add the newly created class?</p>
| c# | [0] |
531,951 | 531,952 | jQuery Repeat Element with A Following Number | <p>How do I use less code here? Don't want to keep calling the div's, I want to have one name and increment the number after it.</p>
<pre><code>$('.slider1').stop().hover(function () {
$('#slider_1').fadeIn('fast');
});
$('.slider1').stop().mouseleave(function () {
$('#slider_1').hide('fast');
});
$('.slider2... | jquery | [5] |
4,022,177 | 4,022,178 | why lazy copy when we have deep copy and shallow copy? | <p>We have <strong>shallow copy</strong> and <strong>deep copy</strong> who can do the job for us when we want to copy objects in C++. So,<br>
What is <strong>Lazy copy</strong>?<br>
Is this a thing that is taken care by a programmer or compiler does this on its own?<br>
What are the programming scenarios where a lazy ... | c++ | [6] |
4,664,293 | 4,664,294 | PHP Format string like a chemical formula | <p>What is the best way to convert a string such as <code>CO2</code> and make it output <code>CO<sub>2</sub></code> via PHP?</p>
| php | [2] |
4,719,988 | 4,719,989 | Use the same piece of code without using macros for two different data types | <p>I want to use a single piece of code for two different data types without using macros. I tried something like this, but I did not come up with a complete solution.</p>
<pre><code>void func(bool istype1, void *ptr)
{
void *t1;
if(isType1)
t1=static_cast<type1>(ptr);
else // isType1 == fa... | c++ | [6] |
3,550,614 | 3,550,615 | C# how to check if file is in folder according to object of filenames | <p>I have the following method:</p>
<pre><code>public static Boolean CheckContents(string ExportDirectory, string FileName, string DspFleName, String RteFleName, string FulRteName, string EqpFleName, int CompanyId, string CompanyName)
{
if (DspFleName != "None")
{
IList<string> D... | c# | [0] |
5,947,484 | 5,947,485 | anchor title attribute | <p>The title is showing only the first word when you mouse over the link. How can I get the whole order description to show? Thanks</p>
<pre><code><a title=$row[order_description] href=order.php?order_id=$row[qid]><font class=fontblueData_sub> $row[prod_title]</font></a>
</code></pre>
| php | [2] |
1,725,995 | 1,725,996 | logic for Custom Start Day and End Day for a week. (c#) | <p>We have a unique requirment where we have our own start day of a week and end day of a week(C#),</p>
<p>Contrary to the existing Date Time class whose start day is Sunday and end day is Saturday, we have Wednesday as our start day and Tuesday our EndDay (and this will vary per client).</p>
<p>and we need to implem... | c# | [0] |
5,550,002 | 5,550,003 | what does below java line indicates with final modifier assigned to list? | <p>Please consider my question. final values cannot be changed in java.</p>
<pre><code>private final List<Integer> list = new ArrayList<Integer>();
</code></pre>
<p>above list instantiation is of final. now i can add any elements.
after that can i assign list=null?</p>
<p>Please help me.</p>
<p>Thanks!<... | java | [1] |
5,790,347 | 5,790,348 | View my android app rating in my app | <p>I want to load rating of my app uploaded in android market in some app.
how to do this?
thanks</p>
| android | [4] |
971,889 | 971,890 | cant start browser from service in android | <p>Hello I am trying to start the android browser from a service using this code: </p>
<pre><code>protected void showBrowser(){
String url = "http://www.google.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
this.startActivity(i);
}
</code></pre>
<p>but this doesn't seem t... | android | [4] |
1,392,648 | 1,392,649 | Bind click and live click | <p>Why this code works <a href="http://jsfiddle.net/Lzezc/5/" rel="nofollow">(see code at jsfiddle)</a></p>
<pre><code>$(document).ready(function() {
var html = '<div><a href="javascript:">click me</a></div>';
var $div = $(html);
$div.find('a').bind('click', function() { //attention... | jquery | [5] |
2,252,777 | 2,252,778 | ASP.NET runtime error: Could not load file or assembly 'Interop.CertEnroll' | <p>I have a ASP.Net 4.0 site that I am editiing in VS2010. Every @ Master and @ Page tag has the blue squiggle lines giving the following error:</p>
<p>ASP.NET runtime error: Could not load file or assembly 'Interop.CertEnroll' or one of its dependencies. An attempt was made to load a program with an incorrect format.... | asp.net | [9] |
3,393,566 | 3,393,567 | Saving playlist file from application | <p>I'm a newbie in android application. I would like to save an m3u file from my application to a shared folder on the phone, in order to make it available to other applications (music player) and make it survive even if user removes my application.</p>
<p>This is what I tried to do:</p>
<pre><code>String directory =... | android | [4] |
5,067,255 | 5,067,256 | PHPexcel CONCATENATE makes blank column | <p>i have this commands, other columns has its data, but I2 is empty, no function, nothing
i think im donig something wrong, but dont know what.
thanks</p>
<p>in I2 is this data "2012/10"</p>
<pre><code>$foo->mergeCells("B$rowCounter:E$rowCounter");
$foo->setCellValue("B$rowCounter", "Lukáš Doubek")
->se... | php | [2] |
6,005,878 | 6,005,879 | Android - process life cycle? | <p>I know everything about activity life cycles, but what about the process itself? There's many projects which use the singleton pattern, where the Application class is extended to hold static objects.</p>
<p>Do these objects ever get destroyed? If so, when? Is there any documentation on this?</p>
| android | [4] |
2,761,554 | 2,761,555 | How does the load() function allow the user to provide a callback? | <p>In javascript it's very popular for libraries/frameworks to let us define a callback function for post-processing of data.</p>
<p>eg.</p>
<pre><code>load("5", function(element) {
alert(element.name);
});
</code></pre>
<p>I wonder how the load() function looks like to be able to let the user provide a callback... | javascript | [3] |
4,269,956 | 4,269,957 | Good Android tutorial? | <p>I am iOS developer .
I have decided to begin developing applications for android .
I have seen a lot of books and tutorials about android .
But unfortunately I did not find a book or tutorial that explain everything in details about everything in android .
For example When I want to use button clickListener I found ... | android | [4] |
830,621 | 830,622 | Window.open and modifying DOM of new window | <p>Suppose I open a new window using:</p>
<pre><code>newWindow = window.open(newUrl)
var ul = newWindow.document.getElementsByTagName("ul")[0];
ul.innerHTML = "new content";
</code></pre>
<p>However, this doesn't modify the DOM of the new window at all.. </p>
<p>Is there a way to do what I want to do? which is modif... | javascript | [3] |
2,136,072 | 2,136,073 | How to keep the WakeLock for as long as an application is open/running? | <p>I need to keep a SCREEN_DIM_WAKE_LOCK for as long as my application is running. Before somebody lectures me on good or bad practice and how this messes with the device's own power management, this will be on a dedicated device and are the client's express wishes.</p>
<p>Most of the places where I see this only talk... | android | [4] |
275,666 | 275,667 | How to encapsulate this variable into the string? | <p>I want to encapsulate this variable into the string, but I always get an error:</p>
<pre><code>for($i = 0; $i < $_POST['rows']; $i++) {
echo "<tr>"
for($j = 0; $j < $_POST['columns'] $j++) {
echo "<td>$_POST['row{$i}column{$j}']</td>"; // << I get an error. Please help me e... | php | [2] |
1,036,614 | 1,036,615 | Generating Random numbers: Counting the times x number has been randomly generated | <p>I am currently working with generating a random number(1-20) and counting the number of times each number has been randomly generated. In <code>textBox1</code> I choose the amount of numbers I want to generate. I display the final results in a multiline <code>textBox2</code>. The problem I am experiecing is that eve... | c# | [0] |
2,371,745 | 2,371,746 | Get specific element in Json string in php problem | <p>This is my data struuture:</p>
<pre><code>array(6) {
["id"]=> string(15) "264729823543848"
["application"]=> array(2) {
["name"]=> string(7) "Prizzer"
["id"]=> string(15) "100398126714422"
}
["to"]=> array(2) {
["name"]=> string(18) "Danielle McPherson"
["id"]=> ... | php | [2] |
439,790 | 439,791 | Resolving DNS in bulk | <p>I need to resolve a large number (hundreds of thousands) of domains to IP addresses in Java. While using <code>InetAddress.getByName()</code> is feasible for small numbers it is far to slow for use in large quantities (probably because it is only sending one request at a time to the DNS server and waiting for the re... | java | [1] |
2,077,326 | 2,077,327 | Need advice, how to delete uploaded photo in PHP | <p>I have a system where people upload their photo and can add glasses images on top of it. Uploaded photo are stored in folder uploads, but I dont want to store these photo. Can you advice me what is the best way to remove these photos from the server. Maybe to check the time when it was uploaded and delete all photos... | php | [2] |
5,171,307 | 5,171,308 | Read contacts all contacts (also imported from facebook, etc) | <p>According to this sample: <a href="http://developer.android.com/resources/samples/ContactManager/index.html" rel="nofollow">http://developer.android.com/resources/samples/ContactManager/index.html</a>
I wrote a simple function for getting all contacts:</p>
<pre><code> Uri uri = ContactsContract.Contacts.CONTENT_UR... | android | [4] |
4,135,872 | 4,135,873 | array Storing and and asking user to search for it | <p>The Question Is Write a program that asks the user to enter 10 integers, stores these numbers in an array. The program should ask if
the user would like to search an element in the array, in which case the program should then prompt the user to enter the
number to look for. Use a recursive function find( int inde... | c++ | [6] |
2,504,957 | 2,504,958 | char array to LPCTSTR | <p>May I know how I can perform the following conversion?</p>
<pre><code>// el.strCap is char[50]
// InsertItem is expecting TCHAR pointer (LPCTSTR)
// How I can perform conversion?
// I do not have access in both "list" and "el" source code
// Hence, there is no way for me to modify their signature.
list.InsertItem(i... | c++ | [6] |
5,637,854 | 5,637,855 | How to back out of Application from any point. | <p>I have an application that accesses a server. I have many activities that access the server for data. At various points in the application, I do a simple check to verify two things, 1) There is internet connectivity and 2) The server is not in maintenance mode or down.. If it is, I display an Activity detailing wh... | android | [4] |
2,753,567 | 2,753,568 | How do I add optional arguments to my function? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/34868/how-do-you-create-optional-arguments-in-php">How do you create optional arguments in php?</a> </p>
</blockquote>
<p>I built a function with 1 argument. That function is called numerous places on many, many... | php | [2] |
88,568 | 88,569 | Removing columns in python | <p>Having a comma separated file with around 50 columns and several rows, there is a need to remove columns which are always 0 (i.e all values in that column are zero).</p>
<p>The file is read with the following piece of code:</p>
<pre><code>with open('data.txt', 'rb') as f:
reader.csv.reader(f, delimiter=',')
... | python | [7] |
2,943,219 | 2,943,220 | Try Catch errors when setting attributes | <p>Is there a rule of thumb to follow for error catching while setting attributes of an object? Let's say for example that you have a Shape class as follows:</p>
<pre><code>class Shape():
def __init__(self, size):
self.size = size
</code></pre>
<p>I can do the following:</p>
<blockquote>
<p>>>> s = Sha... | python | [7] |
1,202,578 | 1,202,579 | click through span | <p>I have a span tag that's over an input field. What I'm trying to do is when you click on the input field the span with text in it gets hidden. then on Blur it's shown. This all works using jquery. The problem is because the span is on top of the input field the input focus doesn't get triggered when you click on the... | jquery | [5] |
2,930,336 | 2,930,337 | How to change link url from format html? | <p>Here is my code:</p>
<pre><code>$str = '<html><p><img src="http://test.com/images.jpg" /><img src="test.com/image2.jpg"><p><html>';
$str_rep = str_replace('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i','http://mywebsite.com/', $str);
</code>... | php | [2] |
5,171,403 | 5,171,404 | Is it okay to write own magic methods? | <p>In my web application I often need to serialize objects as JSON.
Not all objects are JSON-serializable by default so I am using my own <code>encode_complex</code> method which is passed to the <code>simplejson.dumps</code> as follows: <code>simplejson.dumps(context, default=self.encode_complex)</code></p>
<p>Is it ... | python | [7] |
2,720,443 | 2,720,444 | Do people still dislike PHP? | <p>I've ran across a number of topics on this particular exchange site, and I've seen many many comments "stop using php" and making fun of it. I'm a php user and I find it quite good and useful, I've never had some real problems with php itself, and I never thought that php encourages bad code.</p>
<p>I have seen som... | php | [2] |
2,002,046 | 2,002,047 | Getting the docstring from a function | <p>I have the following function:</p>
<pre><code>def my_func():
"""My docstring is both funny and informative"""
pass
</code></pre>
<p>How do I get access to the docstring?</p>
| python | [7] |
279,893 | 279,894 | Problem using Conditional Operation with Nullable Int | <p>A small problem. Any idea guys why this does not work?</p>
<pre><code>int? nullableIntVal = (this.Policy == null) ? null : 1;
</code></pre>
<p>I am trying to return 'null' if the left hand expression is True, else 1. Seems simple but gives compilation error - </p>
<p>Type of conditional expression cannot be deter... | c# | [0] |
6,004,030 | 6,004,031 | Name a variable on the fly | <p>I am accepting a variable into a function.</p>
<p>For example, the variable is called <code>$field</code> and I then want to name a variable by what is inside the <code>$field</code> variable.</p>
<p>Say <code>$field = 'randomName'</code>, I want my variable to be <code>$randomName</code>.</p>
<p>Is this possible... | php | [2] |
5,079,957 | 5,079,958 | Make an Android app out of website | <p>I have a small wordpress website and I wanted to try to make an Android app out of it. But, I have no idea from where to begin. I found out about App Inventor which makes it real easy to create apps. But, what I still haven't figured out is how to extract data from my website and put it into the app through the App ... | android | [4] |
5,665,852 | 5,665,853 | Use CodeOnTime asp.net | <p>I am planning use code generator <a href="http://codeontime.com/" rel="nofollow">CodeOnTime</a> in my asp.net application. Before starting this i just want to confirm that is this reliable for big project? Is code customization is possible in CodeOnTime?</p>
<p>If some one has used CodeOnTime then please suggest m... | asp.net | [9] |
3,543,368 | 3,543,369 | remove last word in label split by \ | <p>Ok i have a string where i want to remove the last word split by \</p>
<p>for example:</p>
<pre><code>string name ="kak\kdk\dd\ddew\cxz\"
</code></pre>
<p>now i want to remove the last word so that i get a new value for name as</p>
<p>name= "kak\kdk\dd\ddew\"</p>
<p>is there an easy way to do this</p>
<p>thank... | c# | [0] |
5,164,064 | 5,164,065 | What is the difference between new Object and new Object() in JavaScript | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3034941/new-myobject-vs-new-myobject">new MyObject(); vs new MyObject;</a> </p>
</blockquote>
<p>In some articles I seen following statement to create new object in JavaScript:</p>
<pre><code>var myObject = new... | javascript | [3] |
4,064,441 | 4,064,442 | What C# type stands for C++ float*? | <p>i have a function which is called from a library in C++ that has been imported to a C# project</p>
<p>I think it is asking for a pointer to an array. But I'm not sure how to make it work.</p>
<p>here is what it is asking for <code>function(float*, float*);</code></p>
<p>but if i do something like </p>
<pre><code... | c# | [0] |
3,459,854 | 3,459,855 | Need help with an android layout question | <p>I need to have a linear Layout whose height is wrap_content,
but how can I specify a child of this linear layout to stretch to its parent?</p>
<p>I tried
... some other children ...
</p>
<p>But this does not work. The image does not scretch.</p>
| android | [4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.