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,796,939
3,796,940
C# checkbox
<p>I have 3 check boxes in each row of 8 total rows. I want to have the third checkbox in each row to get checked only when the first two checkboxes are unchecked. I do not want to write a checkRow() method for each row.</p> <p>What is the best way to go about it?</p> <pre><code>private void checkRow() { for (int...
c#
[0]
3,046,631
3,046,632
How to hide a View programmatically?
<p>In my application, I have 2 <code>LinearLayout</code>'s right above each other. Via a menu option, I want to be able to make the bottom one disappear, and have the top one drop down over the disappeared <code>LinearLayout</code>...</p> <p>The problem is, I have no idea on how to do this in Java.</p> <p>It doesn't ...
android
[4]
2,133,793
2,133,794
Is it possible to create div throwing into another div
<p>Using jquery, can we create option like throwing one div to another div area(similar to drag and drop).</p> <p>Based on throwing direction, div need to shift to other div.</p> <p>Because, i need to keep 2 set of div group in the site's left and right side bars.</p> <p>if i use drag and drop, some time its taking ...
jquery
[5]
5,579,630
5,579,631
accessing objects, static variables in PHP
<p>Here's my code:</p> <pre><code>class Photograph extends DatabaseObject { protected static $table_name="photographs"; protected static $db_fields=array('id', 'filename', 'type', 'size', 'caption','album_id'); public $id; public $filename; public $type; public $size; public $caption; ...
php
[2]
3,969,179
3,969,180
How to return to main activity after being three activities down?
<p>My app has four activities; MainActivity, ListActivity1 (L1) , ListActivity2 (L2), ListActivity3 (L3). From Main, the user goes down to L1 by clicking a button. After selecting an item in L1, user comes to L2 and then L3 after selecting an item in L2. In L3, when selecting an item a Yes/No-toast is launched. If user...
android
[4]
3,510,844
3,510,845
more space appears between spinner and EditTExt
<p><br> I am writing an android where I need to display Spinner and EditText . I am using LinearLayout with vertical orientation. I am getting lot of space between spinner and EditText. Can anyone help me in sorting out this issue. <br> Thanks in Advanvce</p>
android
[4]
3,469,480
3,469,481
What is the preferred syntax for initializing a dict?
<p>I'm putting in some effort to learn Python, and I am paying close attention to common coding standards. This may seem like a pointlessly nit-picky question, but I am trying to focus on best-practices as I learn, so I don't have to unlearn any 'bad' habits.</p> <p>I see two common methods for initializing a dict:</...
python
[7]
115,791
115,792
missing argument in php function?
<p>Ok no i am calling a few variables from mysql database and they are not static i not that good but if i call a function like</p> <pre><code>$var = 'hi'; function fun($var){ $var; } </code></pre> <p>now it will be correct and display the result but if i call multiple variables from mysql database then it ...
php
[2]
5,458,814
5,458,815
DataTable Select
<p>How can I use Select method of a DataTable just to fetch UserNames starting with 'M'. Lets assume that UserNameTextBox has a string <strong>M</strong></p> <pre><code>oDataTable.Select("UserName = '" + UserNameTextBox.Text + "'"); DataView oDataView = oDataTable.DefaultView; oDataView.Sort = "UserName"; UserGridView...
asp.net
[9]
1,487,773
1,487,774
How to make a function reference with the 'this' keyword
<p>I'm creating a small tooltip application and I'm having trouble. I'm trying to add an event to the document, but am having trouble referencing the function that needs to be executed. Here is the code:</p> <pre><code>var Note, note; (function () { 'use strict'; // Helper functions function addEvent(to, ...
javascript
[3]
4,157,323
4,157,324
Word Counter in java
<p>The initial problem is to read a text file from a user, and print a histogram of its word Sizes. My initial Code is Below but its not working. Please Help!!</p> <pre><code>import java.util.Scanner; import java.io.*; public class wordCounter { public static final int Size = 15; public static void main(S...
java
[1]
5,459,484
5,459,485
Allow only numbers to be typed in a textbox
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/995183/how-to-allow-only-numeric-0-9-in-html-inputbox-using-jquery">How to allow only numeric (0-9) in HTML inputbox using jQuery?</a> </p> </blockquote> <p>How to allow only numbers to be written in this textb...
javascript
[3]
351,254
351,255
Using templates of the wizard control
<p>I learnt that Template allows us to customize the look of the control. I am practicing wizard control and trying to use template to control it's look. And it has following Templates available for customization:</p> <ul> <li>HeaderTemplate</li> <li>SideBarTemplate</li> <li>StartNavigationTemplate </li> <li>StepNavi...
asp.net
[9]
3,189,865
3,189,866
Can I link multiple .lib in C++
<p>If I have a library "a.lib" that I include in project B, then I generate B.lib. Then in a 3rd project if I want to use funtions from library a is it sufficient to include B.lib? or do I need to include a.lib also? </p> <p>So basically by addind a.lib to the LIBS path of project b does it link into b.lib automatic...
c++
[6]
5,585,473
5,585,474
C++ Converting Vector items to single String Error?
<p>So I have a function, where <code>KaylesPosition</code> is a class with a <code>vector&lt;int&gt;</code> called <code>piles</code>:</p> <pre><code>// Produces a key to compare itself to equivalent positions std::string KaylesPosition::makeKey(){ std::vector&lt;int&gt; temp(piles.size()); for (int i = 0;i&l...
c++
[6]
4,543,975
4,543,976
Alarm manager triggered too many times
<p>I have a problem regarding Alarm manager in Android. I have the following code snippet to set an alarm that should be fired each week(once).</p> <pre><code> // Add the time and set when the notification will be triggered Calendar setCalendar = item.getDate(); calendar.set(Calendar.MINUTE,setCalendar.get(Ca...
android
[4]
4,913,128
4,913,129
Why this HashMap.get return a null?
<p>I am inserting the values into <code>HashMap</code> like this</p> <pre><code>String group_name[]=group_names.split(","); String group_ids[]=new_groups.split(","); Hashtable&lt;Integer,String&gt; hm=new Hashtable&lt;Integer,String&gt;(10); for(int i=0;i&lt;group_ids.length;i++){ if (group_ids[i]!=null &amp;&amp;...
java
[1]
2,397,979
2,397,980
How to show validation control's Error messages in Alert box?
<p>I am using 4 required field validators,4 regular expression validators and 4 compare validators for 4 text boxes.Is it possible to show error messages</p> <p>in an alert or message box when validation fails?</p> <p>If possible please send code sample.</p> <p>Regards,</p> <p>NSJ</p>
asp.net
[9]
3,807,386
3,807,387
Disabling "Force Stop" Button in Android
<p>Okay, I'm pretty sure that this is not possible but a client had asked me to do so in one of our Android application we developed for her.</p> <p>What she had wanted is that if our application is running, and user navigate to:</p> <pre><code> Settings &gt; Manage Application &gt; [Our Application] </code></pre> <...
android
[4]
760,295
760,296
How to work with $_SERVER['QUERY_STRING']
<p>How to work with $_SERVER['QUERY_STRING'] and pagination?</p> <p>When my table is sorted by this link:</p> <pre><code>&lt;a href="'.$_SERVER['PHP_SELF'].'?sort_name=name&amp;sort=asc" title="'.$lang['sorteer_asc'].'"&gt;&lt;/a&gt; </code></pre> <p>My url becomes: relation.php?sort_name=adres&amp;sort=asc</p> <p>...
php
[2]
367,299
367,300
What is wrong with this usage of the new operator?
<p>Is this allowed?</p> <pre><code>Object::Object() { new (this) Object(0, NULL); } </code></pre>
c++
[6]
5,427,602
5,427,603
How to replace every char in a string value with the next char?
<p>If I have a string variable like this:</p> <pre><code>string f = "ABC"; </code></pre> <p>I want to make it like this:</p> <pre><code>f="CDE" </code></pre> <p>This means that I want to take every char in this string and increase it to the next 2 values, if I have 'a' I want to change it to 'c' and so on.</p>
c#
[0]
2,652,592
2,652,593
Java - how to clear message after display in view
<p>I want display error message in my view <code>home.jsp</code> using <code>&lt;c:out value="${message}" /&gt;</code>. But after displaying it, I want to clear it. any idea?</p>
java
[1]
1,702,706
1,702,707
Post some values to Php and store in database using HTTP, stores empty values only
<p>I have tried to send some values to Php file in server using Http post...It store only empty values in Fields of my mysql database....please help me...</p> <p><strong>My Android coding:</strong></p> <pre><code>private void sendValues() { List&lt;NameValuePair&gt; data= new ArrayLi...
android
[4]
4,716,319
4,716,320
Turn on/off gprs code
<p>Hi i am working on an application that need to turn on/off the gprs via code. I am using this methord to check if connection is On/Off. But i have no idea how to turn on gprs if it is off</p> <p>code</p> <pre><code>NetworkInfo i = conMgr.getActiveNetworkInfo(); if (i == null) return false; if (!i.isConnect...
android
[4]
1,602,674
1,602,675
User-Defined Form Creation
<p>We have a custom written on-line job application... application. HR is requesting a "skill sheet" added to the application. While we have yet to work with them to determine what all this could entail, I am starting to research if this is even feasible. </p> <p>At this point I am envisioning something similar to som...
c#
[0]
571,822
571,823
How to know if a particular application is currently running?
<p>I am trying to build an application that can detect if the Messaging application is currently running so I can foreground one of my activity to prompt the user for a password. <br></p> <p>What I have done: <br> 1)Created a service that starts running after startup.<br></p> <p>Now, what is confusing me:<br></p> <p...
android
[4]
992,334
992,335
Search directory for a directory with certain files?
<p>I'd like to search a folder recursively for folders containing files names "x.txt" and "y.txt". For example, if it's given <code>/path/to/folder</code>, and <code>/path/to/folder/one/two/three/four/x.txt</code> and <code>/path/to/folder/one/two/three/four/y.txt</code> exist, it should return a list with the item <co...
python
[7]
786,864
786,865
Deleting a row from the database based on id from while loop
<p>I have a while loop that pops out all of my blog posts. Along with these blog posts it puts up a button beside each one with a red x that when I click it I want it to delete the post next to it. The problem? I haven't come up with an effective way for it decide which post to delete. It usually either deletes the pos...
php
[2]
2,372,154
2,372,155
Access to the elements of parent form from child in MDI
<p>The problem is that i need to access different forms elements from other forms, or for example access MdiContainer form menu from some child windows and do some operations with it. How to correctly implement such feature? I'm using Windows Forms now.</p> <p>Some sample code below to demonstrate how I tried to do it...
c#
[0]
2,966,370
2,966,371
Element's position().top does not change after scroll - how to get the new position?
<p>I need to get an element's (a div) position (position().top) when the user scrolls the window. The problem is that when I call position().top to get the new position after scrolling, it's got the same value as before scrolling. Here's a bit of code:</p> <pre><code>$('document').ready(function() { alert($('#my-...
jquery
[5]
3,134,946
3,134,947
How to get authentication to access google services with android?
<p>In my application I am interfacing with google services such as calendar and documents. For testing I have just been providing a user name and password to access services as follows...</p> <pre><code>myService.setUserCredentials(username,password); </code></pre> <p>This method, at least how I'm implementing it, r...
android
[4]
2,727,833
2,727,834
Beginner Java question about instance variables
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/5747973/does-this-have-any-advantage">Does &ldquo;this&rdquo; have any advantage?</a><br> <a href="http://stackoverflow.com/questions/132777/do-you-prefix-your-instance-variable-with-this-in-java">Do you prefix y...
java
[1]
2,984,365
2,984,366
Android Font Recognition API
<p>I'm planning to develop an android font recognition app for my final year project. are there any free APIs that I can use for this process of image recognition. (looking for an API which will take the image as an input and output the name of the font or something similar) please suggest me a solution, I'm new to the...
android
[4]
692,807
692,808
Detect from browser if a specific application is installed in Android
<p>I'm looking for a way to find out if a specific application is installed from a client-side web browser. The platform is Android.</p>
android
[4]
4,921,726
4,921,727
Need help to understand a project in new domain
<p>I need to work on s&amp;op domain. As I am very new to this domain, and there was no documentation provided for the project. How can I proceed further to understand the domain and project. That project was built on very older technologies like ejb 2.x javascript, normal jsp pages. What can I do to get the most out o...
java
[1]
3,537,494
3,537,495
Which for loop is faster in java and why
<p>From the following for loops, which one is faster in java</p> <pre><code> 1. for(int i = 100000; i &gt; 0; i--) {} 2. for(int i = 1; i &lt; 100001; i++) {} </code></pre> <p>Please provide the valuable reason for the speed. This really helps me in improving the performance of my application.</p>
java
[1]
3,877,449
3,877,450
noSuchMethod in globally defined functions
<p>I am aware of <code>__noSuchMethod__</code> but I'm not sure how to get this for functions that are called like this.</p> <pre><code>someThing(); </code></pre> <p>For example I am aware I can do this</p> <pre><code>var global = Function('return this')(); global.__noSuchMethod__ = function(id, args) { console.lo...
javascript
[3]
1,605,095
1,605,096
java.lang.OutOfMemoryError how to fix this
<p>i found a code but sometimes have error :</p> <pre><code>StringBuilder strHeaders = new StringBuilder(); char c; while ((c = (char)stream.read()) != -1) { strHeaders.append(c); if (strHeaders.length() &gt; 5 &amp;&amp; (strHeaders.substring((strHeaders.length() - 4), strHeaders.length()).equals("\r\n\r\n"))...
android
[4]
722,124
722,125
only load contents within body using ajax - jquery
<p>I want to load only the contents of the <strong>body</strong> of a page(sample.html) and append it to body of another page(index.html) .. how can this be done..sorry i'm a noob</p> <p>I used the below code .. but this doesn't seem to work properly</p> <pre><code>$.ajax({ url: "/site/pages/sample.html", suc...
jquery
[5]
5,671,745
5,671,746
trying to make a Class
<p>I am trying to make this work myClass.student[x].books[z].<br> For each student I need to collect a name and a array of strings(books).</p> <pre><code>public class myClass { public student[] batch; } public class student { public books[] ; public string naam{ get; set; } } </code></pre>
c#
[0]
3,504,917
3,504,918
Java - System.currentTimeMillis(); Not Returning Difference
<p>For some reason I am getting a consistent 3600 returned by the function:</p> <pre><code>private static long getCountdownLeft() { long now = System.currentTimeMillis(); long elapsedMillis = now - initialTime; //difference of current 'current' time long millisLeft = secondsOfGame * 1000 - elapsedMillis; ...
java
[1]
1,184,780
1,184,781
Need help with google voice on my motarola cliq
<p>I have a google voice number. I made a call from my computer. And from reading the instructions,I figure I have to have the app on my phone (motarola cliq). But I went to the m.google.com website,and it gives me a option to download it from the market. But there are no results for google voice in the market. I got t...
android
[4]
2,626,881
2,626,882
How to create a 2D Map to use in a Android Game?
<p>I'm looking for a program that make a 2D map to use in a Android Game, if there is, and how I can import this map (that can be in what format? .bin, .fmx?) to my game. I was reading about the Tiled Map Editor, that has files XML with extension .tmx(?) and I wanna to know - the las t question -, if I can use with th...
android
[4]
828,997
828,998
Android custom keyboard shift key
<p>How can i implement the shift key functionality for android custom keyboard, i want to change the keys from caps to small and small to caps while clicking the shift key, for me it is coming but while typing the messages texts are only in smalls, and also i need separate background for each key, for this purpose me i...
android
[4]
5,129,856
5,129,857
Problem with KeyPress Javascript function
<p>I call a javascript function from a textbox by using OnKeyPress="clickSearchButton()"</p> <p>Here is my function:</p> <pre><code>function clickSearchButton() { var code = e.keyCode || e.which; var btnSearch = document.getElementById("TopSubBanner1_SearchSite1_btnSearchSite"); if(code == 13); { ...
javascript
[3]
2,498,026
2,498,027
microsoft report viewer print button missing in mozilla
<p>I am developing a web application and using using rdlc reports. when i preview report in report viewer print button missing in mozilla, it is displayed in IE but prb with mozilla. can you please let me know any plugin or something for mozilla.</p>
asp.net
[9]
2,064,725
2,064,726
Disable mouse click when out of div
<p>Hi i have a div of a form. i want that disable click event when mouse is out of the div. So i tried this but it is not working ot of div is still clickable. Any idea??</p> <pre><code>var flag = false; $("#foo").live("mouseenter",function(){ flag = true; }).live("mouseleave",function(){ flag = false; }) $(d...
jquery
[5]
5,051,299
5,051,300
Action bar sherlock error - Android
<p>I've created an Action Bar Sherlock library project, I've added that library to my project.</p> <p>I get the error:</p> <pre><code>R cannot be resolved to a variable </code></pre> <p>Im using min sdk 7, target sdk 15.</p> <p>I've cleaned the project and all of my projects in eclipse.</p> <p>I've restarted eclip...
android
[4]
3,621,188
3,621,189
100% cpu because of this thread java
<p>i have just attempted to add something to my game where if one player is hit by a bullet his health goes down. problem is when i am checking for this, CPU is at 100% and everything sooo laggy. This is a problem. here is the thread i am using:</p> <pre><code> package Graphics; import java.util.logging.Level; impo...
java
[1]
4,005,438
4,005,439
Updating text node using jquery
<p>I have this html:</p> <pre><code>&lt;span class="msg-container"&gt; &lt;span class="msg"&gt;&lt;/span&gt; A message here &lt;/span&gt; </code></pre> <p>I'm wanting to use jQuery to find all the msg-container elements, take the "A message here" text and set the title attribute and remove the "A message here" te...
jquery
[5]
2,125,596
2,125,597
Compile Error CS0305
<p>I'm new to C# programming and have hit a snag I cannot get past.</p> <p>I'm getting this compile error:</p> <blockquote> <p>CS0305: Using the generic type 'System.Collections.Generic.IEnumerable' reuires 1 type arguments</p> </blockquote> <p>with this code;</p> <pre><code>class Program { static voi...
c#
[0]
439,356
439,357
why does the class_exists function return false?
<p>In the following script I check the <code>class_exists</code> function. What is the scope of this function ? It returns <code>false</code> for this script when I test for this class.</p> <pre><code>&lt;?php namespace my; class Tester { public function check() { $classname = 'Tester'; if(cl...
php
[2]
1,063,311
1,063,312
jQuery .live() issue
<p>I have an ordered list, and each item has a link with class "additem" to add another item to the list. In order to make the add item links in the newly added items work, I used .live(), like this:</p> <pre><code>function pageFunctions() { $('a.additem').click(function() { $('&lt;li&gt;'+trackli+'&lt;/...
jquery
[5]
5,117,455
5,117,456
Rolling or sliding window iterator in Python
<p>I need a rolling window (aka sliding window) iterable over a sequence/iterator/generator. Default Python iteration can be considered a special case, where the window length is 1. I'm currently using the following code. Does anyone have a more Pythonic, less verbose, or more efficient method for doing this?</p> <...
python
[7]
4,353,584
4,353,585
NotImplementedException on android
<p>is there something similar to the NotImplementedException on the android platform?</p> <p>thanks!</p>
android
[4]
2,953,366
2,953,367
Calculate percentage wise stats using C sharp?
<p>i want to find the stats that will calculate percentage and give results in following format : WX GSA search % = GSA occurrences / GSA occurrences + Search occurrences + ADVSearch occurrences * 100 i.e. in this case it should give like : 3 / 3 + 2 + 2 * 100 = 42.8</p> <p>I have tried code that will give occurrenc...
c#
[0]
3,228,487
3,228,488
Multiple classes in one .cpp file
<p>I was wondering if it is considered bad practice to have multiple classes in one .cpp file. I have a background in Objective-C, where this is rarely done.</p>
c++
[6]
2,668,736
2,668,737
jQuery: delegating clicks to elements that contain other elements
<p>So i get the gist of $.delegate and I know why it's doing what it's doing, but I'm wondering if there is a work around.</p> <p>I have link elements that contain spans like so:</p> <pre><code>&lt;a href='#'&gt; &lt;span&gt;Person Name&lt;/span&gt; &lt;span&gt;Person Info&lt;/span&gt; &lt;/a&gt; </code></pre...
jquery
[5]
1,288,345
1,288,346
java.lang.UnsupportedClassVersionError:
<p>I have developed a small project in eclipse which makes use of Java6. But I want to run the same project in hpux system which has java1.5. When I try to run it is throwing the error : </p> <blockquote> <p>java.lang.UnsupportedClassVersionError:. </p> </blockquote> <p>Then I have changed the eclipse Java compiler...
java
[1]
4,243,835
4,243,836
Play sound when receiving a web chat message
<p>How can I add simple sound when a message arrives in a web chat session with jQuery?</p> <p>I noticed that they do it on the chat at <a href="http://chat.stackoverflow.com">http://chat.stackoverflow.com</a> and I want to emulate that in my own software.</p>
jquery
[5]
2,482,751
2,482,752
Macros to disallow class copy and assignment. Google -vs- Qt
<p>To disallow copying or assigning a class it's common practice to make the copy constructor and assignment operator private. Both Google and Qt have macros to make this easy and visible. These macros are:</p> <p>Google:</p> <pre><code>#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&amp;); ...
c++
[6]
2,335,936
2,335,937
How to tell which control a contextmenustip is associated with?
<p>I have two labels one lblEmail1 and two lblEmal2 each has the same context menu strip associated with it. The contextmenustip has one menu item which is "Send Email" when I right click on either label and you select "Send Email" it goes to the same function to process the request which would be to take the value lbl...
c#
[0]
3,748,872
3,748,873
Is there any way to refresh a tab in Android?
<p>I have two tabs. When I change a value in the first tab, another value in the second tab also should change depending on the change in the first tab. How to do it?. Please help at the earliest?. Or Is it possible to load the second tab once more.. any refreshment mechanism?</p>
android
[4]
1,784,727
1,784,728
jQuery load, can see the div in the source code but it is not being displayed
<p>I'm using jQuery's load function to load an error message if an ajax request fails into a div. I can see the div with the loaded contents in my source code but it's not showing up on the page. Any idea what's going on?</p> <pre><code>$(function() { $(".submit").click(function() { var element = $(this); ...
jquery
[5]
847,381
847,382
Can someone explain this source code for balanced partitioning?
<p>Can someone please explain this code in detail? I've tried debugging it but i can't figure out how it produces the result. I've been searching for a solution for the problem and this is the code that I stumbled upon, it produces accurate solutions and I would like to know how it works. Many thanks.</p> <pre><code>#...
c++
[6]
2,383,145
2,383,146
Truncate array items to the first five characters with jQuery?
<p>A plugin I use on my site generates an array in this style:</p> <pre><code>&lt;script type="text/javascript"&gt; window.slideDetails = [ //Slide1 "C1BP7: user information", "FJAD7: user information", "FFAD7: user information", //Slide2 "C0AE7: user information", "C7AZ7: user info...
jquery
[5]
5,174,794
5,174,795
How to resolve the error this bundle is invalid when i validated the app
<p>I got the error when I validate the app</p> <p>This bundle is invalid. The value of the CFBundleDocumentTypes key in the info.plist must be an array of dictionaries, with each dictionary containing at least the CFBundleTypeName key</p>
iphone
[8]
4,010,596
4,010,597
How to make javac squawk for incorrect package names in Java source files
<p>Today, I ran into a java source file that had a typo in the 'package' statement at the top. The name of the package did not match the name of the directory the file was sitting in (one extra 's' at the end).</p> <p>To my surprise, javac from 1.6, checkstyle, and pmd all passed the file as OK. The only tool that got...
java
[1]
5,658,365
5,658,366
C# Dice application, with die images
<p>The question: Create an application that simulates rolling a pair of dice. When the user clicks a button, the application should generate two random numbers, each in the range of 1 through 6, to represent the value of the dice. Use PictureBox controls to display the dice.</p> <p>I currently have 6 picture boxes wit...
c#
[0]
4,311,508
4,311,509
measuring latency time betwen two udp packets and then sending packets over udp based on that latency
<p>Measuring latency time between two packets of a pcap file and then sending over the UDP packet by packet using same latency .</p>
c++
[6]
751,037
751,038
Extension method for python built-in types!
<p>is it possible to add extension method to python built-in types? I know that I can add extension method to defined type by simply adding new method by . as following:</p> <pre><code>class myClass: pass myClass.myExtensionMethod = lambda self,x:x * 2 z = myClass() print z.myExtensionMethod(10) </code></pre> <p...
python
[7]
2,950,471
2,950,472
regarding tab bar controller
<p>I want to show more tahn four tab bar item on tab bar controller by scrolling tab bar . is it possible in iphone if it is.. please give the exact solution.??</p> <p>Hoping your positive response </p>
iphone
[8]
4,689,142
4,689,143
From which library to include inline List creation?
<p>I find myself re-implementing List creation method. But I'm sure that it is already implemented in some widely used library (if not in java itself). So my question is: Which useful library to include, to get functionality of following code:</p> <pre><code>public static &lt;T&gt; List&lt;T&gt; buildList(T... args) {...
java
[1]
3,321,759
3,321,760
how to rewrite the following code so that i don't have to assign readonly variable in a method only called by constructor?
<p>e.g</p> <pre><code> Class A { readonly Bclass B; readonly Cclass C; public void Class() { Action1(); Action2(); Action3(); } void Action2() { Do...
c#
[0]
5,020,507
5,020,508
Simple Array PHP
<p>Simple array but I am getting an error. Even when create it in its own PHP page I still get an error. I am not experienced at this so be kind.</p> <pre><code>&lt;?php $state = $array(Kentucky, New Mexico, New York, Alabama, Nebraska, Alaska, American Samoa, Arizona, Arkansas, California, Colorado, Connecticut, D...
php
[2]
830,020
830,021
How to add a class to list where there is unordered list child with jquery?
<p>I would like to add a class called "with_ul" to li tags where there is ul under in the following normal list with jquery.</p> <p>In the following case I need to add the class to list of Level 1-B, Level 2-B-1 and Level 1-C since they have an unordered list. </p> <pre><code> &lt;ul id="nav"&gt; &lt;li&gt;Le...
jquery
[5]
3,420,600
3,420,601
[Infinite Loop]Try.. catch with exceptions
<p>So, I`m getting stuck with a method about Scanner, here is the code:</p> <pre><code>import java.util.InputMismatchException; import java.util.Scanner; public class ConsoleReader { Scanner reader; public ConsoleReader() { reader = new Scanner(System.in); //reader.useDelimiter(System.getPro...
java
[1]
5,966,453
5,966,454
Why is infinite loop needed when using threading and a queue in Python
<p>I'm trying to understand how to use threading and I came across this nice example at <a href="http://www.ibm.com/developerworks/aix/library/au-threadingpython/" rel="nofollow">http://www.ibm.com/developerworks/aix/library/au-threadingpython/</a></p> <pre><code> #!/usr/bin/env python import Queue im...
python
[7]
3,703,099
3,703,100
I got errors when I use the MIRACL Cryptographic SDK
<p>In class ECn.h, has the definition:</p> <pre><code>friend BOOL operator==(const ECn&amp; a,const ECn&amp; b) { return epoint_comp(a.p,b.p); } </code></pre> <p>We have defined a ECn as a member of class G2,when defined this statement: </p> <pre><code>friend BOOL operator==(G2&amp; x,G2&amp; y) { if (x.g==y...
c++
[6]
2,689,241
2,689,242
Where should i store "MemberID"?
<p>In my webpage i use FormsAuthentication</p> <pre><code>FormsAuthentication.RedirectFromLoginPage(VisitorEmail, False) </code></pre> <p>Every time the visitor gets authenticated via the login page, i set the </p> <p><code>Session("MemberID") = GetMemberIDByEmail(VisitorEmail)</code> for later processing.</p> <p>S...
asp.net
[9]
3,754,885
3,754,886
How to use jquery.index() when looking for class
<p>I have this simple use of <a href="http://api.jquery.com/index/" rel="nofollow">jquery.index()</a> meant to return the value of an element having a class:</p> <p>The HTML:</p> <pre><code>&lt;ul&gt; &lt;li&gt;foo&lt;/li&gt; &lt;li class='on'&gt;bar&lt;/li&gt; &lt;li&gt;roo&lt;/li&gt; &lt;/ul&gt; </code></pre>...
jquery
[5]
4,131,583
4,131,584
Uncaught TypeError: Object [object Object] has no method (using jQuery based Slider)
<p>On the following <a href="http://sh.betaforming.com/" rel="nofollow"><strong>site</strong></a>, the content slider is not working. I've used this <a href="http://slidesjs.com/" rel="nofollow"><strong>content slider</strong></a> on many other sites. This site is using Twitter Bootstrap (which I'm not familiar with)...
jquery
[5]
5,167,465
5,167,466
Python a fast way to count match in a list
<pre><code>print sum(1 for x in alist if x[1] == 8) </code></pre> <p>This code runs fine, but it is so slow. Is there a way better than this. Because, my list is very large and the computation takes a lot of time. Do you know a better and faster way to do it?</p>
python
[7]
4,784,415
4,784,416
Am I taking a risk if I give a distributor an unsigned apk?
<p>A distributor is asking for an unsigned version of my app's apk. Is there some security risk I am taking if I give it to him? I'm not really sure of the purpose of the signature.</p>
android
[4]
6,019,801
6,019,802
How do we modify the source of original Java classes?
<p>Hi all I was wondering if I could modify and recompile a Java base class?</p> <p>I would like to add functions to existing classes and be able to call these functions.</p> <p>For example, I would like to add a function to <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html" rel="nofollow">java....
java
[1]
2,961,409
2,961,410
Sett scope on javascript function call
<p>I want to call a javascript function within a protected scope and i can do it this way </p> <pre><code>var a = "Global a"; ( function() { var a = "Local a"; var alertA = function() { alert(a); } alertA(); })(); </code></pre> <p>This alerts "Local a" butt what i realy would like to do is to...
javascript
[3]
3,324,013
3,324,014
jQuery current element index if has class
<p>so my code generates like this (when click a it adds active class to current):</p> <pre><code>&lt;div&gt; &lt;a href="#"&gt;&lt;/a&gt; &lt;a href="#"&gt;&lt;/a&gt; &lt;a href="#" class="active"&gt;&lt;/a&gt; &lt;a href="#"&gt;&lt;/a&gt; ... &lt;/div&gt; </code></pre> <p>how can I grab active a tags index?</p>
jquery
[5]
416,971
416,972
android youtube upload using intent
<pre><code>Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); intent.setType("video/3gpp"); intent.putExtra(Intent.EXTRA_STREAM, videoURI); startActivity(Intent.createChooser(intent,"Upload video via:")); </code></pre> <p>I used above code to upload 3gp video to youtube by firing intent</p> <p>but i...
android
[4]
3,307,318
3,307,319
Conditional compilation in python
<p>Hi I am trying to implement conditional compilation in python similar to <a href="http://ideone.com/ttndK" rel="nofollow">this in C</a>,I have seen <a href="http://stackoverflow.com/questions/560040/conditional-compilation-in-python">this thread</a> and <a href="http://stackoverflow.com/questions/3496592/conditional...
python
[7]
2,224,525
2,224,526
Split url with javascript
<p>I'm trying to split following url:</p> <p><a href="http://www.store.com/products.aspx/Books/The-happy-donkey" rel="nofollow">http://www.store.com/products.aspx/Books/The-happy-donkey</a></p> <p>in order to get only <a href="http://www.store.com/products.aspx" rel="nofollow">http://www.store.com/products.aspx</a></...
javascript
[3]
765,243
765,244
How to Capture and Set a Webpage as Live WallPapaer within Wallpaper Service And Engine
<p>I want to capture a web page from any website like "www.google.com" and then i want to convert that web page in a bitmap image and then set that bitmap image like "google.jpeg" as live wallpaper.. please help me..</p> <p>i have tried to get input stream of a web page and then i want to convert it in bitmap and save...
android
[4]
1,926,693
1,926,694
Small need help for Jquery image gallery modification
<p>I am using this image gallery in my project. need the effect of hover. But there is an issue when user clicks on that image it opens the image in a new window. How can i prevent that.</p> <p>Here is the <a href="http://www.catswhocode.com/blog/how-to-create-a-fancy-image-gallery-with-jquery" rel="nofollow">code sam...
jquery
[5]
2,135,788
2,135,789
js slider - how to set up handle to negative margin?
<p>Take a look here: <a href="http://jsfiddle.net/ELKHq/" rel="nofollow">http://jsfiddle.net/ELKHq/</a>, now I would like to set up minimum to for example <code>-50px</code> and also I would like get opportunity to move handler a little next to parent div (<code>#szyna</code>) from the right side... I <strong>must</str...
javascript
[3]
5,079,989
5,079,990
How to do this on one line?
<p>I am looking at tidying up this a bit but I'm kind of new to C#</p> <pre><code>ResponseList responsesList = new ResponseList(); PagedResponseList pagedResponsesList = new PagedResponseList(); responsesList = responseService.ListSurveyResponses(1000); pagedResponsesList = responsesList.ResultData; </code></pre> <p>...
c#
[0]
1,834,360
1,834,361
Merge DataTables in C#
<p>I have two DataTables in an ASP.NET application written in C# (dtA and dtB). The both get filled from textboxes from user input. Each of them will only have one datarow at a time. For example, dtA can have the following values [ABC, DEF] where the column names are first name and last name, and dtB can having the ...
c#
[0]
2,478,268
2,478,269
.trigger('blur') on collection of inputs?
<p>im trying to <code>trigger('blur');</code> on a collection of inputs but i does not seem to get this right.</p> <p>example is avaible here <a href="http://jsfiddle.net/VUUme/1/" rel="nofollow">http://jsfiddle.net/VUUme/1/</a></p> <p>im getting the collection and i got the blur method done but im not sure about the...
jquery
[5]
2,739,207
2,739,208
abstract method not being picked up
<p>I'm getting the following error: <code>The type new MyWebViewClient(){} must implement the inherited abstract method MyWebViewClient.launchExternalBrowser()</code></p> <pre><code> DCWebView.setWebViewClient(new MyWebViewClient() { public void launchExternalBrowser(String url) { Intent intent ...
java
[1]
1,934,843
1,934,844
How to bold specific elements from a Database using a SimpleCursorAdapter
<p>I have a main activity that takes elements from a database and displays them in a clickable listview. I use this method to accomplish the task:</p> <pre><code>private void fillData() { // Get all of the notes from the database and create the item list Cursor c = RequestManager.getRequests(getApplicationCont...
android
[4]
1,639,324
1,639,325
Regex to isolate id
<p>I would like to have a php function that will strip any input and keep only a numeric ID, 36816268 in the example below. </p> <p>The input can be something like this:</p> <pre><code>&lt;iframe src="http://player.vimeo.com/video/36816268" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullsc...
php
[2]