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 |
|---|---|---|---|---|---|
1,775,293 | 1,775,294 | Can anyone explain the following PHP Code? | <p>Can anyone explain the following PHP Code ?</p>
<pre><code>function get_param($param_name, $param_type = 0)
{
global $HTTP_POST_VARS, $HTTP_GET_VARS;
$param_value = "";
if (isset($_POST)) {
if (isset($_POST[$param_name]) && $param_type != GET)
$param_value = $_POST[$par... | php | [2] |
381,945 | 381,946 | noticed variations of %1$s being used in code, cannot google escaped charecters. Please link a resource | <pre><code>String.format("com.dummy.%1$s.", strVarName)
</code></pre>
| java | [1] |
5,325,356 | 5,325,357 | Convert a C# string array to a dictionary | <p>Is there an elegant way of converting this string array:</p>
<pre><code>string[] a = new[] {"name", "Fred", "colour", "green", "sport", "tennis"};
</code></pre>
<p>into a Dictionary such that every two successive elements of the array become one {key, value} pair of the dictionary (I mean {"name" -> "Fred", "colou... | c# | [0] |
3,575,810 | 3,575,811 | if explodable / else | <p>I have a string which may or may not contain commas. If it does, I want it exploded into an array; if it doesn't, I still want the string saved to the new identifier. My code clearly doesn't work. Anyone have any better ideas?</p>
<pre><code>if(explode(",", $_SESSION['shoparea']))
{
$areas = explode(",", $_SESS... | php | [2] |
3,418,740 | 3,418,741 | How can I maintain state in browser JavaScript across different page loads from the same site? | <p>I need to do something very simple, i.e. maintain which panel bar item is highlighted, across different page loads. I'm using this as a menu, and it looks good with the selected menu item highlighted as soon as I click it, when when the link (page) for that menu item returns, the menu is reloaded and I lose this.</p... | javascript | [3] |
4,124,058 | 4,124,059 | java.nio.channels.* | <p>What is up with nio channels ? There were some nice talks when it was added to java but I still don't see people using it in their applications.</p>
<p>Is there something wrong with it, or am I just not encountering people who use it? </p>
<p>Any nice examples as to why I should bother using it at all ?</p>
<p>Th... | java | [1] |
56,269 | 56,270 | return by value assigned to const reference | <p>I was fixing another bug in some code and came across some code that I would have thought was a bug; however, this code compiles under gcc 4.4, 4.5, and 4.6 and appears to function as "expected". Can anyone tell me if this is valid c++?</p>
<pre><code>struct foo {
int bar;
};
foo myfunction(foo const &or... | c++ | [6] |
663,933 | 663,934 | My ASP.NET application is not working on the server, but it works in my development environment. | <p>My ASP.NET application is not working on the server, but it works in my development environment. </p>
<p>How do I go about debugging this? </p>
| asp.net | [9] |
2,847,838 | 2,847,839 | JAVA Getting a nullpointer exception in an "if" statement? | <pre><code>public void display(Date date) {
boolean loop = true;
System.out.println("Events on " + date.toString());
for (int i = 0; i < schedule.length; i++) {
while (loop) {
Date tmp = schedule[i].nextOccurrence();
if (tmp.compareTo(date) == 0) {
Syst... | java | [1] |
4,232,533 | 4,232,534 | Python 2to3 windows CMD | <p>I have installed python 32 package to the </p>
<blockquote>
<p>C:\python32</p>
</blockquote>
<p>I have also set the paths:</p>
<blockquote>
<p>PYTHONPATH | C:\Python32\Lib;C:\Python32\DLLs;C:\Python32\Lib\lib-tk;</p>
<p>PATH ;C:\Python32;</p>
</blockquote>
<p>I would like to use the "2to3" tool, but CMD... | python | [7] |
641,995 | 641,996 | java miliseconds find closest to current time | <p>I have following code </p>
<pre><code>for(int i=0; i<a.length; i++){
diff[i] = a.getTime() - b.getTime();
}
a.getTime() = time in array.
b.getTime() = current time on computer.
</code></pre>
<p>What would be the best way to find which one of a.getTime is nearest to current time?</p>
<p>Output diff:</p>
<... | java | [1] |
3,400,285 | 3,400,286 | Trying to close window after alert | <p>Ok so I have a page that will post info to the database then it returns to a different page. The only thing is now they want the page to auto close once the alert comes up telling them the database stuff has been saved. I have it on a php page under the conditional if statement and then running javascript from there... | javascript | [3] |
4,245,797 | 4,245,798 | What is the quickest way to randomize a data set? | <p>For a multiple choice quiz application i would like to show the dummy answers with the correct answer. But with the correct answer being in a different position at each different question.</p>
<p>This is what i've tried but it doesn't seem to be working:</p>
<pre><code>if ($question->type == 1)
{ ... | php | [2] |
2,744,951 | 2,744,952 | Android handle HTML links and typed links in a TextView | <p>I am trying to handle both HTML and typed links in TextViews and I am unable to find a combination of the built in tools to do this. I can make one or the other work but not both.</p>
<p>Given the following formats</p>
<pre><code>http://google.com
<a href="http://google.com/">Google!</a>
</code></pre>
... | android | [4] |
633,405 | 633,406 | javascript date.parse difference in chrome and other browsers | <p>I have a date string "2011-11-24T09:00:27+0000" fetched from the graph.facebook API.</p>
<p>When I run </p>
<pre><code>var timestamp = Date.parse(facebookDate);
</code></pre>
<p>in chrome. I get a timestamp that relates to the date! perfect!</p>
<p>But in EVERY other major browser... I get "NaN" !!! ?</p>
<p>Su... | javascript | [3] |
5,319,805 | 5,319,806 | Show multiple RoutePaths from same GeoPoint in Android | <p>I wanted to show two Route Paths from same GeoPoint means from A-B and A-C.<br/><br/>
Route1 contains GeoPoints from A-B and Route2 contains GeoPoints from A-C. Please help me.</p>
| android | [4] |
5,680,870 | 5,680,871 | Change website language | <pre><code>string text = "我喜欢跑步。";
TranslateClient client = new TranslateClient(/* Enter the URL of your site here */);
string translated = client.Translate(text, Language.ChineseSimplified, Language.English);
Console.WriteLine(translated); // I like running.
</code></pre>
<p>It is working fine. But I want to pass wh... | c# | [0] |
2,475,883 | 2,475,884 | Unmodifiable Vector in Java | <p>I need to manage data in my program where Java-Vector suits the purpose as it is synchronized,provides dynamic size and fast random access through index.</p>
<p>But I want to make my Vector Read Only for other Program Classes and Read Write for my own Class.</p>
<p>I read about <code>Collections.unmodifiableList()... | java | [1] |
4,238,370 | 4,238,371 | Error when I try to add styles with jquery | <p>I get this error:</p>
<blockquote>
<p>Uncaught SyntaxError: Unexpected token ILLEGAL</p>
</blockquote>
<p>When I run this code:</p>
<pre><code>$('.field table[border!="0"] td').css({
border: 1px solid black,
color: red
});
</code></pre>
<p>I can't see what the error is.</p>
<p>UPDATE:</p>
<pre><code>$('.fiel... | jquery | [5] |
5,885,428 | 5,885,429 | how to nest if and else statement using ternary operator in PHP? | <p>am confused with using this ternary operator, i can easily get 1 level if and else
e.g</p>
<pre><code>($blah == $blah) ? blahblah : blahblahblah;
</code></pre>
<p>but what if the condition is like this?</p>
<pre><code>if($blah == blah1)
{
echo $blah1;
}
else if($blah == blah2)
{
echo $blah2;
}
else
{
echo $b... | php | [2] |
2,193,533 | 2,193,534 | canvas not redrawing correctly | <p>I am writing a simple view that will show a dot, after some action, show the next dot. The dots are on a vertical strip. so I create a function that'll clear the strip. then draw a circle at the position where I want the dot. the code segment is as followed.</p>
<pre><code>private void clear_strip(){
paint.s... | android | [4] |
2,998,453 | 2,998,454 | How do I develop a large whitelist of pages for a PHP include? | <p>It's clear that for any reasonable-sized website, building it in modules using PHP includes has great advantages, so I chose to dynamically create the page content using includes. I was against the idea of including the header and footer, so I did the inverse like this (index.php):</p>
<pre><code> if(isset($_GET... | php | [2] |
5,013,721 | 5,013,722 | how to check the content of a variable on submit | <p>I have a form that takes some post code, I'm trying to check the given post code by the user with the pre-defined post-code variable</p>
<pre><code> <form id="post_code">
<input name="textfield" type="text" id="postcode" size="8" maxlength="8" />
<input type="image" id="submit_postcod... | jquery | [5] |
5,577,108 | 5,577,109 | Java new Date() in print | <p>just learning Java and I know this may sound stupid but I have to ask. </p>
<pre><code>System.out.print(new Date());
</code></pre>
<p>I know that whatever is in the argument is converted to a string, the end value that is,
<code>new Date()</code> returns a reference to a Date object. So how is it that it prints t... | java | [1] |
995,567 | 995,568 | referencing class variable by a string | <p>This is some pseudo code represents my code which you wouldn't inderstand scope.</p>
<p>Class Tester has private vars, hold classes.
Array holds the base name of var.
Function bar attempts to contruct the variable in string from, then use it.
If this can't be done I understand, but i'm just constructing a variable ... | php | [2] |
4,291,644 | 4,291,645 | Jquery plugin help | <p>Looking for a Fixed header, frozen column, sortable table plugin for jquery any pointers will be helpful.</p>
| jquery | [5] |
2,897,422 | 2,897,423 | The timer works fine if it's coded inside a button_click event handler, but it doesn't work if it is inside a method | <p>I found timer code from a web site and used it in my application and it works fine if I use the timer code inside a button_click handler, but I need to use the timer when I call a method, so I did copy and paste the same code from the button_click into the method but the timer always gives me zero. How do I fix it?<... | c# | [0] |
4,443,488 | 4,443,489 | How to get and disect the query string appended into a url? PHP | <p>I am trying to develop a PHP class which would enable me to get the query string appended into a url and process it according to the variables passed. How can this be done?</p>
<p>Eg</p>
<pre><code>www.example.com?var1=a&var2=b&var3=c
</code></pre>
<p>now I want to get <code>?var1=a&var2=b&var3=c<... | php | [2] |
1,852,377 | 1,852,378 | Android - Basic question - link TextView to open new page (internal) | <p>Probably a really basic answer to this but google is throwing up nonsense. </p>
<p>Ok, so i have a bunch of nested linear layouts, each one contains a textview and an imageview. What i want is my textview to be linked so that when a user clicks on the text, it will take the user to a new page that is in the same pr... | android | [4] |
1,571,258 | 1,571,259 | Memory address of reference variable | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1950779/is-there-any-way-to-find-the-address-of-a-reference">Is there any way to find the address of a reference?</a> </p>
</blockquote>
<p>When we print the address of actual variable and reference variable it ... | c++ | [6] |
1,151,974 | 1,151,975 | JavaScript check if start button is clicked | <p>I have a problem with my button. I'd like to keep playing my opening sound if the button has not been clicked; otherwise pause the sound and load the game. How can I achieve this? I've tried this so far to no avail.</p>
<pre><code>function showStartScreen(launch) {
//SHOW SPLASH SCREEN
var screen = document... | javascript | [3] |
3,089,248 | 3,089,249 | Hide backend code from frontend dev in PHP | <p>Say I have domain.com/php/ with all my php functions, then I share a ftp account with the front-end developers for domain.com/frontend/, now the frontend can do their work and call "../php/" functions. Is this safe to assume my php code are protected? Or another way of asking, is there anyway for them to see the ph... | php | [2] |
5,002,679 | 5,002,680 | Leading zeros on JQuery Countdown Clock plugin | <p>I'm using a JQuery <a href="http://keith-wood.name/countdown.html" rel="nofollow">Countdown Clock plugin from here</a>.</p>
<p>Unfortunately I need to have leading 0 where there are single digits. For example 1:1:22 should display as 01:01:22.</p>
<p>Can anyone help with this?</p>
<p>Thanks</p>
| jquery | [5] |
835,767 | 835,768 | I am defining actionbars in android. How do I add new actions and on click listener to each action? | <p>I am working with action bars for the first time and would like to know for certain examples that show how to add new actions/buttons to the action bar and an intent on each button to load other classes. </p>
<p>A small code snippet with an xml layout would be of much help. </p>
| android | [4] |
4,301,065 | 4,301,066 | Capture the previous value when onkeydown is executed | <p>Need help in event handling. In my scenario, I have a textbox with default value 35 and cursor is set to before the 3. There is a event for this text box which is onkeydown. When I press 4, IE and Safari captures the previous value of the text which is 35. But Mozilla and Chrome captures the new value which is 435.<... | javascript | [3] |
3,869,551 | 3,869,552 | Ant: not able to find tools.jar | <p>when I type Ant in command line..
I get following error.. </p>
<p>Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
Buildfile: build.xml does not exist!
Build failed</p>
| java | [1] |
2,232,080 | 2,232,081 | Printing a variable in PHP does not work | <p>I've got this piece of code:</p>
<pre><code><?php
$userid = $me['id'];
function showifuserexists() {
?>
<html>
<head></head>
<body>
<a href="file.php?element1=aaa&userid=<?php print $userid; ?>">
</body>
</html>
<?php
}
?>
</code></pre>
<p>Fo... | php | [2] |
1,213,443 | 1,213,444 | jQuery ajax error is always "timeout" even when i'm giving wrong user/pwd | <p>I'm calling a SOAP webservice with jQuery ajax method. It works fine if there isn't a problem, but now I'm doing some tests, for example giving a wrong user name/password and the error that I receive is not the expected 401: Unauthorized. The call waits until the timeout is exceeded and then returns a timeout error.... | jquery | [5] |
3,058,690 | 3,058,691 | Variable in a while($row loop | <p>Can i put a variable inside this </p>
<pre><code>while($row = mysql_fetch_array($result))
</code></pre>
<p>ie </p>
<pre><code>while($row = mysql_fetch_array($result) and color = '$color')
</code></pre>
<p>I basically am calling a query but want to report on it in sections - in this case color by color. So i'd li... | php | [2] |
570,391 | 570,392 | Android Development: set a program as default | <p>How do i make my program load as default example for a url link?</p>
<p>Thank you!</p>
<p>PS* sorry for last missunderstanding Question! </p>
| android | [4] |
253,586 | 253,587 | removing html tags using a for loop in Java | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/240546/removing-html-from-a-java-string">Removing HTML from a Java String</a> </p>
</blockquote>
<p>I am having a problem removing htmls tags from a text file in java. I know it would be easy to use something li... | java | [1] |
45,461 | 45,462 | asp.net add value to form method | <p>Basically I want to place a url in the form action method.</p>
<p>The ltlUrl.text value is added on the server side in pageLoad.
How do i use the ltlUrl as the action method?</p>
<pre><code> <form action="<%# ltlurl.text%>" enctype="multipart/form-data">
<input type="text" name="title" value... | asp.net | [9] |
3,838,223 | 3,838,224 | cant create array with STRING key | <p>Im trying to create an <strong>associative</strong> array with objects, the key should always be a <strong>string</strong> (but they are always numbers).
This is how i store them (recording user clicks):</p>
<pre><code>App.Recording[currentTime.toString()] = {sound: buttonName.toLowerCase() };
</code></pre>
<p>Whe... | javascript | [3] |
4,286,323 | 4,286,324 | click() event doesn't need full class name? | <p>I have these input objects as follows,</p>
<pre><code> <input type='radio' class="but option" value='Yesterday'>
<input type='radio' class="but option" value='Last Week'>
<input type='radio' class="but option" value='Last Month'>
<input type='radio' class="but option" value='All Time'>
</c... | jquery | [5] |
3,668,209 | 3,668,210 | What does num>>1 mean in c++? | <p>I know this is a very simple question, but I'm having trouble finding the answer on google as it ignores the "<<" characters. If you have any advice for how I should search for things like this in the future that would also be much appreciated. I seem to recall its some kind of bitshift or something? But I don... | c++ | [6] |
3,780,089 | 3,780,090 | Have huge prob how to move in Canvas | <p>I have a Android program which you type in equation and them program display you in "new" layout a graph, its like coordinate system.You have function line, x line, y line... like school basic, you know, easy one.
But if your equation numbers are to hight like: "x*x*40" your graph line is to big to be on display. S... | android | [4] |
5,161,497 | 5,161,498 | Make a div or list element select/trigger a radio input button on click with jQuery? | <p>I'm not sure if this possible but probably is fairly simple.</p>
<p>I've made a fiddle <a href="http://jsfiddle.net/WTSWP/1/" rel="nofollow">http://jsfiddle.net/WTSWP/1/</a> or the kind of situation I'm in.</p>
<p>I've got multiple radio inputs, each contained by a div/li, and what the containing element to select... | jquery | [5] |
4,061,797 | 4,061,798 | Is it possible to configure an Android install to run a single app? | <p>Is it possible to configure the Android OS to run only a single app?</p>
<p>Basically what I want to do is customize an Android device so that it boots up and runs one application only, and for that application to be switched to the front of the screen automatically. Also, when it gets closed, to be started up and ... | android | [4] |
2,019,412 | 2,019,413 | Dynamic query with varying variables? | <p>Sorry if the title seems misleading, I wasn't sure of the best way to put it.</p>
<p>I have a 2 column table, in the table there's a list of USER_ID's and INTEREST's. </p>
<p>On my page I have a query which calls all interests and puts them into a jquery marquee. </p>
<p>I would like to make each value link to a ... | php | [2] |
1,870,942 | 1,870,943 | Defining a constant/declaring an array | <p>I am trying to declare two arrays, one 2D and one 1D. I know the dimensions need to be const values. So the const value is assigned from the return value of a function call. That goes well, but when I use the derived value to declare the array, COMPILE errors! WHY???</p>
<p>Here is my code:</p>
<pre><code>int popu... | c++ | [6] |
4,705,585 | 4,705,586 | Math.Round vs String.Format | <p>I need double value to be rounded to 2 digits.
What is preferrable?</p>
<pre><code>String.Format("{0:0.00}", 123.4567); // "123.46"
Math.Round(123.4567, 2) // "123.46"
</code></pre>
| c# | [0] |
621,549 | 621,550 | Windows Forms: how to drag and drop a .xml file on a TextBox? | <p>I have a Windows Forms TextBox in which I want to allow the user to drag and drop a file from Windows Explorer.
I would like to allow only for dropping an .xml file (path) on the TextBox.
The way of testing the file format to be dropped, on the DragEnter event, is:</p>
<pre><code>private void DragEnter(object sende... | c# | [0] |
1,608,092 | 1,608,093 | Java ArrayList problem (involves valueOf()) | <p>So I have this function, combinations, which adds to an arraylist all permutations of a string.</p>
<pre><code> public static void combinations(String prefix, String s, ArrayList PermAttr) {
if (s.length() > 0) {
PermAttr.add(prefix + s.valueOf(s.charAt(0)));
combinations(prefix +... | java | [1] |
4,458,413 | 4,458,414 | Can parent and child class in Java have same instance variable? | <p>Consider these classes:</p>
<pre><code>class Parent {
int a;
}
class Child extends Parent {
int a; // error?
}
</code></pre>
<p>Should the declaration of <code>a</code> in <code>Child</code> not give compilation error due to multiple declarations of <code>int a</code>?</p>
| java | [1] |
949,449 | 949,450 | Non-aligned pointer being freed, in Java? | <p>This would be simple to track down in Objective-C, but in Java I thought this kind of thing was impossible. The error I'm seeing is:</p>
<pre><code>java(7198,0x124a13000) malloc: *** error for object 0x1003109c1: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
</code></pre>
<p>H... | java | [1] |
4,418,170 | 4,418,171 | Closest textarea w/ jQuery | <p>I am trying to select a value from a drop-down and on select enter its value in the textarea that follows this selector. I tried defining my var but failed:</p>
<pre><code>var input = $(this).closest("input")
</code></pre>
<p>I don't want to assign IDs since I have the same combination repeat on the page more tha... | jquery | [5] |
4,491,660 | 4,491,661 | Is it possible to load MainWindow programatically | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/809898/loading-a-view-controller-view-hierarchy-programatically-in-cocoa-touch-withou">Loading a view controller & view hierarchy programatically in Cocoa Touch without xib</a> </p>
</blockquote>
<p>I know i... | iphone | [8] |
3,777,731 | 3,777,732 | As java doesn't have referencing, how does one pass information between two separate classes? | <p>Sorry for the extremely vague/confusing, I really didn't know how to name this issue. If someone has a better one please feel free too edit it. Onto my issue,</p>
<pre><code>public class Foo()
{
String name;
public Foo()
{
Bar temp = new Bar();
}
}
public class Bar()
{
public Bar()
... | java | [1] |
1,074,513 | 1,074,514 | cannot assign return value from fetch_assoc() | <p>I write the php </p>
<pre><code>$query = "SELECT privilege , no, userName FROM $tableName WHERE userName =
'$inputAccount' and password = '$inputPassword'";
$result = $mysqli->query($query);
if($result){
while ($row = $result->fetch_assoc()) {
printf ("%s %s %s\n", $row["privilege"], $ro... | php | [2] |
4,404,053 | 4,404,054 | PHP Simple HTML DOM - Access values that has no identifiers | <p>Say I have this in the html</p>
<pre><code><strong class="top">Contact Person: </strong>
<br>
Shan
<strong class="top">Email-id: </strong>
<br>
<span>abshanai@gmail.com</span>
<br>
<strong class="top">Website:</strong>
www.absgym.co.in
</code></pre>
... | php | [2] |
1,016,435 | 1,016,436 | JQuery Chrome and Firefox Compatibility Issue ($.each, $.click) | <p>The following code does absolutely nothing in Safari or Chrome (I've checked the error console too, and there's nothing), but it does work on Firefox. I just need to hide and show certain elements (<code><tr></code>'s on a table) whenever a <code><select></code> option is pressed.</p>
<p>Sample code: <a... | jquery | [5] |
4,133,029 | 4,133,030 | transparent socks redirector Apache License | <p>I'm currently creating an Android application thaw will set http, https, socks and ftp transparent proxy configuration. I found existing application and I tried to use their socks redirector but lately I found out that it is under GNU license.</p>
<p>Are they any socks redirector under Apache License? I researched ... | android | [4] |
2,849,351 | 2,849,352 | Will Application_Start also be triggered on page update? | <p>If I upload a new version of my site to my live server by using FTP and the "Replace existing files" option, will the "Application_Start" event in my Global.asax file be triggered once its uploaded? </p>
<p>If not, when does it trigger? Do I have to restart the server after an upload to do it?</p>
<p>Thanks in adv... | asp.net | [9] |
1,689,813 | 1,689,814 | Solution: Android INSTALL_FAILED_INSUFFICIENT_STORAGE error | <p>The INSTALL_FAILED_INSUFFICIENT_STORAGE error is the bane of every Android developer's life. It happens regardless of app size, or how much storage is available. Rebooting the target device fixes the problem briefly, but it soon comes back. There are hundreds (if not thousands) of message board posts from people ask... | android | [4] |
782,454 | 782,455 | Passing an array through url in php | <p>I wish to pass an array through url. I checked at <a href="http://stackoverflow.com/questions/1763508/passing-arrays-as-url-parameter">passing arrays as url parameter</a>. Isnt there any other way? Below is my code</p>
<pre><code>$result=Users.LoggedInUsers();
header('Location: http://localhost/Campus/Users.php?id=... | php | [2] |
3,382,758 | 3,382,759 | Fastest way to increment a BitArray (binary number) by one? | <p>The following "Increment" method is working perfectly. But I wanted to know is there any faster way to do this in less steps.</p>
<pre><code> public BitArray Increment(BitArray bArray)
{
carry = true;
for (i = 0; i < 32; i++)
{
if (carry)
{
... | c# | [0] |
141,194 | 141,195 | with asp.net webform, how to have many login url? | <p>in the webconfig you normally have something like</p>
<pre><code> <authentication mode="Forms">
<forms loginUrl="Logon.aspx" name=".ASPXFORMSAUTH">
</forms>
</authentication>
</code></pre>
<p>is there a way to have many pages in the loginUrl ?</p>
| asp.net | [9] |
5,306,339 | 5,306,340 | List Scroll issue 2.1 vs 2.2 | <p>i have a listview L2 in a Linear layout L1, Now i think if the height of layout L1 containing the listview is less than the height of the Listview L2, and L1.height fits in the display i.e. L1.height < display screen height then my list would scroll, But my list srolls only in 2.1 avd and not in 2.2 avd! I am pe... | android | [4] |
4,086,759 | 4,086,760 | Replace words dynamically with JavaScript | <p>With this line of code</p>
<pre><code>$("body").html($("body").html().replace(/1800/g,'6:00pm'));
</code></pre>
<p>I can replace the word, but how can I make it more dynamic with this script?</p>
<pre><code>var getFormattedTime = function (fourDigitTime){
var hours24 = parseInt(fourDigitTime.substring(0,2));
... | javascript | [3] |
5,644,564 | 5,644,565 | im getting this error, how can i find out what is this error for | <p>help with this error please.</p>
<pre><code>java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.OutOfMemoryError: Java heap space
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPr... | java | [1] |
1,257,449 | 1,257,450 | PHP using an HTML template | <p>I am having trouble reading in a file and using it as a template in PHP. A portion of my code is pasted below. For some reason it never finds $$USER_NAME$$ in the string so it never replaces. I also pasted the beginning part of my template below. </p>
<pre><code>$filename = "email/templates/welcome.txt";
$file = fo... | php | [2] |
1,897,570 | 1,897,571 | Building a Mobile Device: Possible to use XHTML/CSS/JS? | <p>I'm building a general mobile device that will operate on Ubuntu x86. Is it at all possible, and decently scored in performance, to build said system from HTML/CSS/Javascript? I'm currently a frontend and backend web developer and designer. At this point, I'm writing the device in C++, but was thinking about conver... | c++ | [6] |
2,344,034 | 2,344,035 | Error: [4] syntax error, unexpected T_LNUMBER occurred on line | <p>I am getting an error on this line in my php file. </p>
<pre><code>$output='<script>(function(){var cx = '000527094198246294321:3mrje2vs63g';var gcse = document.createElement(\'script\');gcse.type = 'text/javascript';gcse.async = true;gcse.src = (document.location.protocol == \'https:\' ? \'https:\' : \'h... | php | [2] |
4,683,776 | 4,683,777 | Change Keyboard input language | <p>I am developing one android app in two different languages. When user click on "Change language" button it ask to choose language from two different languages option and change keyboard according to that language.</p>
<p>For example : User choose "Arabic" language then keyboard input language should automatically c... | android | [4] |
3,171,245 | 3,171,246 | Generate Random Color distinguishable to Humans | <p>I am trying to randomly generate a color in hex in javascript.</p>
<p>However the colors generated are almost indistinguishable from eachother.
Is there a way to improve it?</p>
<p>Here is the code I am using:</p>
<p><pre><code>
function randomColor(){</p>
<p>var allowed = "ABCDEF0123456789", S = "#";</p>
<pre>... | javascript | [3] |
1,602,733 | 1,602,734 | Why does JavaScript (or ECMAScript) not allow var(x)=1? | <p>This might not be the most obvious question, but it seems to me that variable declaration has the only enforced semantic whitespace in JavaScript. Is this correct? You can avoid it in other constructs, like these.</p>
<pre><code>new(XMLHTTPRequest)
typeof(x)
'a'in(x)
(a)in(x)
</code></pre>
| javascript | [3] |
134,534 | 134,535 | Should I worry about javascript support? | <p>I've developed a ajax enabled site. However, the site does not currently work without javascript. The site works well on any browser that I've tested as well as iPhone/Nokia phones. </p>
<p>However, should I still worry about javascript support?</p>
<p>I know there are techniques that would get my site to work bot... | javascript | [3] |
3,968,704 | 3,968,705 | How to write local notification in iOS 3.1.3? | <p>I am developing one application in iOS 3.1.3. But there is no facility to write code for local notifications.</p>
<p>Is there any alternative for local notifications in iOS 3.1.3?</p>
| iphone | [8] |
1,897,205 | 1,897,206 | PHP including files | <p>What's the difference between</p>
<pre><code>$_SERVER['DOCUMENT_ROOT'];
</code></pre>
<p>and</p>
<pre><code>dirname(__FILE__);
</code></pre>
<p>I wonder what's the difference because when I 'echo' them, they're returning same path. Which do you prefer should I use and why?</p>
<p>Thanks!</p>
| php | [2] |
1,482,438 | 1,482,439 | fail-safe iterator | <p>CopyOnWriteArrayList produce fail-safe iterator because everytime the "structure is modified" , the modification mean a new array is produced. the iterator iterate over the old copy of array? So, fail-safe mean it is safe from failing?</p>
| java | [1] |
798,283 | 798,284 | Can you make addTextChangedListner wait? | <p>Is there any way to make a addTextChangedListner wait for a specified amount of time before launching the next intent.
My problem is coming when it is reading from an input, it only reads the first character, then immediatly launches. If it could something like ".wait(100); this would be time to read all input.</p>
... | android | [4] |
2,783,222 | 2,783,223 | How do I tell the Android launcher to create a folder with specified applications in it? | <p>The question about says it all. I want to programmatically tell the default launcher/home screen to add a folder with a specific name and a specific set of apps in it. Is this possible?</p>
| android | [4] |
4,861,140 | 4,861,141 | references in c++ problem | <p>I heard references in c++ can be intitalized only once but this is giving me 1 is my output and not returning any error!</p>
<pre><code> struct f {
f(int& g) : h(g) {
h = 1;
}
~f() {
h = 2;
}
int& h;
};
int i() {
int j = 3;
f k(j);
return j;
}
</code></pre>
| c++ | [6] |
2,112,286 | 2,112,287 | Using .one() for some elements not yet created (like .live()) | <p>Is there a way to use <code>one()</code> with event delegation? like <code>on()</code> or <code>live()</code> so that it will be applied to DOM elements that are not created at the binding time?</p>
| jquery | [5] |
1,941,341 | 1,941,342 | How to count how many checkboxes has been checked | <p>I have a HTML table first column consists of check boxes etc when the user clicks a button i want to check if any of the check boxes have been checked before going to the code behind etc.</p>
<p>This is what i have but it keeps throwing an error
"Microsoft JScript runtime error: Syntax error, unrecognized expressi... | jquery | [5] |
4,247,801 | 4,247,802 | java script refresh page after getting value from excel | <p>i have this code in javascript</p>
<pre><code> a= Excel.Workbooks.open("C:/work/ind12.xls").ActiveSheet.Cells.find("value");
if(a == null)
document.getElementById('dateValid').innerText = "Date not Valid";
Excel.close();
</code></pre>
<p>its just conne... | javascript | [3] |
5,920,442 | 5,920,443 | SQLite or something else? | <p>I am trying to decide on what data storage methods to implement. Here is the situation. Whatever method I choose, it is going to be updated once week (can I update a SQLite db without putting out an update in the market?). The user cannot add or remove items from this ListActivity, they can only pick the ones they w... | android | [4] |
5,909,108 | 5,909,109 | jQuery, bind - change | <p>Good afternoon.</p>
<p>I have a little problem with triggering the change of a select box in jQuery.</p>
<p>I have juts built a plugin that takes a select box with it's options and turns it into an iPhone style (what I call) roller - basically a fixed height element with an up and down arrow on the right that make... | jquery | [5] |
3,988,435 | 3,988,436 | Sum possibilities, one loop | <p>Earlier I had a lot of wonderful programmers help me get a function done. however the instructor wanted it in a single loop and all the working solutions used multiple loops.</p>
<p>I wrote an another program that almost solves the problem. Instead of using a loop to compare all the values, you have to use the func... | python | [7] |
1,609,857 | 1,609,858 | Inline & not-inline | <p>Suppose I have:</p>
<pre><code>struct Vec3 {
double x;
double y;
double z;
} ;
inline double dot(const Vec3& lhs, const Vec3& rhs) {
return lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z ;
}
</code></pre>
<p>Is it possible to have "dot" also exist in a non-inlined version, so that it can be in the ... | c++ | [6] |
1,306,468 | 1,306,469 | Executing a list of imported functions | <p>I have a file with functions:</p>
<p>modules.py:</p>
<pre><code>def a(str):
return str + ' A'
def b(str):
return str + ' B'
</code></pre>
<p>I want to perform these functions in cycle. Something like:</p>
<p>main.py:</p>
<pre><code>import modules
modules_list = [modules.a, modules.b]
hello = 'Hello'
... | python | [7] |
940,523 | 940,524 | Is returning a temp-object by reference possible | <p>is it possible to return a reference from a function like in this example code:</p>
<pre><code>string &erase_whitespace(string &text)
{
text.erase(**etc.**);
return text;
}
</code></pre>
<p>Call:</p>
<pre><code>string text = erase_whitespace(string("this is a test"));
cout << test;
</code></... | c++ | [6] |
3,531,798 | 3,531,799 | Convert unsigned char array with int to unsigned char | <p>Can somebody help me out with below error. Shall I cast <code>len</code> before I try to pass <code>buf</code>?</p>
<pre><code>int len=2;
unsigned char tmp[len + 1];
unsigned char * buf = &tmp;
</code></pre>
<p>The error is:</p>
<pre><code>error: cannot convert 'unsigned char (*)[(((unsigned int)((int)len)) +... | c++ | [6] |
5,879,579 | 5,879,580 | How to use zxing qrcode-reader API | <p>Hi everyone I'm new to android I'm doing on some project that needs scanning qr codes using mobile(Android OS)<br>
I have tried a lot to do it. I have already integrated zxing API and use this code:</p>
<pre><code>Intent data = new Intent("com.google.zxing.client.android.SCAN");
</code></pre>
<p>And getting the re... | android | [4] |
393,823 | 393,824 | PHP Get URL Contents And Search For String | <p>In php I need to get the contents of a url (source) search for a string "maybe baby love you" and if it does not contain this then do x.</p>
| php | [2] |
4,866,939 | 4,866,940 | Where can I find a good explanation of C++ stateful virtual base? | <p>Where can I find a good explanation of C++ stateful virtual base?</p>
<p>I looked in the <a href="http://www.jsf.mil/" rel="nofollow">JSF</a> <a href="http://www.jsf.mil/downloads/down_documentation.htm" rel="nofollow">C++ Coding Standard</a> and read their explanation, but was looking for some additional informati... | c++ | [6] |
566,704 | 566,705 | Clipboard can copy a few words? | <p>I'm weak in English so I hope you will understand this.</p>
<p>I learned yesterday that Clipboard is copy.</p>
<pre><code>//textBox1.Text = "My name is not exciting";
Clipboard.SetText(textBox1.Text);
textBox2.Text = Clipboard.GetText();
</code></pre>
<p>This code copies your everything from the textbox1 and past... | c# | [0] |
970,482 | 970,483 | Split string based on Roman Numerals C# | <p>I want to Find roman numbers inside string (numbers below 20 is enough) and split the string based on roman numbers</p>
<p>eg:user input is : </p>
<pre><code>Whats your name?i)My name is C# ii)My name is ROR iii)My Name is Java
</code></pre>
<p>i want to do something like </p>
<pre><code>Whats your name?
i)My na... | c# | [0] |
5,591,991 | 5,591,992 | Can't load IA 32-bit .dll on a AMD 64-bit platform JMyron.dll | <p>i have imported the entire code for the example given at the <a href="http://webcamxtra.sourceforge.net/download.shtml" rel="nofollow">http://webcamxtra.sourceforge.net/download.shtml</a> for the java example, but the error given above is coming.
Can please anyone give clear guidelines on how to start a webcam throu... | java | [1] |
1,498,109 | 1,498,110 | Interrupting or stopping a sleeping thread | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4264341/interrupting-or-stopping-a-sleeping-thread">Interrupting or stopping a sleeping thread</a> </p>
</blockquote>
<p>How to stop or interrupt a sleeping thread in java.? I have a thread that syncs data and s... | java | [1] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.