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,911,145
4,911,146
Why to scroll webpage to top, i need to scroll the $("html")
<p>i am referencing the code from <a href="http://snipplr.com/view/8782/jquery-animated-scroll-to-top/" rel="nofollow">snipplr</a></p> <pre><code>$('html, body').animate({scrollTop:0}, 'slow'); </code></pre> <p>i found out actually i need to use <code>$('html')</code>, <code>$('body')</code> does not work, <code>$('h...
jquery
[5]
1,363,320
1,363,321
Opening email attachments in Android
<p>I try to open a specific email attachment type with my activity, the attachment itself is a plain text windows style ini file with the extension *.os. In the email this file is attached as "application/octet-stream". I tried the following intent-filter to catch the attachment with my activity:</p> <pre><code> ...
android
[4]
3,161,074
3,161,075
Application spy for android
<p>Can any one help me for writing an application spy for android..</p> <p>I need to monitor if any application is accessing the sim contacts or phone contacts.</p> <p>thank you..</p>
android
[4]
914,853
914,854
Digital Stop Watch
<p>Hii,</p> <p>I have an input time in millisecounds. I want to include a digital stop watch in my application.i.e The time will dynamically change like a digital clock in every seconds. </p>
javascript
[3]
3,264,180
3,264,181
Field-like events and anonymous delegates
<p>When name of a field-like event <code>SomeNews</code> is used inside a class that declares this event, this name doesn't refer to the event itself, but to the anonymous private delegate <code>D</code> created by compiler, and for that reason <code>D</code> can be invoked indirectly ( inside <code>MyClass</code> ) v...
c#
[0]
1,527,022
1,527,023
Convert string to Python class object?
<p>Given a string as user input to a python function, I'd like to get a class object out of it if there's a class with that name in the currently defined namespace. Essentially, I want the implementation for a function which will produce this kind of result:</p> <pre><code>class Foo: pass str_to_class("Foo") ==&g...
python
[7]
4,612,862
4,612,863
JQuery : Count children that is checked in a <li> tag
<p>I have a tree view using html tags, when the "tvcheckbox attrParent" is checked, how can I count all its children "tvcheckbox attr" which where checked using JQuery.</p> <pre><code> &lt;li class="others"&gt;&lt;input type="checkbox" value="ALPHABETS" class="tvcheckbox attrParent"&gt;ALPHABETS &lt;ul&gt; ...
jquery
[5]
243,451
243,452
Python script problems
<p>So this is a script that I am coding for my buddies companies customer support. Basically, what it does is call using the IP phones that are in the script, it works, but with problems. Here is the code:</p> <pre><code>import urllib, urllib2, sys num = sys.argv[1] print 'Calling' phones = [ 'http://phone1/index.htm'...
python
[7]
4,289,385
4,289,386
String replace in Android
<p>To try string replace in Android, I wrote a small snippet:</p> <pre><code>public class cs{ public static void main(String[] args){ String a,c; int b; b=1; c="12345"; a="12345,54321"; a.replace(c,String.valueOf(b)); System.out.println(a); } } </code></pre> <p><b>Expected Output:</b> 12345,5432...
android
[4]
792,693
792,694
Javascript window.onbeforeunload not work without Alert
<p>Hi I use javascript to save information after page going to be close or navigate to another page.My problem is when I call webservice in window.onbeforeunload it is not going to fire and I dont get result. But If I put alert at the end of function webservice going to fire and I get result.I don't want to use alert a...
javascript
[3]
983,023
983,024
when to use and when not to use the DP and PX measures Android
<p>I am trying to understand the "Best practices for Screen Independence". Can someone explain me when to use and when not to use the DP and PX measures ? (of course it is in documentation but my understanding is little vague from it..)</p> <p>Thanks</p>
android
[4]
944,545
944,546
java Delete a Binary Tree node containing two children
<p>This is the last case where the node to be deleted has two children. I cant figure out what I am doing wrong . Please help.</p> <pre><code> //BTNode has two children else if (u.getLeft() != null &amp;&amp; u.getRight() != null){ //if node to delete is root BTNode&lt;MyEntry&lt;K,V&gt;&gt; pre...
java
[1]
3,210,895
3,210,896
What is the best practice for timezone conversions?
<p>I want to give users the option to change their timezone and display their data in that timezone. I'm currently storing a unix timestamp and would like to know what the best way to handle this conversion would be.</p> <hr> <p>I am storing my timestamp in unix format. My concern is what function can I use to do the...
php
[2]
1,682,524
1,682,525
Does it make any sense to develop for iPhone OS 3.0 instead of 3.2?
<p>When it comes to backwards-compatibility, I want to stick to iPhone OS 3.0 so also some of the poor iPod Touch users who aren't rich enough for iPhones use my apps. But iPhone OS 3.2 has some pretty cool features that would be nice to have. </p> <p>Problematic thing: Since it's just a minor upgrade, I can imagine m...
iphone
[8]
2,027,666
2,027,667
Why it gives wrong output i.e 2.... But i
<pre><code>// A program to allocate the memory to integer from using of "free()" function. #include &lt;iostream.h&gt; void main() { int *integer; integer=new int[5]; cout &lt;&lt; sizeof(integer); } </code></pre>
c++
[6]
1,207,998
1,207,999
Location awareness
<p>I have this javascript code which takes a list of locations and reorders the list items according to the users location. how can i change the code so that it only displays the locations within a vicinity of 1KM rather than just reordering the whole list. </p> <pre><code> &lt;script type="text/javascript"&gt; $(d...
javascript
[3]
3,123,746
3,123,747
Howto add onclick event to button in listview added by addFooterView?
<p>I'm using a listview with my own implementation of baseadapter. Before adding the main list items to the listview and setting the Adapter i add a footer, with addFooterView(), to the listview. The footer is a normal listview item with a custom view and two buttons.</p> <p>And here comes my problem:</p> <p>How can ...
android
[4]
3,356,097
3,356,098
prevent javascript executing \n
<p>Is it possible to prevent javascript in executing \n from string.</p> <p>I have string which contains \n (i.e. "<code>ksqOOEe+sqQwexx12lMf31V\nLqW23ds</code>"). This is encrypted string and I have to handle it in Javascript. Problem is that JS break it into two rowns, than browser register Illegal operation. I don'...
javascript
[3]
1,927,922
1,927,923
how to display different currencies symbols in android?
<p>i want to display different currencies symbols in combo box(Spinner). The currencies may me follows:</p> <pre><code>usa euro pounds </code></pre> <p>e.t.c</p> <p>i preferred to read these symbols from the xml. is there any code for the currencies symbols.</p> <p>how can i do it?</p> <p>thanks</p>
android
[4]
5,617,073
5,617,074
Optional `new` operator
<p>Reading through the jQuery documentation about the event object and its constructor <code>$.Event()</code> I see:</p> <blockquote> <p>The <code>new</code> operator is optional [when calling the constructor].</p> </blockquote> <p>That's cool! How did the jQuery people pull such a trick?</p>
jquery
[5]
489,176
489,177
passing paramters using ksoap2 to .net web service, always passes nulls (empty) values
<p>I am new to android applications,I am using Ksoap2 to access .Net webservice and The call is executed just fine without parameters. But with parameters I am getting Empty. I followed all the steps provided in sites. I tried everything possible but no luck so far. I hope someone can help, </p> <pre><code> private s...
android
[4]
4,501,132
4,501,133
Testing for null and something else on the same line of code
<p>I have a user object and I have a variable named userID.</p> <p>I would like to test 2 things:</p> <ul> <li>user == null</li> <li>user.UserID != userID</li> </ul> <p>The second test must be done only if user is not null otherwise I have a runtime error.</p> <p>I wonder if it is possible to test both on the same ...
asp.net
[9]
865,380
865,381
how to change css rules in style using javascript when the style media is print?
<p>How do you change the css rule of #div1 in the style type="text/css" media="print" using javascript? I want to change the display to none on the click event of a checkbox/button.</p> <pre><code>&lt;style type="text/css" media="screen"&gt; #div1{ display:visible; } &lt;/style &lt;style type="text/css" media="prin...
javascript
[3]
3,480,604
3,480,605
What is connection pooling?
<p>Can somebody please explain connection pooling to me please?</p> <p>I am just not understanding it by searching the internet.</p>
asp.net
[9]
4,327,006
4,327,007
How to submit form on webpage in PYTHON?
<p>I want to tick checkboxes, select radio buttons, write in text boxes and finally click on submit button to submit the form on a page. Programming in PYTHON only. How do i achieve this?</p>
python
[7]
467,412
467,413
how to send first initial request via Socket in CIFS in C#?
<p>HI,</p> <p>how to send first initial request via Socket in CIFS in C# ? I want to send first initial request and get a response from destination address in C#. I want to send CIFS request in form of CIFS format.</p> <p>Any code snippet is highly appreciated.</p> <p>Thanks in Advance.</p>
c#
[0]
6,000,419
6,000,420
Why am I getting null when trying to retrieve a value from a ContentValues object?
<p>I am getting a NullPointerException when trying to retrieve/insert values from a ContentValues object that I'm a passing to my database method. I have several columns in my db table and instead of passing all those as params to the method, I'm trying to simplify it a little bit.</p> <p>Here's a sample of the code:<...
android
[4]
2,329,512
2,329,513
how to create vector in c#
<p>I have a set of servers for which I need the names, but I only want those that are currently available so I need a dynamically sized array. What data structure can I use to store these.</p>
c#
[0]
3,134,100
3,134,101
php html decode string
<p>I have an array which returns various strings which I'm trying to html-decode. But I can't seem to find a function which will work on all the strings. For example, one of my strings looks like this:</p> <pre><code>"a detail of The School of Athens&lt;!-- this should link to an article about the famous artwork --&gt...
php
[2]
1,973,120
1,973,121
Pass data as code
<p>I'm trying to interpret a formula given as input:</p> <pre><code>y= y argv[1][s] 5; </code></pre> <p>where <code>argv[1][s]</code> can be <code>+ - *</code> for example.<br> y= y+5;<br> y= y*5; </p> <p>I could use a check for specific values, but it's more interesting to find out why this doesn't work.</...
c++
[6]
5,602,085
5,602,086
How handle an element of elements having same class name using jquery
<pre><code>&lt;div id="user" class="user"&gt;akhilreddy&lt;/div&gt; &lt;div id="user" class="user"&gt;subodh&lt;/div&gt; </code></pre> <p>I many of elements but am showing only two, when ever I click on div I want text inside that div to be diplayed in alert box.</p> <p>Thank you </p>
jquery
[5]
309,764
309,765
ashx method call - make reusable
<p>i have an ashx file that creates a binary csv file for me. i'd like to be able to pass it any generic list.</p> <p>i know i can put the list in session and then pick it up in the generic handler but will that acceptable under heavy loads?</p> <pre><code> byte[] csvData = Utility.ToCsv(",", DAL.GetProducts()); ...
c#
[0]
3,072,177
3,072,178
How to get all filenames inside a folder in assets folder in android?
<p>How to get all filenames inside a folder in my assets folder in android? Please help. Thanks in advance.</p>
android
[4]
1,150,073
1,150,074
jQuery - select parent by child class?
<p>How can I select the <code>&lt;tr&gt;</code> containing the child <code>&lt;div class="test"&gt;</code>, as below?</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;!-- this tr is what I want to select --&gt; &lt;td&gt; &lt;div class="test"&gt; text &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre>
jquery
[5]
5,137,282
5,137,283
Good article on GDI+
<p>Actually, I have never before use GDI+, Can anybody suggest me some good articles on this. I am trying to create custom controls.</p>
c#
[0]
4,623,222
4,623,223
Is there another way to create an object with a classname returned by a method?
<p>I have this method : </p> <pre><code>public function getInstance() { $classname = $this-&gt;getFullyQualifiedClassName(); return new $classname(); } </code></pre> <p>Is there a way to write this without the <code>$classname</code> variable, which gets used only once?</p>
php
[2]
2,777,610
2,777,611
Always launch activity X after resume from background and new launch - Android
<p>I need to implement the following:</p> <p>When the app starts, activity A is shown (a login screen) that goes to activity B if login credentails are correct.</p> <p>Activity B is a dasbhoard, that can start several other activities C,D .. (and thus remains active, the user should be able to go back to B if he/she ...
android
[4]
4,135,635
4,135,636
How to periodically poll some value using Java (Swing)?
<p>I am using swing based model.My form contains one Jbutton its called "polling(function name is getvalue())".I have a function name as "getvalue()".This function does retrieve values(this value will change after some span of time) and print it in console. I want code and idea about, that function will call automatica...
java
[1]
1,352,661
1,352,662
In asp.net how to play Multiple swf files in single Object control
<p>In aspx pages i had a single object and plays the .swf file.but i need to change dynamically the object will change another swf file depends on Impressions.</p>
asp.net
[9]
4,236,132
4,236,133
iphone SDK: How can I get the current selected row for UIPicker?
<p>How can I get the current selected row for UIPicker?</p> <p>I want to use it to get at the associated string. Like this. The problem is I do not know how to get the row.</p> <pre><code>//need to get currently selected row NSString *strPeriodSelection = [arrayRecurChoices objectAtIndex:periodPicker.row???]; </code...
iphone
[8]
2,737,870
2,737,871
Why am I getting the error "parameter pack 'F' must be at the end of the template parameter list"
<p>I have code that uses a variadic template and I'm trying to understand where to put the ellipsis. In the below code I put them, like the error says, at the <em>end</em> of the template parameter list. But I still get errors. What am I doing wrong?</p> <pre><code>template &lt;typename T&gt; struct S { void oper...
c++
[6]
1,036,024
1,036,025
When should a music player gain and give up audio focus?
<p>I'm writing an Android music player, and is stuck on audio focus issue.</p> <p>It seems like audio focus mainly affects media button receiving, but after reading the document I have no idea about when to gain and give up focus.</p> <p>My music app will run in background, and need to detect play/pause button <stron...
android
[4]
313,407
313,408
jquery fadein addClass
<p>I am using jQuery to apply a class to an element on hover i.e. <code>addClass('active')</code></p> <p>The class adds a border and changes the background color but i would like to have these changes faded in as opposed to just on or off.</p> <p>Is this possible using jQuery i.e. to add a class and have the effects ...
jquery
[5]
2,410,310
2,410,311
Android: How to schedule?
<p>In my app I would like that a certain method of mine (call it toSched) will run at a given time in the future (I'm using <code>Timestamp</code> for knowing when).</p> <p>How can this be done, and is it possible to do it even if the phone is turned off (assume there is enough battery) ?</p> <p>*I know I should use ...
android
[4]
2,484,654
2,484,655
SDL Alternative with multiple windows and multiple display devices
<p>I'm looking for an alternative to SDL that supports multiple windows on multiple display devices for OpenGL.</p> <p>Is there any mature library that provides this?</p> <p>I'm aware taht SDL 1.3 will support this but it seems that's a bit into the future.</p>
c++
[6]
640,904
640,905
Parent window resize?
<p>basically, I need to access the parent window of an iframe, this script is also loaded in the iframe window as well.. So basically I have this markup. </p> <p>BODY | IFRAME | BODY | SCRIPT</p> <pre><code>$(window.parent.document).resize(resizeModal); </code></pre> <p>So I need once inside the modal window, for th...
jquery
[5]
1,000,498
1,000,499
What is the best way to load heavy bitmap in the imageview?
<p>I as a new programmer, totally confused of the <code>OutOfMemoryException</code> whenever I use <code>BitmapFactory.decodeStream(is,option)</code> method which <code>returns</code> <code>Bitmap</code> object. As every application have its <code>virtual machine</code> budget, if it exceeds it throws <code>OutOfMemory...
android
[4]
2,223,473
2,223,474
Calling fprintf from dynamic library (c++)
<p>I'm creating a windows DLL library that contains a logging class, the log function in that class simply calls fprintf like this for testing purposes:</p> <p>fprintf(stderr, "DEBUG: %s\n", "Hello"); </p> <p>Now this call works fine if i use it from any function in any file in my other project (that uses the lib...
c++
[6]
1,294,426
1,294,427
jquery get checked checkboxes
<p>i'm trying to get the list of checkboxes and the count that are checked. I have this:</p> <pre><code> var obj = $(this).closest('li').find(':checkbox'); var childCount=$(obj).size(); var checkedCount=$(obj).(':checked').length; </code></pre> <p>I get error on checkedCount</p> <p>??</p>
jquery
[5]
2,288,351
2,288,352
Is there any way to create a listener to accept the errors in the patternlock in gingerbread?
<p>Iam trying to create an app without editing the android os in such a way to notify my app whenever the user enters the patten wrong. is this possible. i was thinking about using a listener that listens to the log of the phone. i am not sure this will work though because iam quite a beginner in android. </p>
android
[4]
566,292
566,293
What's the difference between Number.somepropertyormethod and Number().somepropertyormethod?
<p>So the following works:</p> <pre><code>alert(Number().toString.call(1)); </code></pre> <p>But this does not work:</p> <pre><code>alert(Number.toString.call(1)); </code></pre> <p>Furthermore, the following works:</p> <pre><code>alert(Number.prototype.constructor(1)); </code></pre> <p>But this does not work:</p>...
javascript
[3]
826,444
826,445
C++ Assigning an int to a char - why does this work without at least a warning?
<p>Why does C++ (and probably C as well) allow me to assign and int to a char without at least giving me a warning?</p> <p>Is it okay to directly assign the value, like in </p> <pre><code>int i = 12; char c = i; </code></pre> <p>i.e. do an implicit conversion, or shall I use a <code>static_cast&lt;&gt;</code>?</p> ...
c++
[6]
3,033,585
3,033,586
Are external scripts in the head of an HTML document guaranteed to execute before scripts contained within the body?
<p>I'm trying to execute some inline javascript within an HTML page as early in page processing as possible that makes use of library functions in an external .js file. </p> <p>While I've always seen that putting library scripts in the head, and client scripts in the body just seems to work, I can't find documentatio...
javascript
[3]
2,856,932
2,856,933
how to get service class's public member variable to TabActivity
<p>I want to get service class's member variable to a Class which extends TabActivity.</p> <pre><code> public class MainActivity extends TabActivity { private TabHost tabHost; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
android
[4]
5,446,300
5,446,301
Full Text justification in android
<p>I am browsing data from the server and getting through page.getContent(), My textview has default gravity(left), so text is left aligned, I want right alignment as well(As we justify text in MS Office)....Is there any way to justify the text.</p> <p>I have put android:garavity="left|right" it also doesn't work.</p>...
android
[4]
3,782,522
3,782,523
How To Detect If Type is Another Generic Type
<p>example:</p> <pre><code>public static void DoSomething&lt;K,V&gt;(IDictionary&lt;K,V&gt; items) { items.Keys.Each(key =&gt; { if (items[key] **is IEnumerable&lt;?&gt;**) { /* do something */ } else { /* do something else */ } } </code></pre> <p>Can this be done without using reflection? How do I say...
c#
[0]
1,296,947
1,296,948
How can I use setString procedure properly?
<p>I have the following situation...</p> <p>I use CallableStatement from java.sql package. When I use setDate function prior to executing stored procedure, I get an error:</p> <blockquote> <p>Cannot find symbol symbol: method setDate(int, java.util.Date) location: interface java.sql.CallableStatement"</p> </blo...
java
[1]
2,319,666
2,319,667
How to use IActivityWatcher
<p>Hi Can anyone tell me how IActivityWatcher interface is used??</p> <p>I'm trying to develop an application that records the amount of time that all installed applications were run. It is similar to an application "AppUsage" on Google play. When i decompiled it and checked he is using IActivityWatcher interface in h...
android
[4]
1,270,267
1,270,268
Retrieving Android API version programmatically
<p>Is there any API in the Android SDK that allows me to get the API version that the phone is currently running?</p>
android
[4]
5,105,445
5,105,446
iPhone 3rd Party Controls?
<p>I was wondering if there are any 3rd party controls for use with the iPhone that are available, even better if usable from Interface Builder. From what I can gather, the answer is no.</p> <p>I come from a Microsoft .NET background where of course there are tons of controls available from 3rd parties. I'm curious if...
iphone
[8]
17,040
17,041
PHP repeat progress after waking up
<p>I want to repeatedly check a variable every time php wakes up from sleep(). Further, if 3 minutes have passed without finding a particular variable then the function should stop checking. How would I go about this? This is the code I have thus far:</p> <pre><code>&lt;?php $file = file_get_contents("file.txt"); ...
php
[2]
4,346,280
4,346,281
jquery - selecting multiple elements with same class and then filtering by id
<p>.post is the class of elements which also have an unique id such as "c1", "c14" etc (representing the post count on the page).</p> <p>The code below will be part of an ajax call which regularly pulls new posts while also checking the current amount of posts on the page. Should the amount exceed 5, the older posts a...
jquery
[5]
266,951
266,952
Javascript Bitwise Operators
<p>I'm trying to figure out some differences between C# and Javascript. Ok, take this code in Javascript:</p> <pre><code>var j = 0x783a9b23; var bt = ((16843134 ^ (16843134 - 1)) * j); </code></pre> <p>After executing this, "bt" will be 6051320169. </p> <p>Now after doing this in C#:</p> <pre><code>int j = 0x783a9b...
javascript
[3]
2,342,646
2,342,647
Getting specific days in a month
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5421972/how-to-find-the-3rd-friday-in-a-month-with-c">How to find the 3rd Friday in a month with C#?</a> </p> </blockquote> <p>There's a condition that a specific event will occur only on <strong>first</strong> ...
asp.net
[9]
1,463,337
1,463,338
How to remove automatic picture rotation?
<p>I have a problem with pictures; after I take a picture, it automatically rotates 90-degrees. How I can remove this? I need a portrait picture.</p> <pre><code> public void surfaceCreated(SurfaceHolder holder) { try { camera.setPreviewCallback(this); camera.setPreviewDisplay(holder); Came...
android
[4]
5,676,736
5,676,737
Is there a compliance test for C++ compilers?
<p><b>Is there, somewhere, a freely usable/accessible script, source file, or whatever, that is able to measure the compliance of a given C++ compiler?</b></p> <p>For example, the Acid3 test for browsers: <a href="http://acid3.acidtests.org/">http://acid3.acidtests.org/</a></p> <p>The results I dream of would be a gl...
c++
[6]
856,715
856,716
javascript returns undefind for a globally declared variable
<p>I am a beginer to javascript.I have a doubt.my code is given bellow.when i run this the 1st alert box displaying "undefind".i can not understand why?thanks alot..</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; var a = 123; function foo() { alert(a); var a = 890; ...
javascript
[3]
673,749
673,750
play selected songs
<p>I have a reqiurement, I need to play multiple audio songson ASP.Net page.Can anyone suggest the best way to implement this.</p> <p>I have page. There I will display the list of the songs in grid view. The gridview contains checkboxes and songs name. User should able to select the multiple check boxes and click play...
asp.net
[9]
5,740,896
5,740,897
Parsing images through php - issue with duplicates
<p>So, this is the only issue I am having left to fix on my site. When it fetches a post from the database and is then called to parse/replace the URL as a it has a problem. The problem is only with duplicates or image names containing a space in them.</p> <pre><code>$result = mysql_query("SELECT * FROM posts ORDER B...
php
[2]
1,873,615
1,873,616
PHP: calculating the average 3
<p>Im working on a star rating (5 stars is best, 1 is bad), and i have 4 records of 4 users voted.</p> <pre><code>user1: 3 user2: 4 user3: 5 user4: 3 </code></pre> <p>How can i calculate out the average of this in php?</p> <p>Is it just simple math, $count = $user1 + $user2 + $user3 + $user4/4 ?</p> <p>I tried:</p>...
php
[2]
3,312,187
3,312,188
Can someone explain the difference to me between the different .stop() properties in jQuery?
<p>I've read the API documentation on .stop()... <a href="http://api.jquery.com/stop/" rel="nofollow">http://api.jquery.com/stop/</a></p> <p>But I'm still confused as to the difference between the following:</p> <pre><code>.stop(false, false) .stop(true, false) .stop(false, true) .stop(true, true) </code></pre> <p>C...
jquery
[5]
2,837,942
2,837,943
Don't fire onfocus when selecting text?
<p>I'm writing a JavaScript chatting application, but I'm running into a minor problem.</p> <p>Here is the HTML structure:</p> <pre><code>&lt;div id="chat"&gt; &lt;div id="messages"&gt;&lt;/div&gt; &lt;textarea&gt;&lt;/textarea&gt; &lt;/div&gt; </code></pre> <p>When the user clicks/focuses on the chat box, I...
javascript
[3]
2,757,658
2,757,659
jquery plugin which puts a transparent overlay over a div with a loader in the center
<p>I'm looking for a jquery plugin as described in the title and it has to be cross browser compatible.</p> <p>Any ideas?</p> <p>Thanks</p>
jquery
[5]
1,342,444
1,342,445
why are concrete types rarely useful as bases for further derivation
<p>I read "Concrete types are rarely useful as bases for further derivation"------------ Stroustrup p. 768</p> <p>How to interpret this? Does it mean that we should get derived class from the base class with pure virtual function? However, I see a lot of code with derived class derived from concrete types.</p> <p>Can...
c++
[6]
3,992,579
3,992,580
Facebook share button for website
<p>i need to use share button in my website. Different share button for different products.. mostly we need to use like this,</p> <pre><code>http://www.facebook.com/sharer.php? </code></pre> <p>In the above url what are all the parameters we need to pass for showing it as our website, product and some image of that p...
php
[2]
557,222
557,223
jQuery not comparing variables correctly in table cells
<p>I have a table like this:</p> <pre><code>&lt;table id="comparison"&gt; &lt;tr&gt; &lt;th&gt;Hotels&lt;/th&gt; &lt;th&gt;Jan 2013&lt;/th&gt; &lt;th&gt;Feb 2013&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Lorem Ipsum Hotel&lt;/td&gt; &lt;td&gt; &lt;div c...
jquery
[5]
1,905,132
1,905,133
Gridview binding without using a Database
<p>Can a GridView be bound to a List&lt;>?</p> <p>I want to create a Master Details scenario. So The first List&lt;> contains Master data and the second Child data. When the user clicks on the Master Data, the child data, should appear in a pop.</p> <p>Is that possible? Please share some code.</p>
asp.net
[9]
5,140,615
5,140,616
Python mulitple inheritence property
<p>In the following code C is inherited from A and B so when c.get() is get which classes get method is called can anyone explain this.....</p> <pre><code>class A: def get(self): print "In A get" class B: def get(self): print "In B get" class C(A,B): def __init__(self): print "In c init" c=C() c.g...
python
[7]
4,529,335
4,529,336
Variable content is different upon content-type
<p>Upon transfering my site from one server to another, some functions started behaving differently.</p> <p>The problem lies in building my rss feed. My feed are composed of database posts containing html, and to show them correctly in the feed I then need to change the picture paths to full domain paths, instead of j...
php
[2]
5,351,234
5,351,235
What's the best way to force the user of a C++ function to acknowledge the semantic meaning of parameters that are numerical constants?
<p>I'd like to write function interfaces that force the user to acknowledge the semantic meaning of built-in constants. For example, I'd like to take</p> <pre><code>void rotate(float angle); // Rotate the world by an angle in radians. </code></pre> <p>and change it to</p> <pre><code>void rotate(Radians angle); </cod...
c++
[6]
5,344,355
5,344,356
How do you trim the BigDecimal division results
<pre><code>BigDecimal numerator = new BigDecimal(numerator); BigDecimal denominator = new BigDecimal(denominator); double result = numerator.divide(denominator).doubleValue(); </code></pre> <p>Division on certain conditions results in a zero at the end <code>(e.g. 0.0060)</code>. Dividing equal numbers results in a z...
java
[1]
5,302,117
5,302,118
when to declare an member of class
<p>According to Bjarne Stroustrup:</p> <blockquote> <p>if (and only if) you use an initialized member in away that requires it to be stored as an oject in memory ,the member must be(uniquely) defined somewhere. The initializer may not be repeated.</p> </blockquote> <p>(<em>The C++ Programming Language, 3rd Edition<...
c++
[6]
3,313,266
3,313,267
Code for finding string between "" in a data structure
<p>I need help to solve the following:</p> <p>Lets say I have the number 70368 in int var and that I want to find the corresponding string "EVT_ACP_CAPT_MIC_FLT" in the structure below and load it ( including the "") to a char* event variable</p> <p>The code solution must work for any number lenght between 1 to 5.</...
c++
[6]
5,220,143
5,220,144
Using $_POST information only once
<p>I have some information which gets passed from a form and needs to be used once and only once. I can collect it nicely from $_POST but I'm not sure which is the "best" way to ensure that I can only use it once, i.e. I want to avoid the user pressing F5 repeatedly and accessing the function more than once. </p> <p...
php
[2]
2,272,398
2,272,399
Trying to reassign and output new set values in Java
<p>I am trying to create a fun Java "Gibberish Translator" for my little brother. He is mentally disabled and I believe he will get a kick out of this. :) I know how to accept input and how to display output. What I am wanting to do, however, is far above my Java knowledge. (If it is even at all possible.) I am hoping ...
java
[1]
1,527,104
1,527,105
How to initialize the custom Widget in kindo grid TD(grid cell)?
<p>I have a jQuery Custom widget, how to initialize that widget in Kendo Grid cell using the template?</p> <p>This is my Template</p> <pre><code>&lt;script id="IDCOL-tmpl" type="text/x-kendo-tmpl"&gt; &lt;div class="IDCOL"&gt; &lt;script type="text/javascript"&gt; $('...
jquery
[5]
3,009,986
3,009,987
jQuery plugin: character count for textareas
<p>i am using the below plugin for counting the char in the textarea but the only feature i would like to add is that when the character is exceed the limit then it should stop and not allow any more characters to be entered.. so should i just return when it match the allowed character?</p> <p>below is the sample link...
jquery
[5]
5,338,942
5,338,943
Checking for secure network in C#
<p>I have an application that uploads sensitive information over the network. The information is encrypted, but I do not want the data to be uploaded over non-secured, or WEP secured wireless networks. How can I check for this?</p>
c#
[0]
1,805,288
1,805,289
Using foreign keys and ContactsContract
<p>I'm building an app where I need the user to select some "favorite" contacts and a phone number. I'm able to select a contact using </p> <pre><code> startActivityForResult(new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI), PICK_CONTACT_REQUEST); </code></pre> <p>and I'm able to extract all the information I ...
android
[4]
4,456,555
4,456,556
jquery tab not working
<p>i am creating the tab by jquery and my code is bellow</p> <p>jquery</p> <pre><code>$("document").ready(function() { $("#tabs").tabs(); }); </code></pre> <p>and the html</p> <pre><code>&lt;div id="tabs"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#tabs-1"&gt;Nunc tincidunt&lt;/a&gt;&lt;/li&gt; &lt;li...
jquery
[5]
1,153,524
1,153,525
Dictionary values by reference
<p>In our application we have some strings coming from translation that can contain variables. For example in <code>Can i have a {beverage}?</code> the <code>{beverage}</code> part should be replaced with a variable. My current implementation works by having a Dictionary of the name and value of all variables, and jus...
c#
[0]
2,397,415
2,397,416
Prevent Direct Access To PHP File
<p>Let's say I have two domains: <em>domainA.com</em> and <em>domainB.com</em>. On <em>domainB.com</em> im going to use an iframe to access a PHP file on <em>domainA.com</em>. </p> <p>Is there a way I can set an <code>if/else</code> statement so that no user can access that PHP file by going to <code>domainA.com/file....
php
[2]
2,588,244
2,588,245
Cos(90) returning a value very close to 0, but I need 0?
<p>The values for temp_x_btm_left = 0 &amp; temp_y_btm_left=1;</p> <pre><code>angle = 90; //Moving the bottom left coordinates _btm_left.real() = (temp_x_btm_left * cos(angle*PI/180)) - (temp_y_btm_left * sin(angle*PI/180)); _btm_left.imag() = (temp_x_btm_left * sin(angle*PI/180)) ...
c++
[6]
3,076,220
3,076,221
why use an 'apply' function in this situation?
<p>in Chrome's console,</p> <pre><code>&gt; $$ bound: function () { return document.querySelectorAll.apply(document, arguments) } </code></pre> <p>why is this code like this? what's difference with </p> <pre><code> return document.querySelectorAll(arguments) </code></pre> <p>?</p>
javascript
[3]
4,043,987
4,043,988
How to create list of horizontal image galleries in a vertical Listview in android..?
<p>Thanks in advance..</p> <pre><code>I have a task like creating list of image (Horizontal)galleries in an vertical listview in android. </code></pre> <p>I spend so much time but i didn't get any idea on that.</p> <p>For the required screen please check the link as a reference :</p> <p><a href="http://www.appbrain...
android
[4]
869,990
869,991
pass Socket , ObjectInputStream , ObjectOutputStream between Activites
<p>I have 2 Activities in my client/server project:<br> 1 - login (openning connection)<br> 2 - Handeling the game. </p> <p>i tired passing Socket , ObjectInputStream , ObjectOutputStream objects with Intenet and startActivity but it can pass only serializable objects.<br> how can i pass this objects ?<br> i read t...
android
[4]
4,166,530
4,166,531
MySQL select using an array
<p>I edit my code working good but still one problem ... the data that selected from my database and displayed in my suggestion input ( only one row and last ID ) !!! How can I do it to display all data rows from my database ???? </p> <pre><code>&lt;?php $q = strtolower($_GET["q"]); if (!$q) return; $host = "local...
php
[2]
4,819,177
4,819,178
Make Div appear after scrolling past the bend
<p>I want replicate the technique used in the site below so that after the viewer scrolls past the fold, a div is automatically displayed.</p> <p><a href="http://www.talentgarden.it/it/#!/home" rel="nofollow">http://www.talentgarden.it/it/#!/home</a></p> <p>I am familiar with hiding divs using jquery and using the sc...
jquery
[5]
464,019
464,020
jQuery - Get child input based on name selector
<p>I've got an onclick event which is calling a function, passing the current div:</p> <pre><code>&lt;div onclick="deleteline($(this));"&gt; </code></pre> <p>In my deleteline function, how do I get a child of the parent of $(this) where the name contains Qty?</p> <p>In this example I'm looking to get the ProdQty inp...
jquery
[5]
6,016,073
6,016,074
Javascript random number
<p>I need to generate a number between 0-15 and there after add or substract that number to make:</p> <p>Spring/ fall between -5 - 10 Summer between 10 - 25 Winter between -20 - -5</p> <p>After that I would like to link 4 different CSS - styles that matches these numbers. For example when it's summer the numbers shou...
javascript
[3]