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,239,049
4,239,050
Progressbar Android: default color
<p>Hi i used the default horizontal bar. It looks exactly the same in all the devices except in android version 4.0.3 it shows up completely in white color. The progress color is fine but the background of the bar shows up white any idea why only on 4.0.3? Note that my build version is 2.2 and the theme i am using is T...
android
[4]
5,983,433
5,983,434
Why can I call a non-const member function pointer from a const method?
<p>A co-worker asked about some code like this that originally had templates in it.</p> <p>I have removed the templates, but the core question remains: why does this compile OK?</p> <pre><code>#include &lt;iostream&gt; class X { public: void foo() { std::cout &lt;&lt; "Here\n"; } }; typedef void (X::*XFUNC)() ...
c++
[6]
3,365,240
3,365,241
textarea to database including <p>
<p>I receive a large chunk of text in a text area. Usually it's divided into a few paragraphs. How can I wrap these paragraphs in <code>&lt;p&gt;</code> tags so the text will be formatted the same when I read it out of the database again?</p>
php
[2]
3,082,855
3,082,856
Static field initializer runs before Application_start, sometimes
<p>I've got an ASP.NET web app that is starting to show some very strange behavior. Here's some example code:</p> <pre><code>// in Bar.cs public class Bar { public static Baz baz = Something.Step2(); } // in Global.asax public void Application_Start(...) { Something.Step1(); } </code></pre> <p>The short vers...
asp.net
[9]
115,351
115,352
NSURLConnection connectionDidFinishLoading called before all file is downloaded
<p>I am using NSURLConnection to download a zipped file from a web service. In the didReceiveData I append the data to a file and using a good internet connection all appears to work correctly. The file is transparently unzipped as it is downloaded. If, however, I have a poor internet connection the connectionDidFinis...
iphone
[8]
2,981,642
2,981,643
Any solution for response.redirect in a user control
<p>I am using the Response.Redirect method in a User Control to allow visitors to click an ImageButton to take them to another page. However, when I click the ImageButton I recieve the following error:</p> <p>Object reference not set to an instance of an object.</p> <p>Description: An unhandled exception occurred dur...
asp.net
[9]
484,073
484,074
Changing current version of Java within Windows
<p>I'm working in a Windows XP environment and have recently installed java 1.6 because it was required by an application. </p> <p>However I don't want this to be the default version of java to be used. How do I set it so that the command java -version will return 1.5.x</p>
java
[1]
5,805,524
5,805,525
Adding double quotes in <a> using C#
<p>I have below code behind in c# </p> <pre><code> if (Session["cmpDictionaryTitle"]!= null) { downloadLinks.Text += @"&lt;li&gt;&lt;a onclick='pageTracker._trackEvent('dictionary', 'spanish');' target ='_blank' href=" + Session["cmpDictionaryTitle"] + "&gt;" + GetResour...
c#
[0]
3,805,273
3,805,274
Assert behaviour in java?
<p>I am getting compilation error in Line 3, Is it any special case for asserts in java ? i am not sure why it's expecting some return type from methodB() , can somebody help me here ? Thanks</p> <pre><code>public class AssertTest { public void methodA(int i) { assert i &gt;= 0 : methodB(); System....
java
[1]
3,947,455
3,947,456
Replace first character of string
<p>I have a string <code>|0|0|0|0</code></p> <p>but it needs to be <code>0|0|0|0</code></p> <p>How do I replace the first character (<code>'|'</code>) with (<code>''</code>). eg <code>replace('|','')</code></p> <p>(with JavaScript)</p>
javascript
[3]
440,993
440,994
How to implement dynamic element container in C++
<p>Given the following prototype, is it possible to implement it in C++? I am looking for resources(books, web) that can give me some concrete ideas to implement it in C++.</p> <pre><code>class Container { public: vector&lt;Element&gt; getElementsByCategory(Category _cate); bool AddElement(Element _element...
c++
[6]
783,483
783,484
About return in C++
<p>Sorry for this newbie question, but I can't find on google what I need to know.</p> <p>I understand <em>return</em>, but don't understand this... What does it mean this?</p> <pre><code> return (tail+1)%N == head%N; </code></pre> <p>Thanks a lot for patience.</p>
c++
[6]
231,581
231,582
Pulling a string (link) from file_get_contents?
<p>So, I just got home from work and my mind's dead, but let me see if I have this right..</p> <p>Write <code>file_get_contents(website)</code> to a variable. Use <code>strstr</code> to determine where the string first occurs. Use <code>strpos</code> to determine the exact position, write the position to another varia...
php
[2]
4,816,410
4,816,411
Definition of ONE asp.net application?
<p>How do you define <strong>ONE</strong> asp.net application? Does it have to be built under one solution or does it have to be deployed under one application under IIS? </p> <p>Can multiple web projects be deployed under one IIS application (so that they have access to each other's session, cache etc) ?</p> <p>This...
asp.net
[9]
5,425,666
5,425,667
how to parse $_REQUEST?
<p>here i am checking for and getting part of the request, (the ids). i also print out the entire request:</p> <pre><code>if (isset($_REQUEST['ids'])){ $amount = sizeof($_REQUEST['ids']); print_r($_REQUEST); echo "&lt;br&gt;$amount invitations Successfully Sent"; } </code></pre> <p>this is how the entire...
php
[2]
4,356,060
4,356,061
Tracking visitors to help support
<p>I am looking to find a way to gain information about how my visitors are going through my website and if they come across any errors, the errors are known along with the information about the visitor, so when they email for support I will have this information available. I don't want to be thought of spying on the v...
php
[2]
607,128
607,129
Removing frames
<p>I am trying to reorganize a site. There are some frame pages which I would like to remove as the same result can be achieved with less overhead. However, the frame below:</p> <pre><code>&lt;frame name="right" src="/PageTurn/BrowsePub.aspx? PublicationID=&lt;%=PubID%&gt;&amp;RunDate=&lt;%=Server.URLEncode(PubDate)...
asp.net
[9]
5,739,593
5,739,594
JS Create A Date Object from value passed via AJAX Call
<p>I have a Python script that returns me a calculated date time in XML format like below:</p> <pre><code>&lt;prev&gt;&lt;date&gt;2012,07,16&lt;/date&gt;&lt;time&gt;22:00:00&lt;/time&gt;&lt;/prev&gt; </code></pre> <p>Though I can change the format but my issue is that when I try creating a JS date object using the va...
javascript
[3]
3,849,134
3,849,135
C++ converting string to time_t question
<p>Im trying to convert a string such as "12 August 2011" into time_t or that seconds elapsed, or whatever so I can use it to compare a list of dates.</p> <p>At the moment, I have tried the following but the output seems to equal false! Also, the seconds elapsed seem to keep changing?</p> <p>Is this correct?</p> <pr...
c++
[6]
1,335,706
1,335,707
removeClass jquery statement not working
<p>I have the following JQuery statement and it is adding the class 'current' but it is not removing the class form the siblings.</p> <p>Any ideas why?</p> <pre><code>$('.page_link[longdesc=' + page_num + ']') .addClass('current').siblings('.current').removeClass('current'); </code></pre> <p>Malcolm</p>
jquery
[5]
3,826,465
3,826,466
Search through an openoffice spread sheet
<p>So I have my program now opening an openoffice spreadsheet. I need it to search for a sting and give me the row and column. I don't know what I would use to search the spreadsheet. </p>
java
[1]
4,897,933
4,897,934
Short circuit evaluation assignment in python?
<p>Ruby supports this:</p> <pre><code>name = name || "default" </code></pre> <p>If I try it in python: </p> <pre><code>name = name or "default" </code></pre> <p>Interpreter reports:</p> <pre><code>NameError: name 'name' is not defined </code></pre> <p>What is the equivalent of the short circuit evaluation assignm...
python
[7]
202,123
202,124
How to find invoked element without passing this
<p>I have a Javascript function called many times from many pages. </p> <p>Inside this function I have to check the element which is invoked this function.</p> <p>I know a method to pass 'this' with the function call. I cannot use that method. Because I am working only on a single module. There are many other module...
javascript
[3]
4,424,916
4,424,917
How to give a value of 1 to a textbox with a class
<p>I want to know if the code below removes all <code>input type='text'</code> values back to <code>""</code>:</p> <pre><code>var inp = document.getElementsByTagName('input'); for (var i = inp.length - 1; i &gt;= 0; i--) { if ('text' === inp[i].type) inp[i].value = ""; } </code></pre> <p>Then I want to know if I ...
javascript
[3]
1,071,481
1,071,482
Android app version targeting
<p>If I target my android app for version 2.2, will my app work on further versions (2.3 / 3.0 / 3.1 / 3.2 / 4.0) phones without errors?</p>
android
[4]
3,061,430
3,061,431
ASP.NET Application Daytime Release
<p>We have an Intranet with about 300 users whom actively use it thoroughly during the day. We need to be able to release a precompiled version of the application during the day as users usually give us incorrect requirements and then need it that day. At the moment we release a non-precompiled version and let the we...
asp.net
[9]
180,326
180,327
PHP redirect isn't working for some reason
<p>I'm trying to redirect this PHP page to another page as soon as I get successful update in the database .. but I get a warning from PHP and nothing happens .. Below is the code .. Where did I go wrong ?</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&g...
php
[2]
13,639
13,640
python: Is this a wrong way to remove an element from a dict?
<p>I use this way to remove an emelment from a dict:</p> <pre><code> d["ele"] = data ... d["ele"] = None </code></pre> <p>I think by this I can remove the reference on the original element so that the removed data can be freed, no memory leak.</p> <p>Is it the right way to do this?</p>
python
[7]
3,424,947
3,424,948
a question related to sqlite
<p>hi i have 1 update query in db and it is by use of sqlite</p> <pre><code>int success = SQLITE_STEP(insert_statement); </code></pre> <p>i get success value 21</p> <p>what s meaningof it?</p>
iphone
[8]
4,249,906
4,249,907
Popen remote commands
<p>Looking to run the command: ssh user@some_host "echo 'some_sql' | /usr/bin/mysql -u some_args"</p> <p>How would I do this using Popen?</p> <pre><code>p1 = sp.Popen(["ssh", "user@some_host", "echo \"%s\"" % sql], stdout=sp.PIPE) p2 = sp.Popen(["/usr/bin/mysql", "-u some_args"], stdin=p1.stdout, stdout=sp.PIPE) </co...
python
[7]
3,162,123
3,162,124
Adding a Class to PHP Menus
<p>I have a small php website that has a menu that is included via include_once. I need an HTML class added to the current menu item for each page. </p> <p>So if a user clicks on a link and goes to that page the new page will load with the new menu item with class="current". How can I go about doing this?</p>
php
[2]
2,800,316
2,800,317
Is it possibile to write on a file put into an apk?
<p>Is it possibile to write on a file (for instance a .txt) put into an apk? When a user close my app, i'd like to write something on a file and then read it when my app is re-opened.</p>
android
[4]
655,971
655,972
Wrap the content of text view in java code in android
<p>I am dynamically creating layout and text view in android. If the text view content is large, how to wrap the content of text view dynamically? </p>
android
[4]
4,662,275
4,662,276
div background based on % in Jquery
<p>I have this in my html. I want to apply the background dynamically based on %.</p> <p>If I pass 30, the 30% of the div should be green. If it's 60, 60% of the div should be green</p> <pre><code> &lt;div id="progress_bar" class="meter-bg"&gt; by default white &lt;/div&gt; </code></pre> <p>by default...
jquery
[5]
5,507,642
5,507,643
Is there a Math3d function to multiply a vertex array with a 4x4 matrix?
<p>I've looked at the source code and I haven't found anything, but I want to be shure, just in case. Is there any math3d function that takes a vertex array and multiplies it by a m3dmatrix44f? </p>
c++
[6]
69,205
69,206
Handwriting Recognition Application in Android
<p>I'm working on a application for handwriting recognition,ie, the user draws their character into the screen,and then that particular alphabet is generated automatically.</p> <p>The approach I'm taking(after a reading from <a href="http://drdobbs.com/security/184408923?pgno=2" rel="nofollow">here</a>),is to first tr...
android
[4]
148,676
148,677
Anyway of getting am/pm from time?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2605470/displaying-the-time-in-am-pm-format-in-android">Displaying the Time in AM/PM format in android</a> </p> </blockquote> <p>I can get the time and turn it into string using:</p> <pre><code>public static fi...
android
[4]
5,310,762
5,310,763
PHP login cookies security
<p>In most of past questions on SO about security in 'Remember me' feature in login systems, <a href="http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/" rel="nofollow">Persistent Login Cookie Best Practice</a> is suggested.</p> <p>If I understand correctly, this approach goes like this:</p...
php
[2]
3,825,901
3,825,902
TypeError: object not callable when making instance
<p>I've searched around other threads with similar questions, but I'm not finding the answer. Basically, I have a class:</p> <pre><code>import Android_Class class Android_Revision(object): def __init__(self): # dict for storing the classes in this revision # (format {name : classObject}): ...
python
[7]
1,936,344
1,936,345
Open setting area in IOS 5.1
<p>how can i open setting area of iphone in objective c iphone app in ios 5.1?</p> <p>In IOS 5.0, It's working fine but in IOS 5.1 It is not working.</p> <pre><code> [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=General&amp;path=Network"]]; </code></pre> <p>Please provide me a link of ...
iphone
[8]
4,555,559
4,555,560
PHP how to limit lines in a string?
<p>i have a variable like the following and i want a function to only keep the first 20 lines, so it will strips any additional \n lines more than 20.</p> <pre><code>&lt;?php $mytext="Line1 Line2 Line3 ....." keeptwentyline($mytext); ?&gt; </code></pre>
php
[2]
4,838,027
4,838,028
define a local and live environment path
<p>I'm using a form to upload files into a specific upload folder. Now, in my local development environment, the local folder is harcoded in a variable like this</p> <pre><code>$destination = 'c:/public_html/discography/artwork/'; </code></pre> <p>Once the script is completed and ready to be moved in the live environ...
php
[2]
2,377,654
2,377,655
Open 2 windows javascript
<p>How do I use javascript to redirect the current page and also open another popup window! would that be possible? is there a risk? thank you</p> <p>Update: </p> <pre><code> I am trying now to: var myid= "&lt;xsl:value-of select="@ID" /&gt;" which works for document.location.href = http://... + myid but w...
javascript
[3]
2,591,961
2,591,962
How do we find the width of scroll bar?
<p>Do you know any cross-browser methods?</p>
javascript
[3]
5,175,371
5,175,372
what does .attr('name',$this.attr('name')) mean?
<p>Somebody posted me this code to me with a problem I had:</p> <pre><code> $('#txtWeight').each( function() { var $this = $(this); var $weightText = $("&lt;input type='text' class='txtWeightRow' maxlength='5' onkeypress='return isNumberKey(event)'/&gt;").attr('name',$this.attr('name')) .at...
jquery
[5]
5,372,761
5,372,762
Cannot set property 'innerHTML' of null
<p>In google chrome Console, the error showing is</p> <p><strong>Uncaught TypeError: Cannot set property 'innerHTML' of null</strong> </p> <pre><code>var description=["a","b","c","d","e"]; var count=1; document.getElementById("productdescription").innerHTML = description[count-1]; </code></pre> <p>I am calling th...
javascript
[3]
3,737,104
3,737,105
What's the quickest way to output the list<String> as space seperated list
<pre><code>List&lt;String&gt; test </code></pre> <p>which contains several items,</p> <p>what would be the quickest way to output a string as "item1 item2 item3"?</p>
java
[1]
1,829,178
1,829,179
Jquery finding firrt element of specific class
<p>I am using jquery to find a first element having a class "error" applied to it using the below code</p> <pre><code>$('#mainDiv input.error:eq(0)') </code></pre> <p>But the above one working only for input elements only. How to make this one to work for both input and select elements?</p>
jquery
[5]
2,662,620
2,662,621
Android: strecthing background
<p>I want to have a gradient on my app background. The picture is only ten pixels wide and I would like it to repeat horizontally. Then I have the background set to the color where the gradient ends vertically. In CSS I could easily do this by this code:</p> <pre><code>background: url("bg.png") repeat-x #0f0f0f; </cod...
android
[4]
1,463,484
1,463,485
Why doesn't JQuery's removeAttr always work?
<p>When trying to see why removeAttr doesn't always seem to work I tried. </p> <pre><code>$("div#mydiv").css('height','200px'); $("table").removeAttr("border"); $("#mydiv").removeAttr("height"); </code></pre> <p>The table borders attribute is removed OK but not the div height attribute. I need to use other sug...
jquery
[5]
5,847,342
5,847,343
How should I set up configs in PHP that can be accessed in includes?
<p>I'm building a PHP application and I'm not quite sure how to store global configuration settings that can be truely accessed anywhere - it seems that content that <strong>is</strong> included cannot access other content included from the main, starting page. For example, if index.php includes foo.php and bar.php, ba...
php
[2]
1,618,718
1,618,719
URLConnection.getContentLength() returns -1
<p>I have a URL which, when I enter in browser, opens the image perfectly. But when I try the following code, I get getContentLength() as -1:</p> <pre><code>URL url = new URL(imageUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); // determine the image size and allocate a buffer int fileS...
android
[4]
380,725
380,726
Limited number of results in Google Search using Python
<p>I am trying to do a custom google search from python. I found the relevant code at <a href="https://developers.google.com/web-search/docs/#fonje" rel="nofollow">developer.google.com</a>.</p> <p>My Code:</p> <pre><code>url = ('https://ajax.googleapis.com/ajax/services/search/web' '?v=1.0&amp;q=teen%20wolf%20...
python
[7]
4,596,388
4,596,389
How to exit a Windows Forms Application in C#
<p>I'm writing a Windows Forms Application in C# that uses only 1 form. When I want to exit and close the application, I put the code</p> <pre><code> private void Defeat() { MessageBox.Show("Goodbye"); this.Close(); } </code></pre> <p>Inside the class <code>Form1 : Form</code>, which is the...
c#
[0]
1,727,063
1,727,064
How to enforce EditText to start text in capital letter?
<p>I have an <code>EditText</code> and I need the text in it (when user types in) to be started with capital letter.</p>
android
[4]
4,415,639
4,415,640
Accessing variables and methods across threads
<p>I am using java to create an interface to connect to a database. Each time I want to make a call to the database I need to create new connections to the database, which would make calling the database say 10 times slow.</p> <p>To avoid having to create new connections each time I want to call the database I have a ...
java
[1]
317,673
317,674
Splitting a large object into multiple smaller byte arrays
<p>I have a huge POJO (1G - 6G) that I want to split into multiple byte arrays of 100Kb each. My algo currently is as follows:</p> <ol> <li>serialize the large object to a large byte[] I.e. 1G object to 1G byte[]</li> <li>Split the large byte[] into smaller 100k byte[]</li> </ol> <p>However this creates a lot of memo...
java
[1]
2,516,509
2,516,510
IPhone picture gallery source code
<p>HI all can anyone please refer me, the iphone image gallery source code? Any link ,sample code will be great help.</p> <p>i am trying to show some 70 to 100 images as thumbnails , and on selecting any image, it should give a full view of that image,i am trying to accomplish, whatever is in iphone's picture galle...
iphone
[8]
54,112
54,113
Access by one client at a time
<p>My requirements are as follows.</p> <p>I have a web application developed in java.</p> <p>I have a link in the html page. When the first client clicks submit button in the html page the batch file should run.</p> <p>Meanwhile when the other client clicks the submit button he should get message that the page is bu...
java
[1]
1,096,209
1,096,210
How to check whether a field has been declared or not?
<p>Here is my code:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt; JS Test &lt;/title&gt; &lt;script type="text/javascrip...
javascript
[3]
4,333,608
4,333,609
Setting default APN
<p>I want set an default apn in android gingerbread. Any1 know the solution please try to help me.</p>
android
[4]
2,911,528
2,911,529
jquery ajax request cached
<p>when i request something via ajax if the input is the search the content seems to be cached? do i add a random number at the end of my query?</p> <p>/search?input=test</p> <p>to</p> <p>/search?input=test&amp;random=283928392</p> <p>i think this would solve my problem. right? how do i write this in javascript</p>...
jquery
[5]
3,268,207
3,268,208
PHP encrypt password before storing it to database
<p>I found the following example on php.net to secure password before storing it. However, I don't quite understand line 3. Could someone explain this a little bit? Thanks! </p> <pre><code>1 &lt;?php 2 $password = crypt('mypassword'); // let the salt be automatically generated 3 if (crypt($user_input, $password) ==...
php
[2]
1,466,003
1,466,004
Android: automatic animation
<p>I have a Button that needs to be slide in from the bottom automatically after the activity starts for 5 seconds. How do I do that? There shouldn't be any user intervention (Should be done without click).</p> <p>Thanks</p>
android
[4]
4,092,443
4,092,444
C++ - Timezone conversion
<p>I've the following piece of code to find the difference between the UTC and local time zone. </p> <pre><code>struct tm *local_time, *gmt_time; time_t t = time(NULL); local_time = localtime(&amp;t); gmt_time = gmtime(&amp;t); int y = mktime(local_time); int x = mktime(gmt_time); tzone_...
c++
[6]
1,696,429
1,696,430
Python - print bold text
<p>How to print bold text in python?</p> <p>for example:</p> <pre><code>print "hello" </code></pre> <p>what's the code that enables the text "hello" to be displayed in bold?</p> <p>thanks.</p>
python
[7]
5,735,088
5,735,089
Drawing an image is completely out
<p>Hi I'm using this code below to let a user "draw" their signature on a UIView component on my app:</p> <pre><code> UIGraphicsBeginImageContext(signature.frame.size); [drawImage.image drawInRect:CGRectMake(0, 0, signature.frame.size.width, signature.frame.size.height)]; CGContextSetLineCap(UIGraphicsGetCu...
iphone
[8]
1,900,957
1,900,958
How can I add stringbuilder (semi colon delimited) values to arraylist in C#?
<p>I have a stringbuilder that will look like something close to this smith;rodgers;McCalne etc and I would like to add each value to an arraylist. Does anyone have any C# code to show this?</p> <p>many thanks</p>
c#
[0]
1,106,601
1,106,602
Non-Type parameters for templates
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/499106/what-does-template-unsigned-int-n-mean">What does template &lt;unsigned int N&gt; mean?</a> </p> </blockquote> <p>Hi ! Are non-type template parameters and constants same ? Do the following code work beca...
c++
[6]
3,046,602
3,046,603
calculate the user's month of birth from prompt
<p>Made a start but I need a tad bit of help...</p> <p>I'm trying to take a string/answer from what someones given me via a prompt (question is: what month were you born?), taking the first three letters of the answer, converting that to lowercase, then checking with my variable called 'months', if it exists convert t...
javascript
[3]
803,197
803,198
How to get each Bar CGMutablePathRef in Bar chart created by using Core Plot?
<p>I found below method in existing framework. Can any one please suggest me how can i use this method</p> <p>-(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context recordIndex:(NSUInteger)index</p> <p>Thanks in advance</p>
iphone
[8]
3,223,122
3,223,123
Javascript newbie : Array.isArray() query
<p>I have been reading that in Javascript :</p> <ul> <li><strong>Everything</strong> is an object (except primitives such as number,string, boolean, null &amp; undefined)</li> <li>Objects can be treated as associative <strong>arrays</strong>.</li> </ul> <p>From what I conclude, Array.isArray() should return true for ...
javascript
[3]
3,037,102
3,037,103
Slow startup of second activity
<p>What should I look when my settings <code>Activity</code> is starting up really slow? Sometimes I get <code>ANR keyDispatch error</code> if it takes to long.</p> <p>Should also say that I am using <code>PreferenceActivity</code>. The absolute first time I go into settings the delay time is really slow (about 5-10 s...
android
[4]
1,085,435
1,085,436
comments post time display concept
<p>I need to display comment post time like facebook .i'm using this code but i dont know how to give mysql database date in this function and display time...can any one help me..</p> <pre><code>function time_since($original) { $chunks = array( array(60 * 60 * 24 * 365 , 'year'), array(60 * 60 * ...
php
[2]
5,712,777
5,712,778
Grab the values from some url using curl concept
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12615733/get-the-inner-text-using-curl-concept-in-php">Get the inner text using curl concept in php</a> </p> </blockquote> <p>code is like this so on .... </p> <pre><code> &lt;ul class="listings"&gt; ...
php
[2]
2,763,172
2,763,173
Collections.addAll, Queue<Integer> and int[]
<p>The following code doesn't work though it seems quite correct:</p> <pre><code>import java.util.*; public class Jaba { public static void main(String args[]) { Random rand = new Random(); int[] array = new int[10]; for (int i = 0; i &lt; array.length; ++i) { array[i] = rand....
java
[1]
2,669,634
2,669,635
Javascript arrays of Objects; Subtract one from another
<p>Put simply, I want to subtract one array from another.</p> <p>The arrays are arrays of objects. I understand I can cycle through one array and on each item, comparing values in the other array, but that just seems a little messy.</p> <p>Thanks for the help, hopefully this question isnt too basic, I have tried goog...
javascript
[3]
2,611,298
2,611,299
Memmory Referene for a HashTable
<p>I have a small question regarding a Hash Table. Suppose i have a String as a key and a complex object as a value stored in a Hash Table. </p> <p>Now i use "get" to obtain the object from the same Hash Table. Now if the variable that i stored the reference of the object that i got from the Hash Table is set to null,...
java
[1]
3,312,148
3,312,149
How to determine what is the super class or an interface of an object
<p>say one of my object implements X interface but is returning false when checking with 'instanceof'. How to determine what is the super class or an interface of an object. I am looking for something like </p> <p>for example:</p> <pre><code>object.getSuperClassORInterface(); </code></pre>
java
[1]
5,314,672
5,314,673
to display username on all aspx pages
<p>How to Dispaly the username on all aspx pages....?</p> <p>Can any one help me in this context.....</p> <p>am thinking that by using "session object" we can able to do this...bt am not sure</p> <p>Can any send the code or links</p>
asp.net
[9]
4,152,537
4,152,538
how keep the radio button position at selected one when changes from portrait to landscape
<p>how andrid radio button code but when changes from portait to landscape selected possition appear plz help me any one</p>
android
[4]
3,028,074
3,028,075
Returning a String from a public String (...) class
<p>here is the code</p> <pre><code>import java.io.*; import java.lang.*; import java.util.*; public class createfile { private Formatter x; Scanner keyboard = new Scanner(System.in); String s1,s2,s3,s4,s5,s6; String aa,bb,cc,dd,ee,ff; public void openFile() { try { ...
java
[1]
4,311,569
4,311,570
Creating a set of sub-sets of size K from a given interval- using Set In Java
<p>I'd love your help with this following problem:</p> <p>I want to write in Java a method that will gets three values: first, last and K, so and creates all the sub-sets of size L of numbers within the bounded interval [first,last],</p> <p>For example: If first=1, last=3 and K=2, so the result will be {1,2},{1,3},{2...
java
[1]
1,598,994
1,598,995
android don't restart thread when orientation changes
<p>my apps was based on this code <a href="http://www.41post.com/4588/programming/android-coding-a-loading-screen-part-1" rel="nofollow">http://www.41post.com/4588/programming/android-coding-a-loading-screen-part-1</a> .on the doInBackground my app will connect to the internet and download some data and populate the da...
android
[4]
599,870
599,871
How can I assign the contents of a form text field?
<p>How can I assign the contents of a form text field called "username" which is in the first form in a document to a variable called "thename"</p>
javascript
[3]
1,335,271
1,335,272
Why you can create class self intance in class's main method
<p>Why you can do this in C#?</p> <pre><code>class Test { static void Main() { Test test = new Test(); } } </code></pre>
c#
[0]
4,548,886
4,548,887
select tag in php and get href
<p>i want <strong>get all link in page by class "page1" in php</strong>. the same code in jquery </p> <pre><code>$("a#page1").echo(function() { }); </code></pre> <p>can do that in php?</p> <pre><code>$pattern = '`.*?((http|ftp)://[\w#$&amp;+,\/:;=?@%.-]+)[^\w#$&amp;+,\/:;=?@%.-]*?`i'; preg_match_all($pattern,$page_g...
php
[2]
5,128,341
5,128,342
Why different behaviors between running Python module as an executable vs. Python [filename]
<p>So, I created a simple python module, test.py</p> <pre><code>import commands def main(): cmd = 'ls -l' (status, output) = commands.getstatusoutput(cmd) print status, output if __name__ == '__main__': main() </code></pre> <p>When I ran it using "Python test.py", I got the result that I expected. But when ...
python
[7]
3,172,106
3,172,107
FragmentTransaction: ReplaceFragment
<p>I'm making a simple application to understand Fragments in android. Everything seems simple, except one i.e. I added multiple fragments dynamcially in a LeniarLayout. It worked fine, but now when <strong>I try to call replace on that container layout with some other fragment , it doesn't removes all the previously ...
android
[4]
104,762
104,763
how to redirect in other page when browser close event called
<p>I want to redirect in another page when browser is closed. My code is following:</p> <pre><code>&lt;script language="Javascript"&gt; var needToConfirm = true; window.onbeforeunload = confirmExit; function confirmExit(){ if (needToConfirm){ my_window = window.open ("1.html","mywindow1","status=1,width=350,he...
javascript
[3]
4,306,445
4,306,446
how to get cursor from one activity to another activity
<p>hi i need cursor value from one activity to another but its display null. </p> <pre><code>public class TitleActivity extends ListActivity { /** Called when the activity is first created. */ public Cursor titleCursor = null; public String blogid; public String language; public String titleRowid; public String rowid;...
android
[4]
3,260,327
3,260,328
How to use a CSS class on all table elements within an application
<p>I've realised that I'm going to need to use a css class on all tables within my application.</p> <pre><code> &lt;table id="tblSearch" class="eFoo-text" </code></pre> <p>The problem is that I've got lots of pages, which contain lots of user controls.</p> <p>Luckly they all inherit from a single master page. Is the...
asp.net
[9]
98,157
98,158
jQuery: Button enable is not working
<p>My jsfiddle is here- <a href="http://jsfiddle.net/hhimanshu/HVRLA/" rel="nofollow">http://jsfiddle.net/hhimanshu/HVRLA/</a></p> <p><strong>Need</strong><br> - As soon as text is entered the "create" button should enable<br> - if there is no text(text length = 0), "create" button should be disabled again </p> <p><...
jquery
[5]
781,024
781,025
How can i create a webservice which is checking table for some periodically in database in asp.net?
<p>I wanted to checking my database table for periodically.So how can i create a webservice and how can i configure it.</p>
asp.net
[9]
3,939,968
3,939,969
Using $this within $.ajax inside a function of success
<p>When I use the line below, $(this) inside my jQuery function (example below) it works great.</p> <pre><code>$(this).closest('.item').children('h3').children('a').text('UPDATED'); </code></pre> <p>However, inside the same function I try to then move it within a function of success: area of $.ajax and it no longer w...
jquery
[5]
717,036
717,037
avoid hard coding path in ReadAllText
<p>My exact file path is as follows. This .txt file is not supposed to be deployed to bin/debug</p> <pre><code>string str = File.ReadAllText(@"C:\development\slnfolder\projfolder\myfile.txt"); </code></pre> <p>How can I write the code so that I do not have to hard code full path to get to the file </p> <p>I am tryin...
c#
[0]
4,142,693
4,142,694
Modal Dialog Box working with Mozilla but Not working with Chrome
<p>Hi All I am trying to use modal dialog box in my code. like</p> <p>window.showModalDialog('pageurl');</p> <p>Ideally when a modal dialog box is open one should not be able to go to parent window until it is closed.</p> <p>it is working fine with Mozilla. But in Chrome the one can take control to parent window eve...
javascript
[3]
5,890,579
5,890,580
How can i find out if my app is installed on SD card
<p>I would like something do something like:</p> <pre><code>val cacheDir = if (installedOnSD) { getContext.getExternalCacheDir } else { getContext.getCacheDir } </code></pre> <p>and I am a bit at a loss for the <strong>installedOnSD</strong> part. Can anybody point me to the right direction?</p> <p...
android
[4]
1,226,492
1,226,493
Opposite of array_intersect
<p>I'm looking for the opposite of the function <code>array_intersect</code>, basically a function that returns the element that are <strong>not</strong> present in <strong>each</strong> of the provided arrays. </p> <p>Example:</p> <pre><code>$a1 = array(1, 2, 3); $a2 = array(2, 3, 4); $result = array(1, 4); </code><...
php
[2]
4,250,667
4,250,668
Combining multiple conditions into one in Javascript
<p>How can i shorten this code? I want to return all values except "abc" or "xyz" or "pqr"</p> <pre><code>return this.value != "abc" &amp;&amp; this.value != "xyz" &amp;&amp; this.value != "pqr"; </code></pre>
javascript
[3]