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
4,528,259
4,528,260
Should I create each class in its own .py file?
<p>I'm quite new to Python in general.</p> <p>I'm aware that I can create multiple classes in the same .py file, but I'm wondering if I should create each class in its own .py file.</p> <p>In C# for instance, I would have a class that handles all Database interactions. Then another class that had the business rules.<...
python
[7]
4,082,145
4,082,146
Generating a complex unordered list with PHP
<p>I have to display some info in an unordered list like above:</p> <pre><code>&lt;ul&gt; &lt;li class="first"&gt;...&lt;/li&gt; &lt;li&gt;...&lt;/li&gt; &lt;li class="last"&gt;...&lt;/li&gt; &lt;li class="first"&gt;...&lt;/li&gt; &lt;li&gt;...&lt;/li&gt; &lt;li class="last"&gt;...&lt;/li&gt; &lt;li cl...
php
[2]
3,160,357
3,160,358
Where's the documentation for jQuery set version of .position()?
<p>I am not finding the documentation for jQuery set version of .position()? All I see is the get version at <a href="http://api.jquery.com/position" rel="nofollow">http://api.jquery.com/position</a>.</p> <p>The usage is like:</p> <pre><code>jQuery(theElement).position({ my: "center", at: "cen...
jquery
[5]
3,542,610
3,542,611
Maintaining History in a Web Browser in Java
<p>Can anyone suggest me how to store history?</p> <p>I am making a Web Browser and I have to save the History and then display whenever the User wants. I have tried ArrayList but it will only store the web links that have been used by the open application. Once the application is closed all the saved web links are go...
java
[1]
2,152,229
2,152,230
How to check whether the Question and Password in ASP.NET Membership is correct or not without using Password
<p>I am having an ASP.net Membership I need to verify the User Question and Answer.</p> <p>I dont need to use Password Because its Hashed we cannot validate it</p> <p>MembershipUser msUser = Membership.GetUser("Rasel");</p> <p>thanks, Lalithambigai</p>
asp.net
[9]
4,396,294
4,396,295
how to find the next available input id using jQuery?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8868707/tab-behavior-using-jquery">Tab behavior using jQuery</a> </p> </blockquote> <p>Imagine that there are many text boxes in a web page and our cursor is focused on one of them randomly. Is there any solutio...
jquery
[5]
4,676,101
4,676,102
Location based services in android
<p>please guide me about how i can build an android app which can find the hotels or shopping mall according to my current location . I have gone through several tutorials but only what i can do is to find the latitude and longitude</p>
android
[4]
4,080,622
4,080,623
Jquery - check for clicks outside of a Select box
<p>I recreated a Select box and its dropdown function using this:</p> <pre><code>$(".selectBox").click(function(e) { if (!$("#dropDown").css("display") || $("#dropDown").css("display") == "none") $("#dropDown").slideDown(); else $("#dropDown").slideUp(); e.preventDefault(); }); </code></pre...
jquery
[5]
5,382,924
5,382,925
Could not find class when application is loaded into emulator
<p>I have an activity (DemoAppActivity) from which I am trying to launch a different activity (MainActivity) when a button is pressed. However I am getting two errors:</p> <p>1) when the app is loaded into the emulator, I see the following in the Android logs:</p> <pre><code>10-12 18:48:19.579: ERROR/dalvikvm(620): ...
android
[4]
1,988,540
1,988,541
setTimeout does not work - what is wrong ?
<p>i need to work with setTimeout function but that function does not work. First of all,</p> <pre><code> Player.prototype.playByUrl = function (url) { this.object.data = url; return this.play(); } </code></pre> <p>Above code is my function and i call it</p> <pre><code>window.onload = function (...
javascript
[3]
2,501,946
2,501,947
What is the proper way to handle a ProgressDialog using Activity lifecycle methods?
<p>I have been bitten by: "java.lang.IllegalArgumentException: View not attached to window manager", when using a ProgressDialog in an Activity.</p> <p><strong>What is the proper way to handle a ProgressDialog using Activity lifecycle methods ?</strong> </p> <p>Working code example much appreciated...</p>
android
[4]
3,188,656
3,188,657
simple copy paste function in javascript
<p>Hi All how i can make simple copy and paste in javascript</p>
javascript
[3]
891,466
891,467
How to toggle between images
<p>I currently have a title and an image to the left <img src="http://i.stack.imgur.com/z85fk.jpg" alt="Before text is clicked"></p> <p>When a user clicks on this link a description appears </p> <p><img src="http://i.stack.imgur.com/TkT0C.jpg" alt="Text appears"></p> <p>I do this using:</p> <pre><code>&lt;script ty...
jquery
[5]
2,761,174
2,761,175
Crash Log in Android : Any Idea
<p>I am new in android and working on a maintenance project<br> Application crashes if no internet connection while creating Soap Request</p> <p>Following is screenshot of LogCat, Can any body tell me Whats the reason for crashing.</p> <p><img src="http://i.stack.imgur.com/gRpRo.png" alt="enter image description here...
android
[4]
2,361,594
2,361,595
why python not supporting : while( s = f.readline())?
<p>more example below:</p> <pre><code> if (a = xyz() ) &gt; abc: </code></pre> <p>Really want to know why, is it kinds of bad smell ? </p> <p>Note: I know the grammar, but I am asking why Python don't support such grammar as many other language( e.g., c , java...) do supporting</p>
python
[7]
3,892,243
3,892,244
Can we alias a class name the way we do in namespaces?
<p>Can we alias a class name the way we do in namespaces?</p> <p>For example:</p> <pre><code>namespace longname{ } namespace ln = longname;// namespace aliasing class LONGNAME {}; class LN = LONGNAME; // how to do class name aliasing, if allowed? </code></pre>
c++
[6]
3,434,613
3,434,614
Refactor this jQuery (it seems bloated)
<p>I'm performing this very simple task using jQuery, this code works, but feels bloated and i'm sure theres a quicker way to do it:</p> <p>menu and close are hidden by default.</p> <pre><code>$(document).ready(function(){ var menu = $('#menu'); var open = $('.btnOpen'); var close = $('.btnClose'); open.click(functi...
jquery
[5]
4,074,995
4,074,996
Selective deletion of files in folder according to the name
<p>I would like to know (using c#) how I can delete files in a certain directory whose name contains *mhz.prj.</p> <p>In fact there are several files in this folder and I want to delete only Amhz.prj Bmhz.prj for example. My problem is that the end of the filename is important.</p>
c#
[0]
5,380,886
5,380,887
Special Counters
<p>I`m trying to create a special counter in C# ... I mean the counter will be consisting of characters not numbers.</p> <p>I have a <code>char[]</code> of size 3:</p> <pre><code>char[] str = new char[strSize]; int i = 0; int tmpSize = strSize - 1; int curr; while(!isEqual(str,finalStr,strSize)) { str[strSize] = ...
c#
[0]
2,942,415
2,942,416
python: how to get a subset of dict
<p>I have a dict that has many elements, I want to write a function that can return the elements in the given index range(treat dict as array):</p> <pre><code>get_range(dict, begin, end): return {a new dict for all the indexes between begin and end} </code></pre> <p>How that can be done?</p> <p>EDIT: I am not as...
python
[7]
2,034,334
2,034,335
validate that Date of Birth should not be greater than the current date
<p>validate that Date of Birth should not be greater than the current date. using datetimepicker in asp.net 2.0 and c#..</p>
asp.net
[9]
5,079,913
5,079,914
Unable to use a struct that uses a template as a parameter in a method
<p>I have the following code:</p> <pre><code>template &lt;typename A, typename B&gt; struct TheStruct { A a; B b; }; class TheClass { public: void do_something(TheStruct&lt;A,B&gt; blah); } </code></pre> <p>I get compiler errors on the <code>do_somethng</code> method that resembles <code>error: 'A' was n...
c++
[6]
4,000,691
4,000,692
download latest version of jquery-1.3.2.min.js
<p>I want to download jquery-1.3.2.min.js file. Please suggest site .</p>
jquery
[5]
5,845,503
5,845,504
How to create a CD that contains all the department intranet web applications?
<p>I am working as a web developer and my department in the company now asked me to think in a way that let us able to create a CD that contains all the intranet web applications that we developed in our department in order to distribute this CD to the other departments in the company to show them the applications that...
asp.net
[9]
5,889,566
5,889,567
JQuery Modal true with dialog is not working
<p>I want to have only one window opened so i am uisng modal", true , but still when a popup window is opened , multiple operations are being done </p> <pre><code> $("#fileuploadfun").attr('title',"Upload"); $("#fileuploadfun").dialog( "option", "modal", true ); </code></pre>
jquery
[5]
1,750,596
1,750,597
How to convert Double.POSITIVE_INFINITY to BigDecimal?
<p>I tried <code>BigDecimal.valueOf(Double.POSITIVE_INFINITY)</code>, but kept getting <code>NumberFormatException</code></p> <p>Thanks</p>
java
[1]
788,743
788,744
Java - Cannot find Symbol for Contstructor
<pre><code>import java.lang.*; public class GrammerStack extends GrammerStructure implements StringStack { private String structName; private int cap; public GrammerStack(String structureName, int limit){ this.structName = structureName; this.cap = limit; System.out.println(structName+"["+cap+"]"); } publi...
java
[1]
2,321,073
2,321,074
how to get back in navigation view using timer
<p>hi i am using this code for getting previous view </p> <pre><code>NSTimer *theTimer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(pictureTimerFired:) ...
iphone
[8]
2,958,193
2,958,194
Request-URI Too Large showing on server
<p>I am passing the following data through url : </p> <pre><code>&lt;?php $url = "generate_pdf.php/?feed=" . urlencode(serialize($result)); echo '&lt;div id="left-sidebar"&gt;'; echo '&lt;a href="' . $url . '"&gt;&lt;div id="pdf"&gt;Download PDF&lt;/div&gt;&lt;/a&gt;'; echo '&lt;/div&gt;'; ?&gt; </...
php
[2]
4,949,225
4,949,226
PHP foreach() define 2 things?
<p>I'm trying to define both ['name'] and ['tmp_name'], but i'm having no idea how to do so?</p> <p>Here is my code:</p> <pre><code> foreach ($_FILES['uploads']['name'] as $filename) { // Do stuff } </code></pre> <p>But inorder to complete and move the file, I need the <code>$_FILES['uploads']['tmp_name']</code...
php
[2]
5,168,542
5,168,543
JavaScript with() function
<p>Is <code>with()</code> part of the native JavaScript library? Which browsers support it?</p>
javascript
[3]
3,191,709
3,191,710
Printing in the console objects of an array
<p>Hi I have been trying to learn Javascript using codeacademy.com and I have reached an exercise that doesn't seem to make any sense when why the exercise I have written.This is my code:</p> <pre><code> (function(){ var bob = { firstName: "Bob", lastName: "Jones", phoneNumber: "(650) 777 ...
javascript
[3]
1,536,300
1,536,301
Copy & Paste with c#
<p>For example right now, when you click left mouse and choose paste (if enable) if it is file,or text string or picture etc you can understand somewhere in RAM its already handled or stored, how can i reach that area with C#. And how can i store something (text,picture,file) there.<br> I mean<br></p> <pre><code> p...
c#
[0]
2,004,909
2,004,910
jQuery delete confirmation box
<p>In my jQuery am displaying my results in a table formatted output, a part of my jQuery is</p> <pre><code>&lt;td class='close' onclick='deleteItem(#ITEMID,#ITEMNAME)'&gt;&lt;/td&gt; </code></pre> <p>here <code>"close"</code> is a CSS class and in this class I have cross mark image, if I click this cross mark the fu...
jquery
[5]
2,754,606
2,754,607
Object must return function
<p>I have some JS code here:</p> <pre><code>function Car(manufacturer, model, year) { this.manufacturer = manufacturer; this.model = model; this.year = year == undefined ? new Date().getFullYear() : year; this.getInfo = function(){ return this.manufacturer +' '+ this.model +' '+ this.year; ...
javascript
[3]
1,108,413
1,108,414
Could anyone tell me why the program call abort() in the try block?
<p>The program below compiles successfully, yet it fails to run and call the abort() function which throws a message alerting that "This application has requested the Runtime to terminate it in an unusual way. Please contace the application's support team for more information.", Why so?</p> <pre><code>#include&lt;cstr...
c++
[6]
5,586,164
5,586,165
group array of php objects by object property
<p>I have a php object (book) with 3 properties: <code>name, category, description</code> I then have a list of these <code>book</code> objects in an array. I want to create a new associative array for these objects grouped by <code>category</code>.</p> <p>Say I have 4 book objects in an array called <code>$books</cod...
php
[2]
4,319,708
4,319,709
JQuery click function is not working
<p>I've seen this question before but all the answers I saw do not apply to my particular problem. Most of the ones I've seen were caused by the click not being used in a document ready function. All of the stuff in setup_calenders and disable_items is happening but no alert pops up when the checkbox is clicked.</p> ...
jquery
[5]
2,900,428
2,900,429
How to place ImageButton at x, y location?
<p>I want to place ImageButton at x, y location of my view. The problem is that Android adds padding around image. Because I don't know exact size of padding, I cannot place image button at exact location. So, I want to remove padding. How can I remove padding around image programmatically? button.setPadding(0, 0, 0, ...
android
[4]
2,804,146
2,804,147
Dealing with rapid tapping on Buttons
<p>I have a Button with an OnClickListener. For illustrative purposes, consider a button that shows a modal dialog:</p> <pre><code>public class SomeActivity ... { protected void onCreate(Bundle state) { super.onCreate(state); findViewById(R.id.ok_button).setOnClickListener( new View.OnClickListener()...
android
[4]
2,951,549
2,951,550
Set Auto Complete Text View Text Alignment to be right aligned
<p>I am trying to set the Text alignment of an auto complete text view to be right aligned, I used the android:gravity="Right", on the emulator It is working find, but on the device it is always left aligned,</p> <p>Does any one have an idea? note: I am using Samsung Galaxy Tab as a test device,</p> <p>Thanks</p>
android
[4]
4,189,882
4,189,883
How to produce a short unique id in php?
<p>In order to produce a unique Id I suppose I must use the uniqid function in php.<br> But uniqid produces a 13 digits long HEXA number, by default. </p> <pre><code>4f66835b507db </code></pre> <p>I would like to reduce this number to 7 digits long NUMERIC number but I want to conserve the unicity. Is it possible ? ...
php
[2]
3,275,886
3,275,887
deserializing a csv stream to a vector of structures
<p>I have a Visual Studio 2008 C++ project where I would like to be able to take a list of comma-separated values stored in a std::stringstream and put them in a vector like this:</p> <pre><code>struct Foo { std::string A; std::string B; std::string C; } typedef std::vector&lt; Foo &gt; FooList; std::st...
c++
[6]
4,867,733
4,867,734
How to implement a trackbar android
<p>Is there anyway to implement something like a trackbar on android, so I can explicity specify the values and select it?</p> <p><img src="http://i.stack.imgur.com/na06M.png" alt="enter image description here"></p>
android
[4]
4,403,848
4,403,849
Having a gesturebuilder in my own application
<p>I want to have a gesturebuilder in my own application.I want to store the gestures entered by the user and use it later.How do i do this?How do i call the gesturebuilder from my application.Or is there an easier way to do this.</p>
android
[4]
3,081,306
3,081,307
Calling a base class constructor from derived class in Java
<p>I have a class as follows:</p> <pre><code>public class Polygon extends Shape{ private int noSides; private int lenghts[]; public Polygon(int id,Point center,int noSides,int lengths[]) { super(id, center); this.noSides = noSides; this.lenghts = lengths; } } </code></pre> <...
java
[1]
3,459,326
3,459,327
jQuery Plug-ins
<p>I am looking for a jQuery plug-in which will show / hide a div in a very smooth &amp; slide manners when I click on a link.</p> <p>Do anyone have any idea or URL? Thanks.</p>
jquery
[5]
535,676
535,677
Gridview Data Update by ComboBox
<p>Hi Friends i Want code for</p> <p>I have a gridvie Fill with dataset. But i want If i edit the data in gridview it reflect in corresponding combobox and update in db.</p> <p>Pl anyone help me</p>
c#
[0]
4,726,116
4,726,117
Use of Web Services
<p>Is it possible to store a applications content in a webpage and retrieve the same from there using another application in android.</p>
android
[4]
1,785,223
1,785,224
How to send encoded Base64 image string to server using JSON object
<p>I am new in android . i have send image to server using Json format as a string.</p> <p>so i have Encoded image string i.e base64 string.</p> <pre><code> Json j = new JSonObject(); String Image_string = Base64.ToEncodedString(bytearray, Base64.Default); j.put("image_file_content",Image_string); </code></pre> ...
android
[4]
5,898,777
5,898,778
Stack memory allocation
<p>It is being said that local variable will be allocated and deallocated automatically when function ends in C/C++.</p> <p>According to my understanding, when having been deallocated, the value held by local variable also be destroyed!!! Please correct me if i'm wrong</p> <p>Consider following code:</p> <pre><code>...
c++
[6]
3,211,438
3,211,439
How to access a base class value from derived class c#
<p>Can any one let me know "How to access base class variables in derived class"?</p> <p>Example:</p> <p>Class 1.cs Code</p> <pre><code>public class baseClass { public int intF = 0, intS = 0; public int addNo() { int intReturn = 0; intReturn = intF + intS; return intReturn; } ...
c#
[0]
4,753,284
4,753,285
How do you pass arguments from one function to another?
<p>Sorry for the newbie question guys, but I'm relatively new to python. I want to write a function that passes keyword and value arguments into another function:</p> <p>e.g.</p> <pre><code>def function_that_passes_arguments(arguments): some_other_function(arguments) </code></pre> <p>so when I call the first fu...
python
[7]
4,523,659
4,523,660
passing parameter in python script using "PyRun_SimpleString(pythonScript.py)"
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4028681/how-do-i-run-a-python-file-that-is-read-into-a-stdstring-using-pyrun">How do I run a python file that is read into a std::string using PyRun</a> </p> </blockquote> <p>i am very new to python. m invoking ...
python
[7]
4,260,839
4,260,840
I need to search through a list of classes to find the first that matches what I need
<p>I have the following class:</p> <pre><code>public class TestClass { public IList&lt;TestClassDetail&gt; TestClassDetails { get { return _testClassDetails; } } private List&lt;TestClassDetail&gt; _testClassDetails = new List&lt;TestClassDetail&gt;(); public TestClass() { this._testClassDetai...
c#
[0]
2,606,527
2,606,528
How to do android payments using facebook credits
<p>I just want to do payment in android using facebook gateway.Is it possible in android native app.?if it possible means, how could i do tht? I've searched over tht "http://developers.facebook.com/docs/credits/".But i donno we can implement it on android or not?</p> <p>Thanks</p>
android
[4]
1,195,622
1,195,623
Problem Sending Mail through PHP
<p>I have a contact form that is build in arabic language. When it is ever used, the received mail looks like this ...</p> <pre><code>إسلام الإسم مهندس برمجيات المهنة 010 التليÙون email البريد الإلكترونى تجربة Ø§Ù„Ø¥Ø³ØªÙØ³Ø§Ø± </code></pre> <p>I need to s...
php
[2]
5,264,018
5,264,019
Problem in UITableView and UIScrollView
<p>My table has more than 10 rows with 50 row height....so i can't select my last row....so i have set UIScrollView and add this table into UIScrollView.</p> <p>Table display perfectly but which rows are displayed in UIScrollView, these are not selectable.</p> <p>How can i get this row selecablt in UIScrollView. If a...
iphone
[8]
3,578,100
3,578,101
Is there any way to test iphone application on real device without paying $99 to Apple?
<p>Is there any way to test iphone application on real device without paying $99 to Apple because i dnt want to enrolled to apple iphone developer program i m newbie just playing around with iphone development. </p> <p>Thanks for your answers.</p>
iphone
[8]
5,856,522
5,856,523
Enable/disable use data packet from android code
<p>I want to disable or enable use data packet in android device from my application from which I have used on code as below :</p> <pre><code>try { Method dataConnSwitchmethod; Class telephonyManagerClass; Object ITelephonyStub; Class ITelephonyClass; TelephonyManager telephony...
android
[4]
5,241,205
5,241,206
using global inside of function to get variable from included file. PHP
<p>Really simple I just think it's me. </p> <p>this is file 1.php</p> <pre><code>if(ctype_digit($_GET['id'])) { $item_id = "Hello"; } else { //Something } </code></pre> <p>this is file 2.php</p> <pre><code>function item_show(){ $item_query = "SELECT title FROM tbl_items WHERE id='" . mysql_real_esc...
php
[2]
2,409,507
2,409,508
Calendar Class in Javascript - unable to keep the reference.
<p>I wrote a datepicker in Javascript, but it is not working properly,</p> <p>as I lose the reference to the Calendar object.</p> <p>here is the example</p> <p><a href="http://asexpress.de/calendar/" rel="nofollow">http://asexpress.de/calendar/</a></p> <p>by clicking within the input field the calendar will be disp...
javascript
[3]
2,764,954
2,764,955
USing jQuery modal popup
<p>I work on Asp.Net VS08 C#.Click on Button i want to show a model popup.containing the bellow controls.</p> <pre><code>&lt;div&gt; &lt;asp:Button ID="Button1" runat="server" Text="Close" /&gt; &lt;asp:Button ID="Button2" runat="server" Text="Save" /&gt; &lt;asp:Button ID="Button3" r...
jquery
[5]
2,849,900
2,849,901
Can you help me understand this example of fibonacci using C# closures?
<p>Attempting to learn functional C#, I ported Dustin Campbell's <a href="http://diditwith.net/PermaLink,guid,f3be3915-873b-4082-a087-871f5dd52c82.aspx" rel="nofollow">fibonacci example</a> to C#3. My solution works but I have trouble understanding the last line of Nth_Fib. Isn't it weird that the agrument to formula d...
c#
[0]
2,775,811
2,775,812
Convert DB string into checkbox checking with PHP
<p>I have following SQL query: </p> <pre><code> $readNews_SQLselect = "SELECT "; $readNews_SQLselect .= "live, content, user, created, created_updated, user_updated "; // rows names $readNews_SQLselect .= "FROM "; $readNews_SQLselect .= "news "; // table name $readNews_SQLselect_Query = m...
php
[2]
720,613
720,614
How to do NFC(Near Field Communication) in android
<p>I just want to scan details from my bussiness card through NFC into my native app(like address,name,company name) programmatically. I dont have much idea on this.What are the necessary steps i need to set up?How could i begin to do this app in android?</p> <p>And one more,QR scanner is something different from NFC?...
android
[4]
1,588,599
1,588,600
Regular Expressions in Python-Scraping Data from website
<p>I am new to Python and I trying to pull in xml files from a website and load them into a database. I have been using the Beautiful Soup module in Python but I cannot pull in the specific xml file that I want. In the website source code it looks as follows:</p> <pre><code>&lt;a href="ReportName I want 20130101.XML"...
python
[7]
1,973,384
1,973,385
Event anonymous function parameters not working correctly
<pre><code>PictureBox[,] picBoard = new PictureBox[3, 3]; for(int i = 0; i &lt; 3; i++) for (int j = 0; j &lt; 3; j++) { picBoard[i, j] = new PictureBox(); picBoard[i, j].Click += new EventHandler( (sender, e) =&gt; Debug.WriteLine(i.ToString() + " " + j.ToString())); } </code></p...
c#
[0]
1,514,015
1,514,016
How can I break the string on Java?
<p>I need to write strings into <code>ByteArrayOutputStream</code>, but I need to write strings with breaking. I have tried to do it as example:</p> <pre><code>out.write("123".getBytes()); out.write("\n456".getBytes()); </code></pre> <p>But '\n' doesn't work. Please, tell me, how can I fix it? Or suggest me alternati...
java
[1]
1,840,268
1,840,269
How do I associate icons to zip file type with an iPhone/iPad application?
<p>Here is my code in plist file. It run correctly but the icon was not displayed.</p> <pre><code>&lt;key&gt;CFBundleDocumentTypes&lt;/key&gt; &lt;array&gt; &lt;dict&gt; &lt;key&gt;CFBundleTypeIconFiles&lt;/key&gt; &lt;array&gt; &lt;string&gt;iPad-320.png&lt;/string&gt; &lt;...
iphone
[8]
1,197,405
1,197,406
Zebra striping after jQuery remove()
<p>I use jQuery to zebra-stripe my table because it works for ie8.</p> <p><code>$('table.data tr:nth-child(odd)').css('background-color', '#ececec');</code></p> <p>Problem is, I have a button that allows you to remove a row.</p> <p><code>$(this).parents('tr').remove();</code></p> <p>Which throws off the zebra strip...
jquery
[5]
2,514,091
2,514,092
jQuery attr method failing to add attribute
<p>In certain conditions I want to open links in the same window, while in others I want to open them in a new window. I have the following jQuery code:</p> <pre><code>if (internal) { jQuery(".main a").removeAttr('target'); } else { jQuery(".main a").attr('target', '_blank'); } </code></pre> <p>I have two <co...
jquery
[5]
3,169,527
3,169,528
Is it possible to set text in a TextView with format
<p>In my layout.xml file, is it possible to set text with style? e.g. <b>this is bold</b> This is default</p> <p>Can I do that?</p>
android
[4]
4,994,360
4,994,361
Check if value exists in dataTable?
<p>I have DataTable with two columns Author, Bookname.</p> <p>I want to check if given string value Author already exists in DataTable. Is there some built in method to check it, like for Arrays array.contains ? </p>
c#
[0]
402,853
402,854
A HREF Modify the value causes the nested element inside A tag to be deleted
<p>The following A HREF element modified through the jquery deletes the nested IMG element .</p> <pre><code>&lt;table id="newHead" width="90%" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" style="display: none;border: 1px #000066 groove;"&gt; &lt;tr height="25px"&gt; &lt;td style="text-...
jquery
[5]
5,006,617
5,006,618
Login form on homepage for back-end login
<p>I am trying to add a login form on my homepage so that clients can use that to log in to my backend website in PHP where they can check the progress of their project. The way it is set up now is that the client goes to client.mywebsite.com and i would like them to be able to login from mywebsite.com instead. I was j...
php
[2]
1,224,194
1,224,195
Quick jQuery fadeTo/fadeIn syntax
<p>I've got this line, but I've tried adding the fade in, or fadeto part, it's not having any effect, so I presume it's not written correctly...</p> <pre><code>$(".bold_link").replaceWith('&lt;span class="bold_link"&gt;No Virus Found! &lt;img src="/images/virus-tick.png" alt=""/&gt;&lt;/span&gt;').fadeTo('slow', 1); <...
jquery
[5]
5,164,186
5,164,187
Creating own LiveWallpaperPreview?
<p>I would like to create my own LiveWallpaperPreview, i.e. to show the user a fullscreen preview of what the selected Live Wallpaper looks like (without the "Set Wallpaper" and "Settings" button that the stock-OS preview has).</p> <p>Rebuilding the LivePicker-Class from 2.1 (<a href="http://android.git.kernel.org/?p=...
android
[4]
2,093,704
2,093,705
Select Closest span
<p>Here is my HTML code </p> <pre><code> &lt;span class="xxt" style=""&gt;Hide Me&lt;/span&gt; &lt;div&gt;&lt;br/&gt;&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;span style=""&gt; &lt;table&gt; &lt;tr&gt; ...
jquery
[5]
1,826,917
1,826,918
Javascript RegExp Curly Brace and test Issue
<p>I want regExp to test for two 'Hello'-s and return true but it only returns false even though I cannot find anything wrong with my code. How do I fix this? Please also suggest what is wrong with the code.</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; var str ="Hello Hello"; var pa...
javascript
[3]
3,447,329
3,447,330
jquery popup problem
<p>i am a nobe to jquery..what i am trying to do is when i click on the register button on my index i want a popup to include my register.php on the upper-right corner i have been trying the whole day but cant firgure it out i tried to use include "register.php" in ![enter image description here][1]</p>
jquery
[5]
3,889,624
3,889,625
Removing blocks of text with python
<p>I'm trying to remove large blocks of text from a file using python. Each block of text begins with</p> <p>/translation="SOMETEXT"</p> <p>Ending with the second quote.</p> <p>Can anyone give me some advice on how to accomplish this?</p> <p>Thank you</p>
python
[7]
3,257,696
3,257,697
can we specfity directory path with the property file while using ResourceBundle class in java
<p>I want to place my properties files in some folder, but i am not able to read them because we can specify only the bundle name in static getBundle method on ResourceBundle object.</p> <p>Suppose bundle is : myFile.properties</p> <p>current path is : src</p> <p>i want to keep my properties file in : src/temp</p> ...
java
[1]
319,846
319,847
get value from radio group using jquery
<p>I am trying to get value of radio group with name <code>managerelradio</code>. My html code for this radio group is.</p> <pre><code> &lt;label&gt;&lt;input type="radio" name="managerelradio" value="Yes" id="Add"&gt;Add&lt;/label&gt; &lt;label&gt;&lt;input type="radio" name="managerelradio" value="No" id="Remove"&g...
jquery
[5]
2,401,350
2,401,351
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,331,357
2,331,358
USB Drive Removal Code in C#
<p>When I use this function in c#, it is able to get drive letter but, when I remove the USB stick and test this function, it doesnt go to the Exception.</p> <p>So could someone help me with where I am going wrong in the function code?</p> <pre><code> public void GetDriveLetter() { try { ...
c#
[0]
292,871
292,872
How to start designing with (open) data and JavaScript, for dummies?
<p>I've been designing data-driven interfaces (mostly graphic, low fidelity and non-functional prototypes) for over a year, to be implemented using JavaScript libraries such as <a href="http://mbostock.github.com/d3/" rel="nofollow">d3.js</a>. Although I'm a web designer by education, I've never actually coded any data...
javascript
[3]
5,770,931
5,770,932
Reading particular line in a file for a particular word in PHP
<p>I am new to php, I need to read a text file's 5th line and see if it contains a particular string what would be the most efficient way to do it ? I understand I can ready all lines using this method, should I put a counter here and break the loop if it is 5 ? or is there a better way to it ..</p> <pre><code> $file ...
php
[2]
1,958,630
1,958,631
Which Namespace include hWnd in C# .Net?
<p>I am working on a c#Project.</p> <p>I would like to know: Which Namespace include hWnd,tWindowPlacement,TAboutBox in C# .Net?</p>
c#
[0]
4,299,623
4,299,624
How to define F<T> and F<T,U> and F<T,U,V> interfaces in Java?
<p>How would I define <code>F&lt;T&gt;</code> and <code>F&lt;T,U&gt;</code> and <code>F&lt;T,U,V&gt;</code> interfaces in Java (in lieu of <code>Action</code> from C#, they would have functions with one, two and three parameters returning void inside)?</p> <p>When I try to create them as nested types, I get an error s...
java
[1]
5,851,121
5,851,122
Auto set input values
<p>Somewhat a simple question, but i can't get it working.</p> <p>I want to make a simple checkup to see if the browser supports the placeholder attribute. If they don't i want to set the values if the input fields with jquery.</p> <p>I'm testing it on firefox now, but can't get it working. I don't get any alert fiel...
jquery
[5]
736,257
736,258
Mixed Results for Class Method
<p>I use PHP with the Codeigniter framework, and often have methods in my classes that return an array of values. It makes things simpler in my views if there are no records returned, that the method return FALSE or NULL, rather than returning an empty array. In my views I can just have something like:</p> <pre><co...
php
[2]
4,011,466
4,011,467
Post php variable from one file to another
<p>How can I post a php variable from one file to an other? I still asked this question before and got this answer back but it doesn't work. I guess it's because the two code bits are each in a different file. How can fix this problem?</p> <p><strong>upload.php</strong></p> <pre><code>$filename = $_FILES['upload']['n...
php
[2]
4,089,484
4,089,485
How to implement a less generic std::is_constructible with decltype
<p>I'm going out on a limb here, assuming that it is possible but I'm not quite sure. Basically what I'm looking for is a way to switch at compile-time between using a default constructor or a constructor that takes one argument by reference.</p> <p>i.e.</p> <pre><code>T* create&lt;T&gt;() { return new T(1); // i...
c++
[6]
1,968,347
1,968,348
How to set animation for button background
<p>I have button and I have two pictures green.png and red.png. How to achieve that when button is visible to change button background every 500 ms ( green.png=>red.png=>green.png=>red.png...) ? </p>
android
[4]
5,233,448
5,233,449
Javascript slice off last character if there are 2 of them
<p>how to cut off second sign if there is a second sign ?? some times id is ....5a and 5b and i need to cut of the 'a' and 'b'</p> <p>JS</p> <pre><code>$(".mieszkanie").click(function() { var num = this.id.replace(/c_10_0/, ""); var n = num.length; if (n = 2) { [than cut second si...
javascript
[3]
72,850
72,851
Says import not used. Now sound doesnt work
<p>New to Android Dev and this site. I created an app and basics were working. I added a sound button and it worked. I created a new app for earlier version of android and accidently dragged my Main Activity file to the new app instead of copying it. When I dragged it back, it said my imports were not used. Now the sou...
android
[4]
4,023,714
4,023,715
joining relative urls?
<p>So i want to join strings with relative urls in Javascript.</p> <p>base url = "http://www.adress.com/more/evenmore"</p> <p>with</p> <p>relative url = "../../adress" => "http://www.adress.com/adress"<br> relative url = "../adress" => "http://www.adress.com/more/adress"</p> <p>What would be the best way? I was thi...
javascript
[3]
2,751,125
2,751,126
jQuery efficiency question
<p>I have HTML like this:</p> <pre><code>&lt;div id="best"&gt; &lt;img src="image.jpg"&gt; &lt;span&gt;title&lt;/span&gt; &lt;img src="image.jpg"&gt; &lt;span&gt;title&lt;/span&gt; &lt;img src="image.jpg"&gt; &lt;span&gt;title&lt;/span&gt; &lt;/div&gt; </code></pre> <p>I want jQuery code to r...
jquery
[5]
5,558,823
5,558,824
Change div text if Select contains option with specific text
<p>I have a CMS that multiple people administer. We enable/disable some of our shipping methods depending on the time of year. I want to setup our checkout page to display a different message in our pickup info TD if someone enables the "Text Reserv. Pick-up" shipping option, but leave it as the default if not.</p> <p...
jquery
[5]