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,929,777 | 3,929,778 | Script for the functionality of Code Sample | <p>I just want to have the functionality of Code Sample(this is a button above text format box in SOF when we ask a question) which is also there in StackOverFlow. How to get the color of keywords which are shown in IDE.
<code><pre><code></code> works good to show the code but how to display the exact colo... | javascript | [3] |
1,410,129 | 1,410,130 | Readably print out a python dict() sorted by key | <p>I would like to print a python dictionary to a file using PrettyPrinter (for human readability) but have the dictionary be sorted by key in the output file to further improve readability. So:</p>
<pre><code>mydict = {'a':1, 'b':2, 'c':3}
pprint(mydict)
</code></pre>
<p>currently prints to</p>
<pre><code>{'b':2,
... | python | [7] |
1,563,366 | 1,563,367 | How to properly do sliding on android? | <p>ALL,
I have the following "simple" question. ;-)
I have an application which has an image background loaded from the png file.
On top I have an Image View which I would like to rotate with my fingers.
I am using MotionEvent to catch the sliding but apparently it works when I slide my fingers on the background but no... | android | [4] |
5,893,090 | 5,893,091 | How to define multiple variables on a single line? | <p>Reading documentation online, I'm getting confused how to properly define multiple JavaScript variables on a single line.</p>
<p>If I want to condense the following code, what's the proper JavaScript "strict" way to define multiple javascript variables on a single line?</p>
<pre><code>var a = 0;
var b = 0;
</code>... | javascript | [3] |
323,843 | 323,844 | Getting weird results while subtraction manipulation in python | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/306313/python-is-operator-behaves-unexpectedly-with-integers">Python “is” operator behaves unexpectedly with integers</a><br>
<a href="http://stackoverflow.com/questions/11476190/why-0-6-is-6-false">Wh... | python | [7] |
4,576,981 | 4,576,982 | android map overlay size | <p>I've used images for my overlay and using </p>
<pre><code>Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin);
canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);
</code></pre>
<p>It looks like the overlay size doesn't change with the zoom level. </p>
<p>Any idea h... | android | [4] |
5,390,987 | 5,390,988 | Button placed in FrameLayout does not work properly in 2.3.6 device, even though compiled from 2.3.3 (API 10) SDK | <p>I have installed API Level 10 SDK ( aka 2.3.3 ). </p>
<p>I've made a simple linear arrangement of Buttons added programmatically on FrameLayout.</p>
<p>minTargetVersion = "8"
maxTargetVersion = "10"</p>
<p>Runs properly on ICS 4.0.4 device.
Runs properly on Simulator.
But when I install the apk in devices having ... | android | [4] |
3,851,847 | 3,851,848 | Face not detect when change orientation? | <p>I have problem with face detection. When I change the orientation of my device from landscape to portrait, face detection fails.</p>
<p>I am unable to find a solution. This is what I tried:</p>
<pre><code>if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
mCamera = Camera.open(camIdx);
Came... | android | [4] |
513,546 | 513,547 | Why does second function declaration win even though I return before it? | <p>I have the following JavaScript code:</p>
<pre><code>(function() {
function f(){ alert(1); }
return f();
function f(){ alert(2); }
})();
</code></pre>
<p>Can you explain why the alert pops up with 2 and not 1?</p>
<p>Thanks,</p>
| javascript | [3] |
4,100,857 | 4,100,858 | How to get query in the URL after # | <p>I am using PHP and want to check links of the same page but with different trailing info. </p>
<p>The URL to the page normally is <a href="http://www.mypage.com/?about" rel="nofollow">http://www.mypage.com/?about</a> but if the user accessed it by clicking on the link SEND the user get send to <a href="http://www.m... | php | [2] |
281,479 | 281,480 | difference between Object reference and Object hash code | <p>whats the difference between an Object's reference and the same object's hash code value in java ?</p>
| java | [1] |
4,445,353 | 4,445,354 | How do I pass parameters in window.open method | <p>How do I pass parameters in window.open method.</p>
<pre><code><table id="tblUsers" cellspacing="0" >
<asp:Repeater ID="repUsers" runat="server">
<ItemTemplate>
<tr><td>&nbsp;<a ID="hlUser" runat="server" Target="_new" onclick="return OpenWindow();" >... | asp.net | [9] |
5,225,903 | 5,225,904 | MediaController appears only after tapping in Android | <p>I am writing an Android App where I am playing video using VideoView,but the mediaController appears only after tapping the screen.Is this correct procedure ? If not how can we make it to appear without tapping on the screen.</p>
<p>Thanks in Advance,</p>
| android | [4] |
642,959 | 642,960 | i am using ContactsContract is shows error that mean it creates anothor class | <p>hi all how can i get phone numbers, email_ids and names from contact list </p>
<p>when i am using ContactsContract it shows error how con i avoid those problems so anyone </p>
<p>kindly help me now it is urgent for me.</p>
| android | [4] |
3,792,738 | 3,792,739 | how to do tooltip on button in iphone? | <p>I am having download icon on my page i want that when the user takes his finger over the button a tooltip should show as showing download in text.</p>
<p>is there any option in iphone to show a tooltip??? </p>
| iphone | [8] |
1,277,990 | 1,277,991 | Parsing certain data with lxml | <p>I'm a beginner in coding and a friend of mine told me to use BeautifulSoup instead of htmlparser. After running into some problems I got a tip to use lxml instead of BeaytifulSoup because it's 10x better. </p>
<p>I'm hoping someone can give me a hint how to scrape the text I'm looking for. </p>
<p>What I want is t... | python | [7] |
3,738,862 | 3,738,863 | iPhone error "NsUrlConnetionInternalConnection_WithConnectionDisconnectFromConnection" | <p>We are getting an error:</p>
<blockquote>
<p>[NsUrlConnetionInternalConnection_WithConnectionDisconnectFromConnection]:
message send to deallocated instance 0*7a58e60 while runnting an
iPhone application.</p>
</blockquote>
<p>It is using a live webservice. But it is working with locally created webservice. ... | iphone | [8] |
2,083,795 | 2,083,796 | How to embed jquery library in asp.net custom server control? | <p>I emebeded jquery library in custom server control. but it's not working. it throws "object expected error". the complete code listing is given below.</p>
<p>jquery-1.4.1.js is rename it to jquery.js</p>
<pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
usin... | asp.net | [9] |
4,428,722 | 4,428,723 | Problems with dojo event and Jquery | <p>I can't find the answer in the other posts.</p>
<p>I use:
<a href="https://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/dojo.xd.js" rel="nofollow">https://ajax.googleapis.com/ajax/libs/dojo/1.4.1/dojo/dojo.xd.js</a>
and
libs/jquery/1.5.0/jquery.min.js</p>
<p>I need to read the event of the client of my dijit.form... | jquery | [5] |
1,455,300 | 1,455,301 | PHP remove all characters before specific string | <p>I need to remove all characters from any string before the occurrence of this inside the string:</p>
<p>"www/audio"</p>
<p>Not sure how I can do this.</p>
| php | [2] |
4,332,396 | 4,332,397 | php POST summation | <p>i am sending 5 different data across to a php file through POST method. the data is all integers. i want to add up all these integer values to produce a sum. </p>
<pre><code> $.post(
"user_submit.php",
{score: $('#ques'+qn).find('input[name=vote]:checked').val() },
function(data){
... | php | [2] |
3,029,251 | 3,029,252 | how to get the id of a div when using jquery hasClass method? | <p>This code is not working:</p>
<pre><code> $("div").hasClass("testSection").attr("id");
</code></pre>
<p>I get the following error message:</p>
<pre><code> TypeError: $(...).hasClass(...).attr is not a function
</code></pre>
<p>Any idea what could be the problem</p>
| jquery | [5] |
26,517 | 26,518 | Error:Could not find filename.apk | <p>when i run the emulator it give the error in console . Could not find filename.apk.
and i installed the plugins ADT 11.0.what should now i do.please help me.
thanx </p>
| android | [4] |
4,703,375 | 4,703,376 | Javascript function argument in array | <p>I have:</p>
<pre><code>String.prototype.callcm = function(something[]){
alert(something);
};
</code></pre>
<p><code>"something".callcm({a:50,b:60});</code></p>
<p>how can the arguments with there variable name get in the something array.</p>
| javascript | [3] |
4,638,919 | 4,638,920 | create a function of a repetitive else if | <p>the question title might not justify my question at all since I have no idea what to write as the title.</p>
<p>So, if I have something like this:</p>
<pre><code>if($type=="a"){
$s.= " AND type= 'List Apart ";
}elseif($type=="b"){
$s.= " AND type = 'Before CSS3' ";
}elseif($type=="C"){
$s.= " AND type ... | php | [2] |
4,859,921 | 4,859,922 | Android - app not searchable in Android store | <p>I have a new app that I made and put in the store yesterday.</p>
<p>I am able to see it here: <a href="https://play.google.com/store/apps/details?id=com.problemio" rel="nofollow">https://play.google.com/store/apps/details?id=com.problemio</a></p>
<p>but there is absolutely no way I can see it in the app store when... | android | [4] |
3,964,921 | 3,964,922 | Which is a more efficient implementation of a linked list? | <p>There are at least two ways to represent a linked list:</p>
<p>1.)Using an array based representations of the linked list, where
we keep an <code>std::vector</code> of structs of the type</p>
<pre><code>struct {
<whatever-type-you-want> item ;
int nextitem;
}
</code></pre>
<p>Here insertin... | c++ | [6] |
1,546,239 | 1,546,240 | How to generate light colour shades in javascript | <p>Hello all I am working in JavaScript and want to generate colors for my graph.And I want a new color for every line and also the color should be light in shade.</p>
<p>I have read about question of color generation in java script</p>
<p><a href="http://stackoverflow.com/questions/1484506/random-color-generator-in-... | javascript | [3] |
4,154,611 | 4,154,612 | Significance of Super? | <p>Can anybody tell me why we need the super in every method for e.g.:</p>
<pre><code>-(void)viewDidLoad
{
[super viewDidLoad];
}
</code></pre>
<p>I am confused about the <code>super</code> keyword....</p>
| iphone | [8] |
2,917,226 | 2,917,227 | string compare jQuery | <p>I'm having some problems to compare two strings in jQuery:</p>
<pre><code>var option = "";
$.each(data, function(key, value) {
option += "<option ";
if(selected == value) {
option += "selected";
}
option += ">" + value + "</option>";
});
</code></pre>
<p>selected and value are the sam... | jquery | [5] |
4,566,441 | 4,566,442 | In IB, I created a table and now want to assign a variable to it | <p>I now want to refer to the table, but there isn't a variable in my .h file as it wasn't required when originally created. The table works great, can add/display/etc.</p>
<p>I tried adding "myTable" to the .h and then linking in IB (the table was linked to "view" and I could/did select "myTable"), but my first try ... | iphone | [8] |
3,357,283 | 3,357,284 | Delete the only node from a BST | <p>My BST have only ONE node. I wrote a code to delete that node but it's still there. Just like it hasn't been... updated. Here is my simple code, just to test the case</p>
<pre><code>void Delete(BSTree* tree, int& key)
{
if (key == tree->key)
tree=NULL;
}
</code></pre>
<p>And my BSTree class does... | c++ | [6] |
1,972,853 | 1,972,854 | Constructor Overloading in C++ | <p>My C++ overloading does not act as I assume it should:</p>
<pre><code>#include "Node.h"
#include <iostream>
Node::Node()
{
cout << "1" << endl;
Node(Game(), 0.0);
}
Node::Node(double v)
{
cout << "2" << endl;
Node(Game(),v);
}
Node::Node(Game g, double v)
{
cout ... | c++ | [6] |
96,047 | 96,048 | parseInt misbehaves when passed as argument to a map call | <p>Why is this happening?</p>
<pre><code>var numbers = [ '1', '2', '3', '4' ];
var intNumbers = numbers.map( parseInt ); // intNumbers = [1, NaN, NaN, NaN]
var fltNumbers = numbers.map( parseFloat ); // fltNumbers = [1, 2, 3, 4, 5 ]
</code></pre>
<p>But <code>Array.prototype.map.call( numbers, parseInt );</code> retu... | javascript | [3] |
4,795,288 | 4,795,289 | ASP.NET Refrence to my local PC in users event log, why? | <p>A customer has sent my a screen shot of their event log which shows an error from my ASP.Net app, the problem is it shows the line number where the error occurred but references my PC and the path into my files. Why? There's no references in my code.</p>
<p>Thanks
Lee</p>
| asp.net | [9] |
5,069,339 | 5,069,340 | custom view with buttons over the picker view | <p>Trying to create custom view with buttons than pickerview. Problem i m having is that custom view is displaying but not buttons</p>
<pre><code>UIView *view=[[[UIView alloc]initWithFrame:CGRectMake(0,200,320,300)]autorelease];
view.backgroundColor=[UIColor grayColor];
UIButton *myButton = [UIButton buttonWithType:... | iphone | [8] |
5,760,882 | 5,760,883 | How to fade the aspx page and open the dialog on buttonClick in aspx page | <p>Defaulttimesheet.aspx page in my application contains two buttons(search and back) and a multiview with attribute visible=false. Initially my page displays only two(Search and back) buttons when i click on search button the defaulttimesheet.aspx page colour changes to fade and displays multiview in white color. mult... | asp.net | [9] |
1,132,363 | 1,132,364 | Do not want to repeat myself | <p>I have some links and when someone click on those links it will show up a popup which has some info.And then close it when user clicks on x.I have used jquery's show and hide to do this. Different links have different info so i have repeated myself and i want to know is there any way to not repeat myself.<a href="ht... | jquery | [5] |
3,043,778 | 3,043,779 | PHP - Looping inside a loop, maybe? | <p>I am currently using a foreach loop to display some radio buttons like so</p>
<pre><code><?php
foreach($roles as $role){
$output .= '<div class="row">';
$output .= ' <input name="_'.$role->key.'" type="radio" id="'.$role->key.'" class="radio" />';
$output .= ' <label for="'... | php | [2] |
1,274,995 | 1,274,996 | TOO MANY if (obj is thisObj) statements | <p>I currently have method which is trying to find out what the obj is it recieved. It knows is on a certain interface, for example IService but I have code which looks at it and tries to tell me is it is for example Service1 or Service2.
I currently a lot of if(obj is thisObj) style statements, what would be the best ... | c# | [0] |
4,867,051 | 4,867,052 | How to detect when a property is added to a JavaScript object? | <pre><code>var obj = {};
obj.a = 1; // fire event, property "a" added
</code></pre>
<p>This question is different from <a href="http://stackoverflow.com/questions/1759987/listening-for-variable-changes-in-javascript-or-jquery">this one</a>, where ways to detect when an already declared property is changed, being disc... | javascript | [3] |
1,062,908 | 1,062,909 | Set photo as marker in map | <p>Let's say I got the absolute path into the photo. /mnt/sdcard/....jpg</p>
<pre><code> String path = "/mnt/sdcard/....jpg";
BitmapDrawable d = new BitmapDrawable(this.getResources(), path);
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
overlayItem.setMarker(d);
</code></pre>
<p>This ... | android | [4] |
2,943,605 | 2,943,606 | what is the most efficient way to creating a dict with two lists? | <p>I have two lists like </p>
<pre><code>x = ['a', 'b', 'c', 'd'] and
y = [1, 2, 3, 4]
</code></pre>
<p>I have to create a dict from these two lists so that result is</p>
<pre><code>{
'a': 1,
'b': 2,
'c': 3,
'd': 4
}
</code></pre>
<p>I do it using the following</p>
<pre><code>dict(zip(x, y))
</code></pre>
... | python | [7] |
2,896,876 | 2,896,877 | jquery - how to get properties from object Object? | <p>My php class is returning an array of object Objects, and I'd like to call or select attributes of each one. </p>
<p>My JS looks like this:</p>
<pre><code>$.get("getData.php", function(result){
var data = jQuery.parseJSON(result);
$.each(data, function(i, v){
console.lo... | jquery | [5] |
4,139,031 | 4,139,032 | how can I create the solution file for already existing visual studio 2003 web project | <p>I have one visual studio 2003 web project, I got this project form my friend, and how can I run this application in visual studio 2003.Becuse now I don't have a solution file for this application. In my system I don't have administrative access.</p>
| asp.net | [9] |
5,463,293 | 5,463,294 | Run external program concurrently | <p>I want to be able to run an external program concurrently with my Java code, i.e. I want to start the program, then return control to the calling method while keeping the external program running at the same time. The Java code will then keep generating input and send it to the external program and receive output ba... | java | [1] |
5,302,277 | 5,302,278 | Is it possible to insert external variable inside javascript function variable? | <p>I have two javascript methods ( <code>imports</code>, and <code>namespace</code>)
<code>imports</code> take a string argument( eg. <code>imports("com.x.y.MyClass")</code>) and based on <code>string</code> it create a relative path and append it to head tag as script ( <code>type = text/javascript</code>). using <cod... | javascript | [3] |
2,411,434 | 2,411,435 | Is there an easy way in Python to wait until certain condition is true? | <p>I need to wait in a script until a certain number of conditions become true?</p>
<p>I know I can roll my own eventing using condition variables and friends, but I don't want to go through all the trouble of implementing it, since some object property changes come from external thread in a wrapped C++ library (Boost... | python | [7] |
4,954,364 | 4,954,365 | Change parameters according to phone orientation | <p>I would like to set up these parameters</p>
<pre><code>IF (the phone is in vertical orientation)
imageView.setLayoutParams(new Gallery.LayoutParams(400, 400));
ELSE ()
imageView.setLayoutParams(new Gallery.LayoutParams(600, 600));
</code></pre>
| android | [4] |
114,591 | 114,592 | jquery settimeout function | <p>I try to learn the magic behind ajax-php configuration so that i tried to implement a code like a clock via php. But, it seems i am still missing something. Here is what i did so far.</p>
<p>HTML(starting the clock when it is clicked)</p>
<pre><code><div id="bu" onclick="clock()">asccasascascsc</div>
<... | jquery | [5] |
451,940 | 451,941 | How to direct users to my android app store | <p>I know this question has been asked and answered before.
But when I try the following code:</p>
<pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=your.game.package.name"));
startActivity(intent);
</code></pre>
<p>I get the message "the method parse(String) ... | android | [4] |
453,778 | 453,779 | Use jQuery to scroll all the way down | <p>I've got some list items that get shown when the user clicks a button, the button is at the very bottom of the page, so if the user clicks a few times they are forced to continue scrolling down to see the button.</p>
<p>I want to set the scroll bar to the very bottom when the user clicks the button.</p>
| jquery | [5] |
4,392,836 | 4,392,837 | Google Map V3 infowindows | <p>I’m developing a website that incorporates a Google map v3 and I would like to know how to programmatically close the infowindows that can be opened when the user clicks on the icons that are loaded with the map. I don’t mean the infowindows opened when the markers the site places on the map are clicked on. </p>
... | javascript | [3] |
3,817,340 | 3,817,341 | How to render a variable inside another? | <p>I want to place the variable $all right in the middle of $code, which is HTML code that I gathered from another file. My current code is like this.</p>
<pre><code>ob_start();
---code here---
$all = ob_get_clean();
$code = file_get_contents("file.txt");
echo $code;
</code></pre>
<p>file.txt would look a little some... | php | [2] |
1,417,481 | 1,417,482 | no cpickle module | <p>When I tried</p>
<pre><code>import cpikcle as pickle
</code></pre>
<p>I got an error message saying <code>no module named cpickle</code>. </p>
<p>Does anybody know how to get <code>cpickle</code> module?<br>
Because I heard that <code>cpickle</code> is faster than <code>pickle</code>.</p>
<p>Thanks</p>
| python | [7] |
1,530,960 | 1,530,961 | Async P/Invoke calls | <p>I'm working on a wrapping library for a robot controller, that mostly relies on P/Invoke calls.</p>
<p>However, a lot of the functionality for the robot, such as homing, or movement, takes quite a while, and do thread locks while running.</p>
<p>So I'm wondering how I can wrap the functionality in a async manner, ... | c# | [0] |
5,600,211 | 5,600,212 | Accessing the message body before or after received to inbox | <p>`
package com.example.smsTest;</p>
<pre><code>import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.widget.Toast;
public class SmsReceiver extends BroadcastReceiver
{
@Override
... | android | [4] |
2,515,773 | 2,515,774 | Adding 30 days to date giving one day less | <p>I am adding 30 days to a date but its giving me 1 day less.</p>
<p>i.e. if I put 20 oct 2011 then it is giving 19 Nov 2011 one day less .</p>
<p>Please suggest me some solution. </p>
| java | [1] |
3,850,669 | 3,850,670 | Checking argv[] against a string? (C++) | <p>So I'm attempting to check the arguments that I'm inputting into my program, and one of them is either the word "yes" or "no", entered without the quotes. </p>
<p>I'm trying to test equivalency ( if (argv[n] == "yes") ) but that seems to be returning false every time when the input is, in fact, yes(When I output it... | c++ | [6] |
4,492,100 | 4,492,101 | Transparent Panel in android | <p>how to use Transparent Panel in List View.. </p>
| android | [4] |
335,905 | 335,906 | generate random long number in C++ | <p>We know that to generate random long number we do following steps in Java</p>
<pre><code>Random r=new Random()
return r.nextLong();
</code></pre>
<p>what will be equivalent of this code in C++? like this?</p>
<pre><code>return (long) rand();
</code></pre>
| c++ | [6] |
1,016,651 | 1,016,652 | When i am trying to upload it in market it shows.. "You need to reduce your APK file size to 50MB or use APK Expansion Files." | <p>My project apk file size is 101mb,When i am trying to upload it in market it shows.. "You need to reduce your APK file size to 50MB or use APK Expansion Files."</p>
| android | [4] |
3,430,666 | 3,430,667 | Android: TabLayout not working | <p>I was trying the TabLayout Tutorial from official developers site. I didnt copy paste it as such and some minor changes and corrections to typos in the tut.</p>
<pre><code>package com.org.example;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os... | android | [4] |
4,611,752 | 4,611,753 | Android menu controls | <p>I am developing an application and I would like to use the control that I can see in the Photos application and the Desk Clock (on an HTC Desire).</p>
<p>The one I am referring to is the bar along the bottom of the screen that has various icons in it. When you press on an icon, the bubble moves along the bar to the... | android | [4] |
1,564,931 | 1,564,932 | how to genarate Json for jsTree | <p>i found yestarday the jsTree plugin, it's great. Have sombody a SQL sample to create the json for it?</p>
| jquery | [5] |
5,487,041 | 5,487,042 | How to convert an H:MM:SS time string to seconds in Python? | <p>Basically I have the inverse of this problem: <a href="http://stackoverflow.com/questions/775049/python-time-seconds-to-hms">Python Time Seconds to h:m:s</a></p>
<p>I have a string in the format H:MM:SS (always 2 digits for minutes and seconds), and I need the integer number of seconds that it represents. How can I... | python | [7] |
496,284 | 496,285 | Does variable assignment with var do not execute right away in Javascript? | <p>I'm asking this, because when I try to debug code by using safari console, I found </p>
<blockquote>
<p>my_string = 'abc'</p>
<p>"abc"</p>
</blockquote>
<p>it return the the string itself in the console right away</p>
<p>but with var</p>
<blockquote>
<p>var my_string = 'abc'</p>
<p>undefined </p>
<... | javascript | [3] |
3,262,740 | 3,262,741 | Any good site that teaches C++? | <p>I am searching for any good site that teaches C++, that can explain most to all things about it(general) and has a decent active community.</p>
<p>About Me:
I am new to programming(knows nothing of it, so please bare with me), I have only learned(to a very basic form) LUA scripting Language, so yes I am your comple... | c++ | [6] |
4,439,984 | 4,439,985 | Newbie to Python syntax - Error - suspect use of single/double quotes | <p>This is my first time using Python and I am receiving the attached message when attempting to run a script.</p>
<p>here is the code (line 32 is the line starting "font-size:...":</p>
<pre><code># County style
'font-size:12px;fill-rule:nonzero;stroke:#FFFFFF;stroke-opacity:1;
stroke-width:0.1;stroke-miterlimit:4;st... | python | [7] |
3,094,692 | 3,094,693 | Jquery easy variables issue | <p>I am trying to pass the variables to callback function in Jquery</p>
<p>I have:</p>
<pre><code>var test;
$('.img').hover(function(){
test='this is test';
}, function (){
//how do I pass the test value to the callback function..??
console.log(test)
})
</code></pre>
<p>Thanks for the help.</p>
| jquery | [5] |
1,943,974 | 1,943,975 | Loading picture show loading progress | <p>I use the function to show picture:</p>
<pre><code>Bitmap imageBitmap = loadBitmap(URL);
</code></pre>
<p>loadBitmap() as below:</p>
<pre><code>private Bitmap loadBitmap(String url) {
try {
Bitmap bm = BitmapFactory.decodeStream((InputStream)this.fetch(url));
return bm;
}
catch(Exception e) {
e.printStackTrace();... | android | [4] |
3,391,252 | 3,391,253 | Python: elegant way of creating a list of tuples? | <pre><code>>>> a=["a"]*4
>>> a
['a', 'a', 'a', 'a']
>>> b=range(4)
>>> b
[0, 1, 2, 3]
>>> c = [range(4,8), range(9,13), range(14,18), range(19,23)]
>>> c
[[4, 5, 6, 7], [9, 10, 11, 12], [14, 15, 16, 17], [19, 20, 21, 22]]
>>>
>>> result = map(lambd... | python | [7] |
475,114 | 475,115 | Theoretically, would it be possible to allow multiple C++ templates to have the same name? | <p>It would be like function overloading. E.g. it is ok to do this:</p>
<pre><code>void foo(int i) {
;
}
// Function overload ftw.
void foo(int i, int j) {
;
}
</code></pre>
<p>But it is not (yet) ok to do this:</p>
<pre><code>template<typename T>
class Foo {
};
// Fail!
template<typename T1, typename... | c++ | [6] |
622,976 | 622,977 | Design item template with xaml | <p>I have to design a calculator like interface.
i'm utterly confused with how to do this.can any provide me with an insight?
how to bind data with these buttons at runtime.?</p>
| c# | [0] |
2,682,854 | 2,682,855 | restrict NSArray to having only one kind of object | <p>i have two class Screen and control. now in screen class i have declare one NSArray variable
and this variable should only contain control type object only(in c like control[])
how could i achieve this functionality?????</p>
| iphone | [8] |
3,153,371 | 3,153,372 | option item selection in Dialog menu | <p>I have been running into some troubles recently and I think I need your help :).
I am currently trying to show a menu on top of a dialog, I know that it could be far easier to launch a new activity yet doing so would compell me to store/pass a lot of data.
I managed to show an optionmenu by writing a custom dialog a... | android | [4] |
6,004,372 | 6,004,373 | Application close unexpectedly after calling web service if result is null | <p>i use the following lines in my program to call web service and taking the result</p>
<p>all thing is fine, but if any time if a web page has no content it has null or white space then application close unexpectedly.</p>
<pre><code> 1) SoapPrimitive result=null;
2) androidHttpTransport.call(SO... | android | [4] |
5,505,195 | 5,505,196 | Call Control Example Issue on Emulator | <p>I am testing call control example given on: <strong>http://prasanta-paul.blogspot.com/2010/09/call-control-in-android.html</strong> on emultaor.</p>
<p>Code is as below:</p>
<pre><code>package com.example.callblock;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.I... | android | [4] |
2,492,592 | 2,492,593 | TypeError: sequence item 0: expected string, int found | <p>I am attempting to insert data from a dictionary into a database. I want to iterate over the values and format them accordingly, depending on the data type. Here is a snippet of the code I am using:</p>
<pre><code>def _db_inserts(dbinfo):
try:
rows = dbinfo['datarows']
for row in rows:
... | python | [7] |
671,071 | 671,072 | File is being used by another process | <p>I am developing a c# application, backend as sqlite.In my application i have an option for clean databse.It means the curren .db file will delete using File.Delete method and again it create empty databse using File.create method.Now let me explain the problem.</p>
<p>To perform cleandatabse task, i have to stop al... | c# | [0] |
1,976,227 | 1,976,228 | C# ambiguous call DataColumnCollection.Add(System.Data.DataColumn)' and 'System.Data.DataColumnCollection.Add(string) | <p>below is the code i'm using and i've used this 100x's before. And now it's throwing an error, basically i'm trying to dynamically create the Columns based on the first row of an excel file. The error that i'm receiving now is:</p>
<p><code>The call is ambiguous between the following methods or properties: 'System... | c# | [0] |
2,048,512 | 2,048,513 | Acronym generator in javascript. It only grabs the first letter of the first word, but the not the other words | <p>Am I missing something in my code? It seems to only grab the first letter, and the while loop, doesn't go onto the next word. So what could I be missing?</p>
<pre><code>function acr(s){
var words, acronym, nextWord;
words = s.split();
acronym= "";
index = 0
while (index<words.length) {
... | javascript | [3] |
76,976 | 76,977 | Check difference in seconds between two times | <p>Hi all I am currently working on a project where when a certain event happens details about the event including the time that the event occurred is added into a list array. </p>
<p>Once the method has finished I then pass on the list to another method that checks its values. Before I go through the loop I check the... | c# | [0] |
5,158,413 | 5,158,414 | What is the best way to implement a web service for Android? | <p>I post this question to get an idea about the best way to implement a web service for an Android application since I have confused on this.(I think this question is acceptable here)</p>
<p>I have to implement a simple order management system for Android. The order management system working as follows.</p>
<p>1.Sal... | android | [4] |
3,354,963 | 3,354,964 | Finding minimum using recursion | <p>Ok, so I need to keep on getting the user inputs until they enter 0. I need to store them in an array and print out the minimum. But it keeps on giving me the last input number given instead of sorting and getting the minimum in the list. Here's what I've done so far.</p>
<pre><code>import java.io.*;
import java.ut... | java | [1] |
4,725,401 | 4,725,402 | Retrieving all entries except who are blocked query | <p>I have following table</p>
<pre><code>id blocked blocker
1 2 1
2 4 2
3 xx xx
4 xx xx
</code></pre>
<p>Suppose i provide an id 2</p>
<p>1- I want to perform a query in which both first and second result will be output.</p>
<p>I am using following query </p>
<pre><code>... | php | [2] |
3,071,561 | 3,071,562 | Minimizing Javascript | <p>Ok, so I just learned about minimizing JS to make it load quicker, so what I've been doing is copying that and putting it into the JSbeautifier. However, when I do this it comes back as like 7k lines of JS and I'm curious if this is just one function or a whole library or does it depend?</p>
| javascript | [3] |
1,167,799 | 1,167,800 | How to remove issues in jQuery | <p>I wrote a small jQuery application recently to practise the language and got some feedback which criticised it in the following:</p>
<ol>
<li>you don't use any message passing in your functions,</li>
<li>you had hard coded values for some of your data (eg: the colours),</li>
<li>you had initalisation code embedded ... | jquery | [5] |
1,461,252 | 1,461,253 | Default.png | <p>Ok. I've got an openGL ES application up and running on the iPhone.</p>
<p>And my project has a Default.png to show something other than a black screen on powerup.</p>
<p>This image appears when I compile a DEBUG version for the simulator and the device. If I do a compile for the DEVICE in RELEASE mode, the imag... | iphone | [8] |
5,467,504 | 5,467,505 | How to show copy option in webview | <p>I want to show copy option in web view. When user select text from web view and when user select text then it show toast with message like text is copied into clipboard. So when user select text then what event called which copy the selected text into clipboard or any event which called after text copied into web vi... | android | [4] |
3,264,317 | 3,264,318 | C# antivirus block smtp check | <p>I am trying to check smtp server with the below method.</p>
<p>Seems working fine, but there is a block alert from my antivirus.</p>
<p>Is there anyway to check if the antivirus is blocking and then stop the smtp check?</p>
<p>Thanks.</p>
<pre><code>public static bool Check(string host, string port, string usern... | c# | [0] |
1,872,748 | 1,872,749 | display text if value is 2 in echo statement? | <p>I have the following echo statement that displays a numerical value from a session:</p>
<pre><code><?php echo(str_replace('"', '&quot;', $row_WAATKgblqemplisting['Group'])); ?>
</code></pre>
<p>How do I alter this statement so that if <code>$row_WAATKgblqemplisting['Group']</code> </p>
<p>is equal to 2 ... | php | [2] |
4,739,786 | 4,739,787 | What's the point of passing a parameter by reference in C#? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://programmers.stackexchange.com/questions/57068/why-are-objects-passed-by-reference">Why are objects passed by reference?</a> </p>
</blockquote>
<p>Doesn't C# send the objects themselves? So unless it's some kind of swap function for primiti... | c# | [0] |
3,011,520 | 3,011,521 | How to apply a variable filter to this model? | <p><strong>I have this view how do I only iterate this unit model when the $wprice is > 1</strong></p>
<pre><code><?php
$model->getFeaturedVehicles(10, 0, unserialize($vtype), unserialize($makes), $p1range, $p2range, $filters) ?>
<div id="adspecials"><?php while ($unit = $model->iterate())... | php | [2] |
201,590 | 201,591 | How to open a file and find the longest length of a line and then print it out | <p>Here's is what I have done so far but the length function isn't working.
import string</p>
<pre><code>def main():
print " This program reads from a file and then prints out the"
print " line with the longest length the line ,or with the highest sum"
print " of ASCII values , or the line with the greates... | python | [7] |
3,111,301 | 3,111,302 | Implementing smooth div toggle | <p>I am trying to recreate the "div toggle" effect on this page, but with jQuery:</p>
<p>cordon-bleu.se</p>
<p>I want this effect, but working like the above page: the visible div hides when you click to show another:</p>
<p>sohtanaka.com/web-design/easy-toggle-jquery-tutorial/</p>
<p>My javascript so far is:</p>
... | jquery | [5] |
3,497,330 | 3,497,331 | Recommended way to initialize variable in if block | <p>I have the following code (minus some other operations):</p>
<pre><code>def foobar():
msg=None
if foo:
msg='foo'
else:
msg='bar'
return msg
</code></pre>
<p>Is the following better practice for the <code>msg</code> variable? </p>
<pre><code>def foobar():
if foo:
msg='foo... | python | [7] |
5,268,625 | 5,268,626 | Why isn't my @override for contains working? | <pre><code>@Override
public boolean contains(Object o) {
if ((this.name).equals((String) o)) {
return true;
}
else {
return false;
}
}
</code></pre>
<p>I get the error: The method c<code>ontains(Object)</code> of type <code>Team</code> must override or im... | java | [1] |
2,582,538 | 2,582,539 | Real-time audio capture and playback from an external mic | <p>How can I capture audio from an external mic plugged in the 3.5mm jack and play it back in real-time to the phone speaker?</p>
<p>I'm able to capture the audio from that source, save it to a file and play it then to the speaker. However, when I try to mix the things, the audio is being captured from the in-built mi... | android | [4] |
6,012,445 | 6,012,446 | Dictionary out of list in python | <p>How can I create a dictionary out of the a in python?</p>
<p>If I have a list like this:</p>
<pre><code>a = ["Albert Einstein", "Nils Bohr"]
</code></pre>
<p>And I want it to become this:</p>
<pre><code>b = {'Albert Eienstein': ['Albert', 'Eienstein'], 'Neils Bohr': ['Neils', 'Bohr']}
</code></pre>
| python | [7] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.