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 |
|---|---|---|---|---|---|
399,539 | 399,540 | Is there a java library that validates URNs? | <p>What's the easiest way to validate that a string is a valid <a href="http://www.ietf.org/rfc/rfc2141.txt">URN</a>?</p>
<p><strong>Edit</strong> Using URI is not a correct solution! URIs are allowed to have all kinds of things that URNs can't, like <code>&</code></p>
| java | [1] |
3,391,685 | 3,391,686 | how to exit from currentrunloop | <p>I used NSRunloop in my application. While going from my current controller i need to exit from the run loop also. How can i exit from current run loop .</p>
<p>Runloop is implemented as follows.</p>
<pre><code>while(!completed) {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateW... | iphone | [8] |
5,758,772 | 5,758,773 | php5 shorthand variables | <p>I have seen most of the developers use <code>$name</code> instead of <code>$_GET['name']</code> and <code>$domain</code> instead of <code>$_POST['domain']</code>, is this shorthand by php5 and is it safe or any documentation for it.</p>
| php | [2] |
430,326 | 430,327 | Android setContentView or Intents? | <p>I have a very simple 2 screen android app.</p>
<p>Is there any downside to simply switching out the layouts via setContentView or should i be using intents?Don't want to bugger up my app if something is wrong with this.</p>
| android | [4] |
3,433,717 | 3,433,718 | refresh page after jquery/javascript event? | <p>Can someone please show me how i can add an automatic page refresh after the following jquery event has taken place?</p>
<p>Thanks. </p>
<pre><code><script>
$(document).ready(function() {
setTimeout(function() {
$(".infobox-forum").fadeOut("slow", function () {
... | javascript | [3] |
4,180,032 | 4,180,033 | java input output stream | <p>Does anyone have any good suggestions for creating a Pipe object in Java which is both an InputStream and and OutputStream since Java does not have multiple inheritance and both of the streams are abstract classes instead of interfaces?</p>
| java | [1] |
1,304,912 | 1,304,913 | android radiobutton on listview | <p>is it possible to apply a radio group on the whole Listview?</p>
<p>I have a listview where each item has some image, a text and a simple single radio button. When a user clicks on say the first items radio button, i want the previous selected radio button to be disabled. is this possible?</p>
<p>How do u apply a... | android | [4] |
2,891,165 | 2,891,166 | Checking image name using javascript | <p>I'm changing the img src on click using javascript.</p>
<p>I'm trying to determine whether to switch on or off.</p>
<p>I'm testing the following:</p>
<pre><code>var img_el = document.getElementById("on_off_img");
if ( img_el.src == 'img/on.png' ) {
img_el.src = 'img/off.png'
} else {
img_el.src = 'img/on.pn... | javascript | [3] |
4,976,123 | 4,976,124 | why i get this traceback? | <p>This is part of my code:</p>
<pre><code>if ind_1<>0:
rbrcol=[]
brdod1=[]
for i in range(27):
if Add_Cyc_1[1,i]!=0:
rbrcol.append(Add_Cyc_1[0,i])
brdod1.append(Add_Cyc_1[1,i])
Probrani_1=vstack((rbrcol,brdod1))
pok=0
for i in (rbrcol):
pok+=1
broj1=0
fo... | python | [7] |
2,866,593 | 2,866,594 | running javascript in IE without warning 'the webpage you are trying to access wants to run activex control' | <p>is there anyway to stop popping up the warning message in IE when trying to execute javascript?</p>
<p>I want some solution which does not need modifying the settings in the IE manually by the user.</p>
<p>Thanks,</p>
| javascript | [3] |
373,037 | 373,038 | php fun codeing | <p>hey I make a simple php table using nested for loop ... and it will be like this...</p>
<pre><code>1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
</code></pre>
<p>but the problem is , i can not print this value using a loop inside the column .. so what will be the solution ??? please </p>
<p><strong>my c... | php | [2] |
4,642,889 | 4,642,890 | Opposite of finish() | <p>I know that finish() returns your activity back to your previous activity. Now I am curious if we are able to accomplish the opposite meaning forwarding back to the next activity that you backed off without doing an Intent. This is just a curiosity question.</p>
<p>Is this possible? </p>
| android | [4] |
4,364,186 | 4,364,187 | jQuery: How do I rewrite .after( content, content )? | <p>I've got this form working, but according to <a href="http://stackoverflow.com/questions/2932549/what-is-the-status-of-jquerys-multi-argument-content-syntax-deprecated-support">my previous question</a> it might not be supported: it isn't in the docs either way -- but the intention is pretty obvious in the code.</p>
... | jquery | [5] |
2,758,146 | 2,758,147 | Setting variable by string name in javascript? | <pre><code>//window["Fluent"]["Include"]
function setGlobalVariableByName(name,value)
{
var indexes = name.split(".");
var variable = null;
$.each(indexes, function()
{
if (variable == null){
variable = window[this];
}else{
variable = variable[this];
}
... | javascript | [3] |
4,397,310 | 4,397,311 | NullReferenceException when user control references usercontrol in parent user control | <p>I have a user control (uc1) which inherits from uc2. uc2 has a user control (uc3) declared in the markup. I am trying to access uc3 from uc1 but I get NullReferenceException. I thought due to inheritance uc3 would instantiate but looks like I am missing a step.</p>
<p><strong>Clarification:</strong></p>
<p>How doe... | asp.net | [9] |
3,391,421 | 3,391,422 | throwing an exception in a setter (java) | <p>I'm creating a Cylinder class that calculates the volume and surface area of a cylinder object created in a test class that extends the Cylinder class, and want to know how I can test that the values passed through, as radius and height, are positive. I'm attempting to do this in the setter, and have the following j... | java | [1] |
2,450,786 | 2,450,787 | Collections vs Arrays regarding sort() | <p>Collections vs Arrays regarding sort()
What is the difference between these two regarding sort() method? I know Arrays' sort() is using binary search for sort(), what about Collections'? And how to choose which to use?
Thanks!</p>
| java | [1] |
118,544 | 118,545 | Any simple way to test null before convert an object to string | <p>I always write</p>
<pre><code>Object o;
if (o!=null)
String s = o.toString();
</code></pre>
<p>If there simple way to handle this case?</p>
| java | [1] |
5,661,530 | 5,661,531 | Android:WebView | <p>I have an activity with 3 TextViews and 3 buttons at the bottom. I tried adding the WebView in between 2 textViews. I want the look of this WebView to be same as that of the textViews. Meaning the backgroud, the font the color. </p>
| android | [4] |
2,056,902 | 2,056,903 | In C++, how do you print out several lines of text to the console? | <p>Let's say you wanted to print out one of those great ascii art images. How can you do that without "cout"ing each line individually?</p>
| c++ | [6] |
2,177,875 | 2,177,876 | How can I make a click event work on more than one selector? | <p>I have this code:</p>
<pre><code> $("#menu").on('click', 'a', function (event) {
javascript code
...
});
$("#home").on('click', 'a', function (event) {
javascript code
...
});
</code></pre>
<p>Is there some way I can combine these tw... | jquery | [5] |
2,645,132 | 2,645,133 | Is it possible to run 2 processes paralel in android? | <p>I am interested if it's possible to run 2 lines of code simultaniously,</p>
<p>let's say if i have some function
funk();
funk1();
so i want them to be executed simultaniusly</p>
| android | [4] |
4,357,370 | 4,357,371 | How can i have a look at the variables and its values during execution..? | <p>I want to know from where can i see all the values of the variables that my program uses. i know that using Log() i can see it placing it in the code ,where the values is to be known.But i dont want through the code,i want all the vales of all the variables declared in the program. </p>
<p>For example, </p>
<pre><... | android | [4] |
5,857,989 | 5,857,990 | Can I write an array of UILocalNotifications to disk? | <p>I'm trying to use the following code to persist the current list of local notifications. NSArray explicitly lists the kind of objects it will work with, which implies I can not use this with an array full of UILocalNotification objects. However, UILocalNotifications does implement NSCoding, which led me to believe t... | iphone | [8] |
5,254,245 | 5,254,246 | Are the Sky Map APIs available? | <p>I'm looking to build an application similar to Google Sky Map, and was wondering if it was possible to hook into any of the APIs it uses. If so, which ones? If not, how else can it be done?</p>
<p>From what i've read so far, I can do a search via an intent for any the objects in Google's sky map db.. but i'd like t... | android | [4] |
2,298,870 | 2,298,871 | It there have any way to create the DLL with a header file by using visual C#? | <p>I am doing mine FYP by using the </p>
<ol>
<li>Visual C# </li>
<li>Agilent VEE</li>
</ol>
<p>I am try to import the DLL file which created from C# into Agilent VEE but VEE required the header file and library file for the importing.</p>
<p>Please kindly help me.</p>
| c# | [0] |
803,447 | 803,448 | detecting if came back from child activity | <p>How can I detect if an activity came to focus after pressing back button from child activity, and how can I execute certain code at that time.</p>
| android | [4] |
5,116,765 | 5,116,766 | how to return objects interface name/type? | <p>Is there a function or something to get the interface of an object?</p>
<p>Like, for <code><p/></code> = <code>HTMLParagraphElement</code>, how would I retrieve it?</p>
<p>Thanks in advance!</p>
| javascript | [3] |
4,057,908 | 4,057,909 | JavaScript Onclick window.open will not work properly in IE | <p>I hope my question is one that is simple to answer, but unfortunately I don't have a great knowledge of javascript. I've spend a good portion of the day Googling the issue and trying various workarounds, but nothing has worked adequately thus far. </p>
<p>I am running a very simple piece of JavaScript so that when ... | javascript | [3] |
2,923,671 | 2,923,672 | Prevent form from submit w/ jQuery | <p>I have a page that displays data. A user can click "edit" button and the text displays within a form. Basically I hide form and on click toggle text to hide and form to show. I need to make sure that the form can not be submitted, via page refresh or clicking Enter key, until it is visible and the user clicks submit... | jquery | [5] |
2,672,608 | 2,672,609 | IllegalAccessError: accessing a protected method | <p>I have two classes.</p>
<p>Class <code>A</code> has protected method <code>m()</code>, <code>a</code> is an instance of <code>A</code>.</p>
<p>Class <code>B</code> is in the same package as class <code>A</code>.</p>
<p>I am trying to access <code>a.m()</code> but I am getting <code>IllegalAccessError</code>...</p... | java | [1] |
4,401,017 | 4,401,018 | Calling finish() on an Android activity doesn't actually finish | <p>I'm calling <code>finish()</code> but my activity keeps on going.</p>
<p>I have an activity which is invoked by a menu from the main activity screen. In my activity's <code>onCreate()</code> method I have the following code fragment:</p>
<pre><code> // Make sure there are some events in the list.
if (theEv... | android | [4] |
4,041,510 | 4,041,511 | How to access subprojects header file in main project | <p>I have one main project and another project which is added as a subprojects. I want to access header file which is defined in subproject into the main projects but unfortunate it is saying file not find error.</p>
<p>Please have look on the attach image. what should I modify to access header files of subprojects?</... | iphone | [8] |
1,886,568 | 1,886,569 | Output the total number of String Characters | <p>My Question is what method should I use if I wanted to get the total number of characters a user inputs? without using arrays, i tried using .length() but it did not return all characters say from the first and lastname, it only returned the first name. </p>
<p>Here's an example of my code. (Please dont laugh im re... | java | [1] |
388,823 | 388,824 | What mode should I use when I create a folder for uploaded files | <p>I have this directory structure:</p>
<pre><code>\htdocs
\htdocs\uploadfiles\
</code></pre>
<p>Now if a user's id is s001, then I should create a new folder for this user to store uploaded files.</p>
<pre><code>\htdocs
\htdocs\uploadfiles\
\htdocs\uploadfiles\s001\
</code></pre>
<p>Here are my questions:</p>
<pr... | php | [2] |
5,471,174 | 5,471,175 | ASP.NET: Without using Membership API, how do you restrict resource files(e.g. jpg) to certain roles? | <p>It is easy to restrict access to aspx pages, just use role-checking logic in the code-behind. But resource files like a photo does not have a code behind to put role-checking logic, so how to restrict access?</p>
| asp.net | [9] |
2,693,997 | 2,693,998 | File Explorer (File Selection) android | <p>I want to let the user select some files from his android device to upload it on server.
how can i show a file explorer and let the user pick any(image/audio/vedio) file (single or multiple selection) to upload it.<br>
how can i implement this.</p>
<p>Please help.<br>
thanks.. </p>
| android | [4] |
5,681,229 | 5,681,230 | how to make layout to work on all size in android | <p>can anybody tell how to make layout to work on all size in android.if I used support screen is it work for all screen size ? can anybody tell how to do?</p>
<pre><code><supports-screens android:resizeable=["true"| "false"]
android:smallScreens=["true" | "false"]
... | android | [4] |
4,760,456 | 4,760,457 | Dynamic memory allocation with default values | <pre><code>class A
{
private:
int m_nValue;
public:
A()
{
m_nValue = 0;
}
A(int nValue)
{
m_nValue = nValue);
~A()
{}
}
</code></pre>
<p>Now in main if i call </p>
<pre><code>A a(2);// 2 will be assigned for m_nValue of object A.
</code></pre>
<p>Now how do we do this if i want to define an array of objects.
Also ho... | c++ | [6] |
4,806,613 | 4,806,614 | How to select with jquery, similar elements from different DOM levels? | <p>I would like to select only the "mixitup" elements from the same level clicking on one of this elements.</p>
<pre><code><div data-id="0">
<div class="mixitup">1</div>
<div class="mixitup">2</div>
<div class="mixitup">3</div>
</div>
<div data-id="1">
... | jquery | [5] |
3,805,161 | 3,805,162 | how to sort the list<Date, String> in Java according to Date | <p>I have some table names coming as i/p param to my method. I need to get the creationDate (date), count for each table and put it in a consolidated List)</p>
<p>and then Sort the list according to the creationDate.</p>
<p>Here is the Method:</p>
<pre><code>public String getData(List tablename){
Lifecycle.begin... | java | [1] |
3,059,227 | 3,059,228 | How to run the same asynctask more than once? | <p>I have my asyncTask run when the activity first starts, then if network connectivity is not available then i have a refresh button that tries to run the asyncTask to try again. But i get a debug error saying this..</p>
<pre><code>07-29 18:14:21.290: ERROR/AndroidRuntime(9080): FATAL EXCEPTION: main
07-29 18:14:21.2... | android | [4] |
2,745,326 | 2,745,327 | attr('selected','selected') not work in jquery | <pre><code>$('#sellist option').each(function(index) {
var str ='4/5/8';
var substr = str.split('/');
if (substr[0] == $(this).attr('value')) {
$(this).attr('selected','selected');
alert('hi'); ///For check
}
});
</code></pre>
<p>Every thing works fine and <code>alert</code> is fired. I... | jquery | [5] |
3,641,644 | 3,641,645 | Javascript: Can't reference window from parent | <p>So i have a popup javascript calendar someone else wrote into my app. What i am trying to do is reference it from the window that opens it, but the normal way of assigning the window.open to a variable is not working. I think the issue is that the calendar, while being generated set itself as its opener.</p>
<pre... | javascript | [3] |
6,028,305 | 6,028,306 | Java Pentaho Reporting TOC generation from selected Subreports in Masterreport? | <p>I need help on generating programmatically a toc from a list of selected subreports in a masterreport!
I already add all jars needed in my classpath like (pentaho engine extension toc... api)</p>
<p>Could someone help me pls with a howto or a sample</p>
<p>best regards </p>
<p>Marc</p>
| java | [1] |
4,503,981 | 4,503,982 | Include headers of both base and inherited class in main | <p>I have a class <code>calendar</code> and a class <code>extendedCalendar</code> that inherits from <code>calendar</code></p>
<p>I want to be able to create objects of both classes in main, so i include both of their headers in <code>main.cpp</code> :</p>
<pre><code>#include "calendar.h"
#include "extendedCalendar.h... | c++ | [6] |
2,555,269 | 2,555,270 | Strange use of strlen | <p>I tried to compile the follow sample code:</p>
<pre><code>#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main ()
{
if (strlen <= 0) {
cout << "trace1" << endl;
return 0;
}
cout << "trace2" << endl;
return 0;
}
</code><... | c++ | [6] |
3,355,272 | 3,355,273 | How do I add a time difference to an array with PHP? | <p>I have the following array structure in MySQL. There could be no items or many items; the example shows only three.</p>
<pre><code>Array
(
[0] => Array
(
[id] => 1
...
[start_time] => 09:00:00
[finish_time] => 10:20:00
...
)... | php | [2] |
461,132 | 461,133 | E/Trace(640): error opening trace file: No such file or directory (2) | <p>I installed Android SDK, JDK, Eclipse. My project name is Bible, and I build in eclipse Bible. In emulator this error shows <em>"Unfortunately, Bible has stopped"</em> and in Logcat this error message shows</p>
<pre><code>E/Trace(640): error opening trace file: No such file or directory (2)
shuttind down VM
</code>... | android | [4] |
3,025,727 | 3,025,728 | Speed of Android mobile | <p>How to calculate the speed with which android mobile is moving, i.e user with mobile in his pocket/hand. Basically I would like to invoke some activity based on the user's speed, how will I calculate? based on what parameters in mobile.
Thank you. </p>
| android | [4] |
490,100 | 490,101 | Jquery Photogallery | <p>I am using following Jquery code for SlideShow</p>
<pre><code><head>
<title>Simple Slide Show with jQuery</title>
<script type='text/javascript'
src='http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js'>
</script>
<script type="text/javascript">
var imgs = [
'images... | jquery | [5] |
2,784,459 | 2,784,460 | Read div value from webpage | <p>I haven't really found anything about this. I want to read data from a website. From my webpage I can read a div's value with </p>
<pre><code><div class="tools">hammer</div>
var divs = document.getElementsByTagName("div");
for(var i=0; i<divs.length; i++ ) {
if(divs[i].className == "tool... | javascript | [3] |
2,892,531 | 2,892,532 | How can I stop an ASP.NET website from loading depending on a certain condition? | <p>How can i stop asp.net website?<br>
I want check some condition and after that if something's wrong then stop website from loading.</p>
| asp.net | [9] |
1,458,433 | 1,458,434 | How to know the formatting of Excel Cell | <p>Is it possible to figure out the Format of Excel cell i know there is .NumberFormat but it returns the formatting but not the type... basically i need to know if it is custom then it should return custom and if it is currency it should return Currency or any other datatype
Please help me</p>
| c# | [0] |
5,008,339 | 5,008,340 | Subsequence of strings | <p>I implemented a python function that returns the longest common subsequence of 2 strings. Now, I'd like to implement a function that returns the longest common subsequence of any number of strings.</p>
<p>I found this help for 3 strings:</p>
<pre><code>dp[i, j, k] = / 1 + dp[i - 1, j - 1, k - 1] if A[i] = B[j] = C... | python | [7] |
2,699,388 | 2,699,389 | On-the-fly modifications of the links according to a set of rules (Greasekit / Javascript) | <p>I have an HTML page with loads of entries like this:</p>
<pre><code><a href="https://www.example.co.uk/gp/wine/product?ie=UTF8&amp;asin=123456789&amp;tab=UK_Default" class="PrmryBtnMed"
</code></pre>
<p>I want to replace all this links so they instead are
<a href="https://www.example.co.uk/gp/wine/o... | javascript | [3] |
2,068,624 | 2,068,625 | get data by id in grid view | <p>I have a table with threads for a forum, the thread name is a link and once clicked it passes the thread_id to the comments page, I need to know how to then display all the comments with the thread_id that is passed?</p>
<p>Have tried:</p>
<pre><code><asp:SqlDataSource ID="CommentsDataSource" runat="server"
Sel... | asp.net | [9] |
3,731,565 | 3,731,566 | How to use menu and onKeyDown() on the same activity | <p>I am developing an Android app. I have written my own code for back key event.
For that i am catching events using this method
public boolean onKeyDown(int keyCode, KeyEvent event) .....</p>
<p>I also want to use Menu options I have used Inflator for that.
But when I click on menu button, that event caught by my o... | android | [4] |
2,129,971 | 2,129,972 | Need your suggestion with conversion | <p>We having a VB6 Windows Application and now user wants to convert this with latest C# Asp.net/Asp.Net MVC application.</p>
<p>If Asp.net Web application is not possible, then we can opt for C# winform application.</p>
<p>My question what are the migration tools available and what are the challenges in conversion.<... | asp.net | [9] |
5,527,625 | 5,527,626 | How to check special characters with Regular Expressions? | <p>In javascript I check for some characters but I want to allow underscores and slashes but I don't know how. </p>
<pre><code> alias: /^[a-z-Z0-9]{2,35}$/
</code></pre>
<p>How to put / and _ so it has not special meaning to Regexes. </p>
| javascript | [3] |
4,920,455 | 4,920,456 | Converting Canvas to Drawable | <pre><code>int x = 10;
int y = 10;
int r = 4;
Paint mPaint = new Paint();
mPaint.setColor(0xFF0000);
Canvas mCanvas = new Canvas();
mCanvas.drawCircle(x,y,r,mPaint);
</code></pre>
<p>Is there any way to convert <code>mCanvas</code> to a Drawable? My goal is to generate drawables with a certain shape and color.<... | android | [4] |
402,898 | 402,899 | How to make a score counter for my Android app | <p>I'm quite a beginner with java and Android in general so I would like to ask how to easily make a score counter that would change every millisecond, so every millisecond they survive the score counter moves up 1.
Something like
<a href="http://d2fhka9tf2vaj2.cloudfront.net/tuts/062_scoreClass/Tutorial/15.jpg" rel="... | android | [4] |
4,440,048 | 4,440,049 | Android emulator takes time to run application | <p>When I am running my hello world codes with Android emulator, its take more time to run. If it take more time my debugging process goes slow, because each time I have to run emulator. Is there a way which I am missing, or emulator takes more time to run applications. </p>
| android | [4] |
4,057,634 | 4,057,635 | Submitting form results that there is no error to another page | <p>i want to know how to send value form my_name in index.php below to result.php.</p>
<p>below is the php code to check for errors after the input form.
and how to send form results that there is no error to result.php</p>
<p>here is index.php</p>
<pre><code><?php
if ($_POST["_submit_check"]) {
if ($form_er... | php | [2] |
2,330,280 | 2,330,281 | i have a list in my customer.txt how to create a search function to print out the whole customer information using python | <p>Hi i have a list in my customer.txt file:</p>
<pre><code>[1, 'Amin Milani Fard', 'Columbia College', 778]
[33, 'Ali Sulemanji', 'Langara College', 4324442211]
[32, 'Ali Sulemanji', 'Langara College', 4324442211]
[325, 'Ali Sulemanji', 'Langara College', 4324442211]
[2, 'Yuvin Ng','Dougles College',77839922003]
[3, ... | python | [7] |
2,609,575 | 2,609,576 | flatten a list of variable length arrays | <p>how to convert this:</p>
<pre><code>[2, 4, array([ 3.]), array([ 4.]), array([ 5., 4.])]
</code></pre>
<p>to</p>
<pre><code>[2,4,3,4,5,4]
</code></pre>
<p>I've tried searching but the solutions work for</p>
<pre><code>[array([ 2.]), array([ 4.]), array([ 3.]), array([ 4.]), array([ 5., 4.])]
</code></pre>
<p... | python | [7] |
676,939 | 676,940 | Isn't a const variable at namespace scope implicitly static? | <p>I know that <code>static const int x = 42;</code> at namespace scope is equivalent to <code>const int x = 42;</code> because <code>const</code> variables are implicitly <code>static</code> (they must be declared <code>extern</code> to be given external linkage). Every translation unit that includes this declaration... | c++ | [6] |
4,497,455 | 4,497,456 | Check if string contains only combinations of array elements (numbers and words) | <p>I've searched for hours and can't find any example of what I'm trying to do. I can't even figure out what php function needs to be used, but I'm thinking probably a regex. I attempted to use in_array and it didn't work. I don't know enough about regexes to even set up a test. Here's the problem... Say my array is:</... | php | [2] |
2,897,294 | 2,897,295 | How to unload a child user Control that is Loaded on parent control in asp.net | <p>I Am working with user controls in Asp.net.</p>
<p>I am loading a user Control(Usercontro2) in a Control panel of a parent child control (Usercontro1).</p>
<p>Now I want to unload the control on the click of link button of Usercontro2</p>
<p>How can I do it in the Child user control.</p>
| asp.net | [9] |
1,381,978 | 1,381,979 | How to set contact as favourite through coding? | <p>I need to toggle existing android contacts to favourite. I have a toggle button which is suppose to set/unset current contact as favourite.</p>
<p>Any help regarding this is appreciated.</p>
<p>Thanks in advance.</p>
| android | [4] |
532,027 | 532,028 | how to create a package | <p>I just know how to create a package just by declaring it at the top of the class but I dont know the code for creating it </p>
<pre><code>package myPackage;
class test{
system.out.println("Hello every one");
}
</code></pre>
<p>please provide me the code to compile it </p>
| java | [1] |
4,442,943 | 4,442,944 | converting Inline if to if else | <p>I am new to java and i want some help on converting the below inline if java code to if else.</p>
<pre><code>public boolean equals(final Object obj) {
boolean result = true;
if (level != null ? !level.equals(log.level) : log.level != null)
{
result = false;
}
return result;
}
</code><... | java | [1] |
4,766,753 | 4,766,754 | When page is loading, display a image after 5 seconds swap with text | <p>I have a div that has content in it.</p>
<pre><code><section id="latest-news">
<p>Pellentesque habitant morbi
tristique senectus et netus
et malesuada fames ac turpis
egestas.</p>
</section>
</code></pre>
<p>But while the page is loading, I want a loading .gif to appear, wait about ... | jquery | [5] |
4,635,265 | 4,635,266 | Custom Control Event Not Firing First Time | <p>My application runs from a single page (default.aspx) and loads custom controls based on what the user selects (this is done in the LoadPage event). </p>
<p>The problem is that the FIRST time some new controls are loaded onto the page and a button is clicked, the page is NOT firing the Click event. This also happen... | asp.net | [9] |
2,161,266 | 2,161,267 | How do I make a Home Screen Application not be recreated when pressing the home button | <p>Pardon my dodgy explanation in the title. What happens is: I'm trying to make a home screen application. So far so good, I made the app launcher that launches an application when executed. But, if for example I press the home screen to be taken back to my application, instead of continuing the activity from onResume... | android | [4] |
3,585,315 | 3,585,316 | add autoplay in this piece of code? | <pre><code>$(document).ready(function() {
$('a.link').click(function () {
$('#wrapper').scrollTo($(this).attr('href'), 200);
setPosition($(this).attr('href'), '#cloud1', '0px', '5px', '20px', '30px')
setPosition($(this).attr('href'), '#cloud2', '0px', '100px', '200px', '400px')
... | javascript | [3] |
3,441,702 | 3,441,703 | How to instantiate a generic type object in C#? | <p>I have class like this:</p>
<pre><code>public ClassA<T> where T : class{
...
}
</code></pre>
<p>Now I need to to create an object of ClassA in the constructor of ClassB:</p>
<pre><code>public ClassB{
public ClassA<?> objA;
public ClassB(string TypeInfo){
objA = new ClassA<?>(... | c# | [0] |
5,771,786 | 5,771,787 | Update Application Feature in Android | <p>I want to put update application feature in android.
can anyone tell me how to achive this functionality..?</p>
<p>thanks for reading</p>
| android | [4] |
5,755,250 | 5,755,251 | Fade (reduce opacity) image with jQuery only while mouse over | <p>I want to turn the opacity of the image to half when it is hovered (and return it to normal when the cursor is not hovering any more).</p>
<p>I only succeed in making all the images <code>fadeTo</code>, but when the mouse is out the images still faded (and all the images fade. I just one the image under the cursor ... | jquery | [5] |
3,953,565 | 3,953,566 | How to handle session? When do we create a session id | <p>Hi all im facing a problem, and i need suggestion from the experts out here.
There is Shopping cart module in my project that uses webservice .The workflow is </p>
<ol>
<li>Create session Id.( I have an xml input which returns me a long string as session id)</li>
<li>Add Product to cart ( WHere i use the above ses... | android | [4] |
583,614 | 583,615 | Looking for C# HTTP Component/Class | <p>I know HTTPRequest and Response are available, but I am looking for a HTTP component/class wrapper that I can plug straight into code with less hassle.</p>
<p>Are there any free or paid components/classes like this?</p>
| c# | [0] |
5,334,398 | 5,334,399 | Use method from another class on ArrayList with foreach loop? | <pre><code>public void verschuif1(){
for(Object x : puntenLijst){
x.verschuif2(3, 3);
}
}
</code></pre>
<p>puntenLijst is an ArrayList of object instances from another class.
Now I tried to do something with a foreach loop that loops through all objects in the ArrayList and uses the method verschuif2()... | java | [1] |
2,887,630 | 2,887,631 | plugin to indicate a form element value has been changed | <p>A date selection HTML form section contains two drop downs - one for the day of the month, the other for the month.</p>
<p>When selecting an invalid date such as 31st February, the day value is automatically updated to be valid (29th in the case of this form).</p>
<p>I would like to unobtrusively highlight this au... | jquery | [5] |
3,142,751 | 3,142,752 | a simple php logic | <p>I just saw this source code on a website, but I don't know what it means, can anyone tell me what it is? thank you so much.</p>
<pre><code>private function buildCache()
{
!empty($this->cache_list) && $this->cache->loadCache($this->cache_list);
}
</code></pre>
| php | [2] |
5,818,581 | 5,818,582 | Cookies are not removing on Log Out | <p>I've got a problem, user can't Log Out because the $_COOKIE's are not actually deleting. I can't find out what could be the problem.</p>
<p>This code is used only once at Log In:</p>
<pre><code>// Log In
$_SESSION['user_id'] = $row['user_id'];
$_SESSION['username'] = $row['username'];
setcookie('user_id', $row['us... | php | [2] |
2,894,020 | 2,894,021 | is it possible to read contents of a div from another html using jquery? | <p>im trying to read the contents of myDiv which resides in a separate html file and do some appending in the current page,is this possible? i know there is load(), but it displays the whole html as it is.</p>
<pre><code>$( ".myDiv" ).each(function(){
//do stuff
});
</code></pre>
<p>i have tried $('#result').load('... | jquery | [5] |
3,357,052 | 3,357,053 | Why is this 3n+1 saying that my submission is wrong? | <p>I am trying to solve the famous 3m+1 problem. Using this source code, I don't know why I'm getting wrong answer :/ Although, if I run it , it works fine.</p>
<pre><code>#include <iostream>
using namespace std;
long int cycle(long int,long int);
int main()
{
long int i=0, j=0;
while (cin >> i &... | c++ | [6] |
394,545 | 394,546 | Extract first match from a string of text? | <p>Say I have the following string:</p>
<blockquote>
<p>hello my car is red and my shoe is blue</p>
</blockquote>
<p>I want to match the following words:</p>
<blockquote>
<p>blue, red, orange, purple</p>
</blockquote>
<p>So it searches the variable for those 4 words, and returns the first one - in my example th... | php | [2] |
875,630 | 875,631 | Parsing an image with JAI | <p>I use JAI, because I want to work with a tif. I read the image into a PlanarImage</p>
<p>The whole problem:
Now I have to do some calculations on this image. First I have to read the RGB values, then do some calculations on blocks with 16x16 pixels.</p>
<p>What's the best way to do this?</p>
<p>Does anyone have a... | java | [1] |
2,568,383 | 2,568,384 | android : how to send NFC data from dialogfragment? | <p>I have a question.
I want to send NFC data at DialogFragment <- it is show AlertDialog</p>
<pre><code>public static class XDialogFragment extends DialogFragment {
...
@Override
public void onAttach(Activity activity) {
// TODO Auto-generated method stub
NfcAdapter nfcAdapter = NfcAdapter.... | android | [4] |
3,177,207 | 3,177,208 | How to compress viewstate | <p>when i click on asp buttons it is giving me error as "The state information is invalid for this page and might be corrupted."</p>
<p>on searching for this error,someone told me that viewstate is storing large amount of data.</p>
<p>so i want to compress the viewstate.
can anybody tell me how to compress the viewst... | asp.net | [9] |
3,936,916 | 3,936,917 | in php i need one line if condition for time compare | <p>i have to value</p>
<pre><code> $mo=strtotime($input_array['MondayOpen']);
$mc=strtotime($input_array['MondayClose']);
</code></pre>
<p>now i need a if condition to display an error on below conditions</p>
<ol>
<li>if one of them($mo or $mc) are empty, null or blank.</li>
<li>if close time($mc) is less than open... | php | [2] |
3,182,173 | 3,182,174 | Load function doesn't work with IE | <p>I can't get load function to work with IE. In Google Chrome my website runs fine.
I tried to fix the issue with "no-cache" strategy, but no luck. What else should i do to make it work with IE?</p>
<p>Source:</p>
<pre><code><meta http-equiv="Cache-control" content="no-cache">
<script type="text/javascript"... | jquery | [5] |
4,127,800 | 4,127,801 | Python why variable and return show difference value from print variable? | <pre><code>>>> pkt = sniff(count=2,filter="tcp")
>>> raw = pkt[1].sprintf('%Padding.load%')
>>> raw
"'\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00g\\xc4|\\x00\\x00\\x00\\x00\\x00'"
>>> print raw
'\x04\x00\x00\x00\x00\x00\x00\x00g\xc4|\x00\x00\x00\x00\x00'
</code></pre>
<p>Raw yield d... | python | [7] |
1,527,745 | 1,527,746 | Does Tail Recursion will be optimize in php | <p>by this question:
<a href="http://stackoverflow.com/questions/6171807/does-php-optimize-tail-recursion">Does PHP optimize tail recursion?</a></p>
<p>php will not optimize the tail recursion</p>
<p>but i try in my machine, (php 5.3.10)</p>
<p>two programe for fibonacci, one is normal recursion but another is tail ... | php | [2] |
4,685,218 | 4,685,219 | Cannot use greater key-length than 8 bits in DESEngine | <p>I'm doing a project where I need to use DESEngine. I'm unable to use a key length of more than 8 bits. Is it possible to use a greater key-length?</p>
| java | [1] |
594,463 | 594,464 | Ads reducing by more than half on Iphone? | <p>For some odd season, the Ads, either IADs, or from ADmob not showing as often as it used to on my apps on IPhone. </p>
<p>The number dropped by more than half. </p>
<p>Obviously my revenue is tanking result of that,</p>
<p>what could go wrong?</p>
| iphone | [8] |
3,768,103 | 3,768,104 | Exporting grid to excel | <p>I used this code for exploring grid to excel.I got this code from net.</p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.xls");
Response.Charset = "";
Response.ContentType ... | asp.net | [9] |
4,606,164 | 4,606,165 | Application compatibility between versions | <p>I can run my application on 1.5, 1.6 and 2.0 emulator and on a 1.5 device without any problems. But some of my users are reporting force close and strange menu entries (see the attachment) using 1.6 and higher version devices. Any ideas?</p>
<p><img src="http://taypo.com/00.png" alt="alt text"></p>
<p>This screen ... | android | [4] |
5,608,331 | 5,608,332 | How do I rewrite binary data in Java | <p>I'm trying to figure out how to replace binary data using Java.
below is a PHP example of replacing "foo" to "bar" from a swf file.</p>
<pre><code><?php
$fp = fopen("binary.swf","rb");
$size = filesize("binary.swf");
$search = bin2hex("foo");
$replace = bin2hex("bar");
$data = fread($fp, $size);
$data16 = bin2he... | java | [1] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.