Unnamed: 0 int64 65 6.03M | Id int64 66 6.03M | Title stringlengths 10 191 | input stringlengths 23 4.18k | output stringclasses 10 values | Tag_Number stringclasses 10 values |
|---|---|---|---|---|---|
3,971,935 | 3,971,936 | viewing site from server | <p><strong>ok i'm trying to put my asp.net website onto my university's web server but when visiting my webpage I get the following problem:</strong></p>
<pre><code>Configuration Error
Description: An error occurred during the processing of a configuration file required
to service this request. Please review the specific error details below and modify your
configuration file appropriately.
Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error can be
caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 13: </connectionStrings>
Line 14: <system.web>
Line 15: <roleManager enabled="true" />
Line 16: <authentication mode="Forms" />
Line 17: <compilation debug="false" targetFramework="4.0" />
Source File: F:\users\1010033\co5027\web.config Line: 15
</code></pre>
<p>I can't get this working at all. I presume it's to do with the user security and roles I set up in Visual Studio but I have no idea about what to do to fix the problem. Bear in mind I don't have access to ISS as that is all set up by the university. </p>
<p>I have a second <code>web.config</code> file in a folder called <code>AdminSecured</code> in my root folder which holds all the secured pages. </p>
<p>Any ideas?</p>
| asp.net | [9] |
3,717,211 | 3,717,212 | ListView Activity, dynamically insertion of list items | <p>I am trying to insert list items dynamically into the list view. As list view is created and displayed on the screen now suppose i got one items from the server or some where, now i want to add this item in the same list view what i have displayed. How to do that ?? Is there any way to insert items dynamically in the displayed list view without creating the list agtain and again. And is there any way to change the status of list item, that means can we interact while it is displaying?? your's reply will be appreciated. Thnx in advance !!</p>
| android | [4] |
456,410 | 456,411 | Authorization failed: Please connect to iTunes | <p>I always get this message whenever I tried to download an app from the appstore, some peoople tell me that this is due to the dynamically changing Terms of Use from Apple, how can I accept the Terms of Use. Tried everything else but jailbreak.</p>
| iphone | [8] |
4,847,556 | 4,847,557 | what is android Choreographer | <p>I installed the latest versions of <code>SDK (API 16)</code> and got the latest ADT. I'm now seeing these messages in the logcat, that I'm quite sure, I haven't seen before. Does anyone have an idea about this?</p>
<blockquote>
<p>06-29 23:11:17.796: I/Choreographer(691): Skipped 647 frames! The
application may be doing too much work on its main thread.</p>
</blockquote>
<p>I did a search and found this link:
<a href="http://developer.android.com/reference/android/view/Choreographer.html" rel="nofollow">http://developer.android.com/reference/android/view/Choreographer.html</a>. This is a new class introduced in API 16.</p>
<p>I need to know how I can determine what "too much work" my application may be doing as all my processing is done in <code>AsyncTasks</code>.</p>
| android | [4] |
1,781,729 | 1,781,730 | Custom button example not working | <p>I am newbie in android application development.
I am using the Form Stuff example given on <a href="http://developer.android.com/resources/tutorials/views/hello-formstuff.html" rel="nofollow">http://developer.android.com/resources/tutorials/views/hello-formstuff.html</a>. In this i have used the custom button example.</p>
<p>My code is as below:</p>
<pre><code> package com.example.helloformstuff;
import android.app.Activity;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class HelloFormStuff extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// Perform action on clicks
Toast.makeText(HelloFormStuff.this, "Beep Bop", Toast.LENGTH_SHORT).show();
}
});
}
}
</code></pre>
<p>Its showing following error:</p>
<pre><code>The type new DialogInterface.OnClickListener(){} must implement the inherited
abstract method DialogInterface.OnClickListener.onClick(DialogInterface, int)
- The method setOnClickListener(View.OnClickListener) in the type View is not
applicable for the arguments (new DialogInterface.OnClickListener(){})
</code></pre>
<p>I am unable to figure out the reason for such error.</p>
<p>Please help me on this.</p>
<p>Thanks</p>
<p>Pankaj</p>
| android | [4] |
4,059,313 | 4,059,314 | Java: Regular expression to strip out: %j or %f | <p>Is there an easy way to strip out something like %j or %f out of a string and replace it with an int? like: </p>
<p>XYZ: %J Num: %f </p>
<p>becomes </p>
<p>XYZ: 12 Num: 34</p>
| java | [1] |
5,449,955 | 5,449,956 | Slow Moving Objects (Visual) | <p>When I try to move graphical objects across the screen at steps which are not whole numbers (for example, 0.5 pixels per frame) this results in choppy and 'laggy' movement; as the object will simply move 1 pixel every two frames.</p>
<p>I understand why this is happening as the x / y values of an object must be Integers, but I wonder if there is anyway to create smooth slow movement, such as there is in Adobe Flash.</p>
| java | [1] |
6,018,350 | 6,018,351 | Adding map overlays | <p>I am using iPhone os4 for development. I need to add overlays to mapview. Apple now
provides overlays as a new feature of os4. How can i add overlays.Any help will
be greatly appreciated.</p>
| iphone | [8] |
6,019,869 | 6,019,870 | Crazy idea of new tag in html | <p>I want to create a tag named <code><triangle></code>. And I want to add new css attributes, like <code>width-a</code>, <code>width-b</code>, and <code>width-c</code>. (Widths of the three sides of the triangle).</p>
<p>I have already the calculations in JavaScript, and I know how to create tags and append them, and I know how to seek all <code><triangle></code> tags and change their styles.</p>
<p>But if the one who will use my library for <code><triangle></code> tags append a <code><triangle></code> tag in javascript, this will not be formated as it must. Then I thought of an interval, but there would be like a blink before the triangle appears.</p>
<p>Is there a way to modify the <code>appendChild</code> (or the <code>createElement</code>) function so that I modify the tag that will be appended before it's appended?</p>
<p>(Of course, any other way to make that someone could just write:</p>
<pre><code>var a=document.createElement("triangle");
a.style.borderA="100px";
a.style.borderB="100px";
a.style.borderC="100px";
document.body.appendChild(a);
</code></pre>
<p>will be accepted)</p>
<hr>
<p><sub>No jQuery please</sub></p>
| javascript | [3] |
3,659,071 | 3,659,072 | how to identify the login details from data base | <p>i created a signup page and enter those values in database. Now i want to create a login page and have to check the details from the data base, whether the user registered or not? How can any one help me...please?</p>
| asp.net | [9] |
3,330,967 | 3,330,968 | How do i make sure that my mail($to,$subject,$msg); delivers the mail | <p>My computer has got apache installed(localhost), so i made a signup option, and there is an email option to which i send a mail for activation of account. I have an internet connection, now if in the PHP script, i write
mail($to,$subject,$msg);
will this code deliver the mail to the desired recepient because it is not sending it.</p>
| php | [2] |
3,831,721 | 3,831,722 | C++ usage extern in front of function | <p>I have seen an interview question from Bloomberg from here: <a href="http://www.careercup.com/question?id=383154" rel="nofollow">http://www.careercup.com/question?id=383154</a></p>
<pre><code>extern void print(int *a, int z);
void print(int *a, int z);
</code></pre>
<p>Question 1> Will it compile?</p>
<p>Question 2> If it compiles, what does it mean?</p>
<pre><code>extern int i;
int i;
</code></pre>
<p>Question 3> Will it compile?</p>
<p>Question 4> If it compiles, what does it mean?</p>
| c++ | [6] |
2,748,543 | 2,748,544 | ostringstream overloading const char * with the void * | <p>im having an issue with the ostream, I have written a very basic macro that should print out its parameters.</p>
<p>Please see example code below:</p>
<pre><code>#define LOG Message(__FILE__, __LINE__,__func__)
class Message : public std::ostringstream
{
public:
Message(const char *param1, int param2, const char *param3)
{
*this<<param3<<"("<<param1<<":"<<param2<<")";
}
~Message()
{
*this<<endl;
cout<< rdbuf()->str();
}
};
int main()
{
int integer = 1;
string str = "XYZ";
LOG<<integer<<"DEBUGLOG1: "<<str<<" "<<integer;
return 0;
}
</code></pre>
<p>The problem is if I use:</p>
<pre><code>LOG << "LOG1: " << str << " " << integer;
</code></pre>
<p>The output prints the Address* of the const char* "LOG1: " rather than the value.</p>
<p>But,
If I use:</p>
<pre><code>LOG << integer << "DEBUGLOG1: " << str << " " << integer;
</code></pre>
<p>The output works perfect, printing the integer value and the char value.</p>
<p>it looks like instead of using <code>ostream& operator<< (ostream& out, const char* s );</code></p>
<p>it is using <code>ostream& operator<< (const void* val);</code> ?</p>
<p>Can anyone shed any light on what can be done to overcome this overloading please?</p>
<p>Thanks in advance</p>
| c++ | [6] |
5,781,224 | 5,781,225 | jQuery Add / remove class on nav | <p>How can I create different classes on my links so they can show different images when you click on them?</p>
<p>The idea is that the links has its own color and when it is active there must be a little arrow with the same color.</p>
<p>This is what I have so far:</p>
<p><strong>HTML:</strong></p>
<pre><code><ul>
<li class="red"><a href="#">Link one</a></li>
<li class="blue"><a href="#">Link two</a></li>
</ul>
</code></pre>
<p><strong>CSS:</strong></p>
<pre><code>.red {background-color:#f00; }
.red_bnt { background-image:url(image/red_bnt_pil.png); }
.blue {background-color:#00f; }
.blue_bnt { background-image:url(image/red_bnt_pil.png); }
</code></pre>
<p><strong>jQuery:</strong></p>
<pre><code><script type="application/x-javascript">
$('.red').click(function(){
$('.red').removeClass('red_bnt');
$(this).addClass('red_bnt');
});
</script>
</code></pre>
<p>And then repeat it for the blue as well.</p>
<p>But it is not working ...</p>
<p>what am I doing wrong?</p>
| jquery | [5] |
5,332,093 | 5,332,094 | Android 4.0+ tablet keyword? | <p>I heard that there is a keyword or method that Android developers can use to determine whether Android 4.0+ is running on a tablet (without having to do any kludgy screen size comparisons). I can't find it.</p>
<p>So, is this true? If so, what is it?</p>
<p>Edit: I see that people are giving me answers that are not what I'm looking for. I already know how to determine whether a device is a tablet or phone using the kludgy screen size method and using the OS method. I'm looking for a method that has been available starting with API level 14 that will tell me the same information -- hopefully. I can't find it, so I'm wondering whether it even exists.</p>
| android | [4] |
5,355,870 | 5,355,871 | Comparing one 2D and one 1D array in C#? | <p>I just want to write code for comparing a 1D array with a 2D array... I am working on writing a compiler and want to compare a 1D array which contains my code and other 2D array in which I have made a symbol table.
I have written code, but it's not working.</p>
<pre><code>for (int x = 0; x < symboltable1.Length; x++)
{
for (int y = 0; y < symboltable1.Length; y++)
{
for (int z = 0; z < text.Length; z++)
{
if (symboltable1[x,y] == text[z])
listBox2.Items.Add(text[z]);
else
MessageBox.Show("poor");
}
}
}
</code></pre>
| c# | [0] |
1,829,765 | 1,829,766 | Take all input in Python (like UAC) | <p>Is there any way I can create a UAC-like environment in Python? I want to basically lock the workstation without actually using the Windows lock screen. The user should not be able to do anything except, say, type a password to unlock the workstation.</p>
| python | [7] |
5,840,269 | 5,840,270 | How to find a string which is case-sensitive and ignore it in JAVA | <p>I have a text file (T1.txt) in which it has few strings.out of them 2 are similar but case-sensitive. I have to ignore the other one and get the rest of them..</p>
<p>e.g.. ABCD, XYZ, pqrs, aBCd.</p>
<p>i am using Set to return the strings.. but how I can ignore the duplicate and return only one string( either of ABCD , aBCd).</p>
<pre><code>public static Set findDuplicates(File inputFile)
{
FileInputStream fis = null;
BufferedInputStream bis = null;
DataInputStream dis = null;
Set<String> set = new HashSet<String>();
ArrayList<String> inpArrayList = new ArrayList<String>();
try{
fis = new FileInputStream(inputFile);
bis = new BufferedInputStream(fis);
dis = new DataInputStream(bis);
while (dis.available() != 0)
{
inpArrayList.add(dis.readLine());
}
for(int i=0; i < inpArrayList.size(); i++)
{
if(!set.contains(inpArrayList.get(i)))
set.add(inpArrayList.get(i));
}
}
catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(" set" + set);
return set;
}
</code></pre>
<p>The returning set shall contain only XYZ, pqrs, aBCd or ABCD. but not both.</p>
<p>Thanks
Ramm</p>
| java | [1] |
869,196 | 869,197 | Android available memory in device at the time of downloading? | <p>How to check the available memory in android when user is downloading the media into the sdCard</p>
| android | [4] |
3,223,739 | 3,223,740 | How to identify objects to be set serializable for server clustering? | <p>I understand that if we want to setup clustering between servers. </p>
<p>Is there any systematic way to check if any objects are not serilizable?</p>
<p>Because currently we use functionality testing to check if got any exception encountered related to serialization</p>
<p>Thanks</p>
| java | [1] |
2,531,304 | 2,531,305 | Query on UIWebView | <p>Can anyone point me some good examples on how to use UIWebView in iPhone.</p>
| iphone | [8] |
2,617,761 | 2,617,762 | debug error : max must have union class struct types | <p>this is my code:</p>
<pre><code>#include <iostream>
using namespace std;
class Sp
{
private :
int a;
int b;
public:
Sp(int x = 0,int y = 0) : a(x), b(y) { };
int max(int x,int y);
};
int Sp::max(int a,int b) { return (a > b ? a : b); };
int main()
{
int q,q1;
cin >> q >>q1;
Sp *mm = new Sp(q,q1);
cout << mm.max(q,q1);
return 0;
}
</code></pre>
| c++ | [6] |
3,729,158 | 3,729,159 | Apply color to row on select w/ jQuery | <p>If I have a selector with drop-down options, how can I change a color of all cells in this row on change?</p>
<pre><code>function changeColor(){
}
$(".mySelector").change(function() {
changeColor();
});
<table>
<tr>
<td>val 1</td>
<td>val 2</td>
<td>
<select class="mySelector">
<option value="red">red</option>
<option value="grn">green</option>
<option value="blu">blue</option>
</select>
</td>
</tr>
<tr>
<td>val 3</td>
<td>val 4</td>
<td>
<select class="mySelector">
<option value="red">red</option>
<option value="grn">green</option>
<option value="blu">blue</option>
</select>
</td>
</tr>
</table>
</code></pre>
| jquery | [5] |
2,086,449 | 2,086,450 | I want to display a image in UIImagaView tat image names stored in array .so how to get string from array in iphone | <p>Actually i want to display iamge in UIImageView ...tat image names are getting from my database..so how to display image from getting string in an array in iphone</p>
| iphone | [8] |
1,401,664 | 1,401,665 | Text field validation | <p>I want to validate my text field with a <code>YYYY</code> format, meaning a user can only enter a four digit number like a year. There are seven text fields including this text field; I only want this text field to require validation.</p>
| iphone | [8] |
1,609,941 | 1,609,942 | how loaders deliver new result when the content change | <p>from the <a href="http://developer.android.com/guide/topics/fundamentals/loaders.html" rel="nofollow">API</a> it says that one of the loaders characteristics is :</p>
<blockquote>
<p>They monitor the source of their data and deliver new results when the
content changes.</p>
</blockquote>
<p>i used a loader with cursors not ContentProvider , and i have a list that display the cursor when i make a delete or update to the table i load the cursor from the loader deos not deliver new result as they says , why that ? or i misunderstand something ? </p>
| android | [4] |
5,744,947 | 5,744,948 | String is empty | <p>I'm trying to validate the the field name is empty, and it is working</p>
<pre><code>while(name.isEmpty()||!name.matches("^([A-Z*a-z]*(\\s))+[A-Z*a-z]*$"))
</code></pre>
<p>When I try to validate the field number when it is empty it is giving an error.</p>
<pre><code>while (number.charAt(0) != '0' || number.length() < 4 || !number.matches("^[0-9]*") || number.isEmpty())
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(Unknown Source)
</code></pre>
| java | [1] |
1,037,584 | 1,037,585 | Initializing default values in a struct | <p>If I needed to initialize only a few select values of a C++ struct, would this be correct:</p>
<pre><code>struct foo {
foo() : a(true), b(true) {}
bool a;
bool b;
bool c;
} bar;
</code></pre>
<p>Am I correct to assume I would end up with one <code>struct</code> item called <code>bar</code> with elements <code>bar.a = true</code>, <code>bar.b = true</code> and an undefined <code>bar.c</code>?</p>
| c++ | [6] |
4,032,702 | 4,032,703 | How to assign a total to a name in Java | <p>All,</p>
<p>I got it figured out.</p>
<p>thanks for helping me stimalate my brain</p>
| java | [1] |
1,860,943 | 1,860,944 | PHP readdir() not returning files in alphabetical order | <p>I am reading through a directory with some pictures and such using a pretty simple implementation of readdir() like the following:</p>
<pre><code>if ($handle = opendir($path)) {
while (false !== ($szFilename = readdir($handle))) {
if ($szFilename[0] !== '.') {
if (is_file($path.$szFilename)) {
// do stuff
}
}
}
}
</code></pre>
<p>The problem that I am having is that the files are not being read in alphabetical order as the docs for readdir() state:</p>
<blockquote>
<p>Returns the filename of the next file
from the directory. The filenames are
returned in the order in which they
are stored by the filesystem.</p>
</blockquote>
<p>Another weird thing is that, on the local testing server, the same code works great. This is running on a server using the LAMP stack in both cases.</p>
<p>I know that I can build an array and just sort it, but I was wondering if I was missing something in what I was doing.</p>
<p>Thanks for any insight!</p>
| php | [2] |
3,847,510 | 3,847,511 | jquery replace div content html() | <p>I'm just try to replace the content of a div with new content binded to a click event.</p>
<p><a href="http://jsfiddle.net/pCckh/" rel="nofollow">JSFIDDLE</a></p>
<p>When I use <code>appendTo()</code> instead of of <code>html()</code> it's working, but I need to clear the old content out so I'm a bit confused why this is not working like it should do </p>
| jquery | [5] |
2,116,698 | 2,116,699 | on unload event of browser | <p>HI </p>
<p>I wanna timeout session from client page,i tried below code but not able to execute code need some help of how i can handle OK or CANCEL events from user</p>
<pre><code><script>
function onBeforeUnloadAction(){
return "Would u like to discard Changes";
}
window.onbeforeunload = function(){
if((window.event.clientX<0) ||
(window.event.clientY<0))
{
return onBeforeUnloadAction();
}
}
</script>
</code></pre>
| javascript | [3] |
945,423 | 945,424 | Pythonic way to combine two lists in an alternating fashion? | <p>I have two lists, <strong>the first of which is guaranteed to contain exactly one more item than the second</strong>. I would like to know the most Pythonic way to create a new list whose even-index values come from the first list and whose odd-index values come from the second list.</p>
<pre><code># example inputs
list1 = ['f', 'o', 'o']
list2 = ['hello', 'world']
# desired output
['f', 'hello', 'o', 'world', 'o']
</code></pre>
<p>This works, but isn't pretty:</p>
<pre><code>list3 = []
while True:
try:
list3.append(list1.pop(0))
list3.append(list2.pop(0))
except IndexError:
break
</code></pre>
<p>How else can this be achieved? What's the most Pythonic approach?</p>
| python | [7] |
698,254 | 698,255 | Android ListView Selection Problem | <p><strong>Hi All,</strong></p>
<p>I apologize for the following long question... </p>
<p>I have a LinearLayout which contains a ListView and some other items. As for the ListView, each on of its rows is a LinearLayout that contains 3 views - Checkbox, ImageView and TextView (from left to right - horizontal).
Since I wanted the whole row to be selected when using the trackball (to be highlighted with a background color), I set the all three views inside the LinearLayout row as not focusable, and it worked.</p>
<p>Now I'm having 2 problems regarding this ListView.
First, I want that whenever I touch a row in the ListView (with my finger), to get the same behavior as when using the trackball - means that I want the row to be selected (highlighted). What's happening right now is that when I touch the row it really becomes selected, but when I release my finger the selection is gone (much like happens in device's contact list).</p>
<p>Second - from a Menu, I can display a new LinearLayout instead the one that contains the ListView (different application's screen). When this happens, I still stores the object of the LinearLayout that contains the ListView, because I want to be able to re-display it later without creating it from scratch.
The problem is that when I re-disaply the LinearLayout with the ListView, none of the ListView's rows are selected, even if a ceratin row was selected when the the LinearLayout with the ListView "left" the screen.</p>
<p>Sorry again for the long post.</p>
<p>Thanks!</p>
| android | [4] |
2,843,416 | 2,843,417 | When a function behave when "return" out o of the function in C++ | <p>I have a code. like this:</p>
<pre><code>int functionA (){
Foo(**,**,**);
return 0;
}
</code></pre>
<p>Foo() is a huge function(more than 10,000 lines). Which I don't understand all.Foo function includes some multi-thread code.</p>
<p>The problem now is, if I have "return" code right after Foo, Foo can be run correctly.</p>
<p>If I insert some other code (even a really simple cout code) between Foo() and "return". The Foo function will act weird(partly not run correctly).</p>
<p>I debugged this thing for 3 days. Nothing found.</p>
| c++ | [6] |
3,176,808 | 3,176,809 | get key value press | <p>I Want get key value on keyPress with jQuery In textbox</p>
| jquery | [5] |
3,602,733 | 3,602,734 | onmouseover stop slideshow help | <p>This is a function for a slideshow,onmouseover i want it to stop. Instead of stopping the slideshow onmouseover, it speeds up?? How can i correct this to stop onmouseover?</p>
<pre><code><body onload="nextslide();">
function nextslide() {
// Hide current slide
var object = document.getElementById('slide' + current); //e.g. slide1
object.style.display = 'none';
// Show next slide, if last, loop back to front
if (current == last) {
current = 1;
} else {
current++;
}
object = document.getElementById('slide' + current);
object.style.display = 'block';
var timeout = setTimeout(nextslide, 2500);
object.onmouseover = function(){
clearTimeout( timeout );
}
object.onmouseout = nextslide;
}
</code></pre>
| javascript | [3] |
2,478,374 | 2,478,375 | Whats the error in my php function? | <p>I have a function a. That is re used in many times without any problem. But now i cant call the function.<strong>This is my function</strong></p>
<pre><code>function a($a,&$b){
// functions code here
}
</code></pre>
<p>I calling function a like this.</p>
<pre><code>a(3,null);
</code></pre>
<p>Whats the error with my code?</p>
| php | [2] |
5,323,051 | 5,323,052 | Possibility of an ANR in Standalone Service | <p>Can an android process that does not contain any activities (i.e. a standalone service) receive an ANR? </p>
<p><em>Android mentions: "In Android, application responsiveness is monitored by the Activity Manager and Window Manager system services. Android will display the ANR dialog for a particular application when it detects one of the following conditions:"</em></p>
<p>Does this mean a service without a UI interface can or cannot cause an ANR?</p>
| android | [4] |
2,284,982 | 2,284,983 | added button programmatically to layout, but not appearing | <p>Looking at various examples, below is what seems to be the correct way of adding a view to a layout. However, nothing shows up for me. I'm assuming it has something to do with the layout options, but I'm new so I don't know what is missing.</p>
<pre><code>public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.songs_layout);
LinearLayout layout = (LinearLayout) View.inflate(this, R.layout.songs_layout, null);
Button myButton = new Button(this);
myButton.setText("Change View");
myButton.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
layout.addView(myButton);
}
</code></pre>
| android | [4] |
4,267,484 | 4,267,485 | Copy javascript error text to clipboard? | <p>How do you copy javascript errors in IE to clipboard? CTRL + C doesn't work and I don't want to take screenshots. Are there any tools out there that lets you copy the text?</p>
<p><img src="http://i.stack.imgur.com/glFmz.jpg" alt="alt text"></p>
<p>(ANSWER) EDIT: I finally found a machine which has IE8 on it and was able to copy the error message. It's a hassle, though.</p>
| javascript | [3] |
1,807,786 | 1,807,787 | iPhone Developer handle | <p>So I just starting coding iPhone apps, and a potential employer had asked what me, "What is your Developer Handle?" What exactly did he mean by "Developer Handle"?</p>
| iphone | [8] |
29,070 | 29,071 | jquery load() and append | <p>silly quick question:</p>
<p>I have my:</p>
<pre><code>$('#result').load('ajax/test.html');
</code></pre>
<p>but what if I don't want to insert my loaded content into #result, but prepend it to #result, maintaining all precedent elements? Is it possible to create a variable, load it with content and then append or prepend it to my #result? I imagine some other scenarios where with my brand new variable I can manipulate it before inserting it into the DOM.</p>
| jquery | [5] |
851,000 | 851,001 | Disable links after page load in jquery | <p>I have a bad problem in jquery</p>
<p>I have a link in Div . When click on link the JQuery Function run.
But when i load this Div on other Div the link not working.</p>
<p>How can i fix it?</p>
<p>thanks</p>
<p>This is Div 1</p>
<pre><code><div id="top_menu">
</code></pre>
<p></p>
<p>This is Div 2</p>
<pre><code><div id="detail_menu">
<a href="#personal-detail"><div id="personal-detail" class="personal-detail"></div></a>
<a href="#family-detail"><div id="family-detail"></div></a>
<a href="#address-detail"><div id="address-detail"></div></a>
<a href="#account-detail"><div id="account-detail"></div></a>
</div>
</code></pre>
<p>And This is JQuery function.</p>
<pre><code>$(".personal-detail").click(function(){
fajaxcontent(".user-detail","user-forms.php .users-option");
});
</code></pre>
<p>When Div 2 load on Div 1 . The function does not working
I load with this code.</p>
<pre><code>$("Div1").load("Div2");
</code></pre>
| jquery | [5] |
3,963,903 | 3,963,904 | How long will a non-clearing notification stay? | <p>If my app fires a notification and marks it as non-clearing (i.e. tapping it does not remove it), what will result in the notification being removed?</p>
<p>Would I be right in assuming that if the app is shut down by the memory manager that this will cause the notification will be removed? Or will the notification persist even if the app is recycled?</p>
<p>My app needs to show a persistent notification, and I need to understand whether I can set it up in the app, or if I need to build a service to manage it.</p>
| android | [4] |
1,010,632 | 1,010,633 | Strongly typing ID values in C# | <p>Is there a way to strongly type integer ID values in C#?</p>
<p>I've recently been playing with Haskell and can immediately see the advantages of its strong typing when applied to ID values, for example you would never want to use a <em>PersonId</em> in place of a <em>ProductId</em>.</p>
<p>Is there a nice way to create an <em>Id</em> class/struct that can be used to represent IDs of a given type?</p>
<p>I had the following idea but unfortunately it <strong>isn't legal</strong> on many levels. You can't have an abstract struct and the implicit/explicit cast operators wouldn't be inherited.</p>
<pre><code>public abstract struct Id
{
int _value;
public Id(int value)
{
_value = value;
}
// define implicit Id to int conversion operator:
public static implicit operator int(Id id)
{
return _value;
}
// define explicit int to Id conversion operator:
public static explicit operator Id(int value)
{
return new Id(value);
}
public bool Equals(object obj)
{
if(GetType() == obj.GetType())
{
Id other = (Id)obj;
return other._value == _value;
}
return false;
}
public int GetHashCode()
{
return _value.GetHashCode();
}
}
struct PersonId : Id { public PersonId(int value) : base(value) {} }
struct ProductId : Id { public ProductId(int value) : base(value) {} }
</code></pre>
<p>Are there any valid ways to perform something similar? How else can we prove that integer IDs type aren't being confused across a large application?</p>
| c# | [0] |
952,162 | 952,163 | PHP5 fsockopen connection error break site, no matter how I capture it | <p>I'm trying to use fsockopen to communicate with a game server, which responds with some basic stats. It works perfectly when the server is online, but if the server is ever offline, the following code causes php to stop displaying the page that reads the data.</p>
<pre><code>try {
$socket = fsockopen($host, $port, $errno, $errstr, 10);
if ($socket !== false) {
fwrite($socket, "\xFE");
$data = "";
$data = fread($socket, 1024);
fclose($socket);
if ($data !== false && substr($data, 0, 1) == "\xFF") {
// get into
} else {
// Server did not send back proper data, or reading from socket failed.
print "Server not available.";
}
} else {
// ...
}
} catch(Exception $e){
// ...
}
</code></pre>
<p>I've tried the try/catch, I've tried adding a custom handler to the exception. My only idea is to run this outside of the web requests and store the response so that the web request isn't initiating it.</p>
<p>Any thoughts?</p>
| php | [2] |
1,160,250 | 1,160,251 | JQuery getScript and get undefined variable | <p>I have a fancybox that loads a script on close with</p>
<pre><code>parent.$.getScript("js/reservation_special_reset.js")
</code></pre>
<p>and in the javascript file I have ..</p>
<pre><code> $('.time_start, .time_end').change(function() {
var tid;
tid = $(this).attr('id');
});
</code></pre>
<p>However, FireBug always say tid is undefined. What is the problem here?</p>
| jquery | [5] |
2,837,585 | 2,837,586 | Is it possible to encrypt a string using java? | <p>I want to know that Can we encrypt a text using Java and then again getting back to normal text? If anyone is having idea please help. Any help regarding this will be appreciated.
Thanks in advance. </p>
<pre><code>String plaintext = "HelloWorld";
MessageDigest m = MessageDigest.getInstance("MD5");
m.reset();
m.update(plaintext.getBytes());
byte[] digest = m.digest();
BigInteger bigInt = new BigInteger(1,digest);
String hashtext = bigInt.toString(16);
// Now we need to zero pad it if you actually want the full 32 chars.
while(hashtext.length() < 32 ){
hashtext = "0"+hashtext;
}
</code></pre>
<p>I have tried this. Now I want to convert it back to Original string.</p>
| java | [1] |
4,448,138 | 4,448,139 | php apostrophe and quotations | <pre><code>echo "<tr><td><input type = 'button' value = 'Agregar' onclick = 'addrow($leaguesarray[$numofleagues])' /></td></tr></table><br />\n";
</code></pre>
<p>I have the above php code which is failing to call the addrow function I'm pretty sure its because of my quutoes.</p>
<pre><code>echo "<tr><td><input type = 'button' value = 'Agregar' onclick = 'addrow('5a7')' /></td></tr></table><br />\n";
</code></pre>
<p>This also gives me errors I don't understand whats going on please help.</p>
| php | [2] |
2,966,248 | 2,966,249 | Multiple Instances of IE with different proxies | <p>Is it possible to open multiple instances of Internet Explorer using different proxies for each? Would there be any issues multi threading instances of IE?</p>
<p>I was thinking about using WatiN, but I'm open to suggestions if anyone has an alternative solution.</p>
<p>Thanks</p>
| c# | [0] |
2,862,464 | 2,862,465 | Can we read data from ROM | <p>Please let me know how to read data from ROM(Read Only Memory).</p>
<p>If possible in C#</p>
<p>For ExampleS</p>
<p>Like if i have a method to calculate tax in my ROM.Now i will pass paramters from my application and get the output.</p>
| c# | [0] |
486,488 | 486,489 | Get all objects of a certain 'prototype' in JavaScript | <p>I have recently started messing about with JavaScript and building my own jQuery plugins and have stumbled on a problem when using prototypes (something I still don't quite understand but starting to get the gist of it). I have done a fairly detailed search for my problem and couldn't find anything so apologies if this is a dupe.</p>
<p>When the DOM loads I have it cycling through a set of elements and creates new <code>MyObject</code> objects out of these elements with functions defined in <code>MyObject.prototype</code>. Is it possible that in the console or a later time I could go through and retrieve all objects of the <code>MyObject</code> type?</p>
<p>Sorry if my descriptions don't make much sense I am new to the JavaScript world and the terminology escapes me a little.</p>
| javascript | [3] |
5,260,800 | 5,260,801 | how to make multiple line string to single line string? | <p>I have below string</p>
<pre><code>String str="select * from m_menus;
select * from m_roles";
</code></pre>
<p>I want above string in one line
like</p>
<pre><code>String str="select * from m_menus;select * from m_roles";
</code></pre>
<p>I have tried </p>
<pre><code>str1=str.replace("[\r\n]+", " ");
</code></pre>
<p>and also</p>
<pre><code>str1=str.replace("\n"," ");
</code></pre>
<p>Both are not working.</p>
| java | [1] |
284,687 | 284,688 | want to send mails from php using yahoo smtp | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3512021/sending-mails-in-php-using-yahoo-smtp">sending mails in php using yahoo smtp</a> </p>
</blockquote>
<p>require("class.phpmailer.php"); $mail = new PHPMailer();</p>
<p>$mail->IsSMTP();</p>
<p>$mail->SMTPAuth = true; // enable SMTP authentication</p>
<p>$mail->SMTPSecure = "ssl";</p>
<p>$mail->Host = "plus.smtp.mail.yahoo.com";</p>
<p>$mail->Port = 465; // set the SMTP port</p>
<p>$mail->Username = "sumthing@yahoo.com";</p>
<p>$mail->Password = "password";</p>
<p>$mail->From = "sumthing@yahoo.com";</p>
<p>$mail->FromName = "myname";</p>
<p>$mail->AddAddress("you@example.com");</p>
<p>$mail->Subject = "Test PHPMailer Message";</p>
<p>$mail->Body = "Hi! \n\n This was sent with phpMailer_example3.php.";</p>
<p>if(!$mail->Send()) {</p>
<p>echo 'Message was not sent.';</p>
<p>echo 'Mailer error: ' . $mail->ErrorInfo;</p>
<p>} else {</p>
<p>echo 'Message has been sent.';</p>
<p>} ?></p>
<p>After the run it is showing:</p>
<p>SMTP Error: Could not authenticate. Message was not sent.Mailer error: SMTP Error: Could not authenticate. SMTP server error:</p>
<p>were is the error??</p>
| php | [2] |
4,528,337 | 4,528,338 | How to add an existing folder to a VS project which might contain some dlls of same name? | <p>I have written an application(C# project) which i want it to be launched through website (clickonce application).
I want to add an existing folder which contains some dlls, xml files.
It has its own folder structure. I want to add this folder to my project.
Problem is, few dlls which this folder contains are also present in my project and its under references. Both dlls are of different version so I have to add that folder..
Can you please let me know a way to add an existing folder to a project?</p>
<p>Thanks in advance.</p>
| c# | [0] |
656,204 | 656,205 | c#-combining two forms | <p>I want to combine two forms as in the image i have attached.I am able to do the two forms (login form and application form seperately)right now I am not able to make application form to appear in the background of the login form.this is my screen i what.there is any command specific to make the two form combine as in the screen.Please help me.Thanks in advance<img src="http://i.stack.imgur.com/VFo4Y.png" alt="enter image description here"></p>
| c# | [0] |
4,968,550 | 4,968,551 | How to code auto set date and time in php | <p>Attribute <code>DateAdded</code> is example of auto set date and time, Any one can show me how to do auto set date and time. What I want is if I submit new insert form in my system, date and time will be show in the database.</p>
<p><strong>example data in database</strong></p>
<pre><code>DateAdded = 2011-07-28 11:17:09
</code></pre>
| php | [2] |
4,204,730 | 4,204,731 | Adding variables to the global window object in IE | <p>I have a situation where a link opens a new window(child) using Javascript. I am trying to pass a variable to the child window form the parent window by attaching to the new window's <code>window</code> object.</p>
<p>In the parent:</p>
<pre><code>var wnd = open(file, name, attribs);
wnd.a = 10;
</code></pre>
<p>In the child when I do </p>
<pre><code>window.a;
</code></pre>
<p>IE says undefined. This works on Chrome, Firefox and Safari. </p>
<p>Where am I going wrong?</p>
| javascript | [3] |
2,583,511 | 2,583,512 | Get all values from child elements of a dict as a list | <pre><code>T = {'a': {'c': 'A', 'path': '/c'}, 'e': {'c': 'E', 'path': '/e'}, 's': {'c': 'S', 'path': '/s'}}
</code></pre>
<p>I need all 'path' elements as a list. I know I can iterate through everything in a single for, but I would like to know other <em>pythonic</em> ways of extracting it.</p>
| python | [7] |
2,259,592 | 2,259,593 | access $(this) with href="javascript:..." in JQuery | <p>I am using JQuery. I call a javascript function with next html:</p>
<pre><code><li><span><a href="javascript:uncheckEl('tagVO-$id')">$tagname</a></span></li>
</code></pre>
<p>I would like to <strong>remove the <em>li</em></strong> element and i thought this would be easy with the <strong>$(this)</strong> object. This is my javascript function:</p>
<pre><code>function uncheckEl(id) {
$("#"+id+"").attr("checked","");
$("#"+id+"").parent("li").css("color","black");
$(this).parent("li").remove(); // This is not working
retrieveItems();
}
</code></pre>
<p>But <strong>$(this)</strong> is undefined. Any ideas?</p>
| jquery | [5] |
3,655,187 | 3,655,188 | toString method | <p>I want to add a <code>toString</code> method in the <code>Item</code> class that returns the title of the item in there. </p>
<p>I have need make sure that the toString method in the <code>DVD</code> class calls the <code>toString</code> method in <code>Item</code> so that it can return a string that contains both the title and the director. </p>
<p><code>Item</code> is the superclass and <code>DVD</code> is the subclass.</p>
<pre><code> public class Item
{
private String title;
private int playingTime;
private boolean gotIt;
private String comment;
public Item(String theTitle, int time)
{
title = theTitle;
playingTime = time;
gotIt = false;
comment = "<no comment>";
}
// Getters and setters omitted
public void print()
{
System.out.print(title + " (" + playingTime + " mins)");
if(gotIt) {
System.out.println("*");
} else {
System.out.println();
}
System.out.println(" " + comment);
}
</code></pre>
<p>}</p>
<pre><code> public class DVD extends Item
{
private String director;
public DVD(String theTitle, String theDirector, int time)
{
super(theTitle, time);
director = theDirector;
}
// Getters and setters omitted
public void print()
{
System.out.println(" director: " + director);
}
</code></pre>
<p>}</p>
| java | [1] |
170,950 | 170,951 | Android: how to make keyboard enter button say "Search" and handle its click? | <p>I can't figure this out. Some apps have a EditText (textbox) which, when you touch it and it brings up the on-screen keyboard, the keyboard has a "Search" button instead of an enter key.</p>
<p>I want to implement this. How can I implement that Search button and detect press of the Search button?</p>
<p><strong>Edit</strong>: found how to implement the Search button; in XML, <code>android:imeOptions="actionSearch"</code> or in Java, <code>EditTextSample.setImeOptions(EditorInfo.IME_ACTION_SEARCH);</code>. But how do I handle the user pressing that Search button? Does it have something to do with <code>android:imeActionId</code>?</p>
| android | [4] |
2,662,150 | 2,662,151 | Return KeyValuePair or use out variable in C#? | <p>I have a function that needs to return two strings. I've considered two different ways to do this:</p>
<pre><code>string first = "this is first";
string second = "this is second";
KeyValuePair<string, string> ReturnPair()
{
return new KeyValuePair<string, string>(first, second);
}
string ReturnOne(out string other)
{
other = second;
return first;
}
</code></pre>
<p>I would like to use the KeyValuePair<> approach but I feel that I am misusing the purpose for which this object was created.</p>
<p>My questions:</p>
<ol>
<li>Is there a better way to return 2 strings in this example? </li>
<li>Is there anything wrong with returning the KeyValuePair?</li>
</ol>
| c# | [0] |
1,703,967 | 1,703,968 | Output different from what i have expected | <p>Why its printing X88</p>
<pre><code>public static void main(String [] args)
{
char x = 'X';
int i = 0;
System.out.print(true ? x : 0);
System.out.print(false ? i : x);
}
</code></pre>
| java | [1] |
4,892,441 | 4,892,442 | php mailing function - get /'s in the mail | <p>IN my php project i am using php mail funcion . i have send test's as the content . But in my mail it look test\'s . How i avoid this special charector . I put nl2br function .. i also tried add slashes and stripslashes function. But still appear that special charector .. Please help me urgently.. </p>
| php | [2] |
4,960,071 | 4,960,072 | Getting the source code of a page and assigning its content | <p>I am parsing the source code of a web page like this:</p>
<pre><code> private function readPage() {
header("Content-type: text/plain");
$this->pageSource = @readfile ($this->page);
}
</code></pre>
<p>But it seems as if I can't assign the content into the "pageSource" variable. Where it my mistake?</p>
<p>Thanks a lot for your help.</p>
| php | [2] |
1,986,849 | 1,986,850 | input selector with style attribute in jquery | <p>I am selecting an input type using jQuery with some conditions</p>
<pre><code>var inputs = $(this).parents('form').find(
':input[type="text"]:enabled:visible:not("disabled"),textarea');
</code></pre>
<p>For some reason, I am using a style attribute for the input type.</p>
<pre><code><input type="text" style=" visibility:hidden"/>
</code></pre>
<p>How can I ignore the style <code>visibility:hidden</code>?</p>
| jquery | [5] |
380,202 | 380,203 | How to adjust column width while exporting html to pdf+itext dll | <p>I am using iText dll 5.0. to convert html in string form to PDF.
code sample :</p>
<pre><code>StringBuilder header = new StringBuilder();
header.Append("<div style='width:100%;font-family:Arial;font-size:14px;' align ='center'>");
header.Append("<table width='100%' style='border:1px double black;font-size:10px;' CELLPADDING=6 FRAME=BOX>"); ....
</code></pre>
<p>I already set the column width </p>
<pre><code> Contents.Append("<tr><td width='10%'>A</td><td width='90%'>About&nbsp;the&nbsp;Promoter</td></tr>");
</code></pre>
<p>but after export PDF the column width is not set as per supplied. If any body know the solution plz help me.</p>
| asp.net | [9] |
3,650,379 | 3,650,380 | Print XML tag attributes using element tree | <p>I'm using following statements to print the value of Title tag. Its working fine. But I'm also want to print <code><page id='...' .......</code> Is it possible? thanks</p>
<pre><code> <mediawiki>
<siteinfo>
<sitename>Wiki</sitename>
<namespaces>
<namespace key="-2" case="first-letter">Media</namespace>
</namespaces>
</siteinfo>
<page id="31239628" orglength="6822" newlength="4524" stub="0" categories="0" outlinks="1" urls="10">
<title>Title</title>
<categories></categories>
<links>15099779</links>
<urls>
</urls>
<text>
Books
</text>
</page>
</mediawiki>
</code></pre>
<p>Here is my working code. Which print the title tag values.</p>
<pre><code>import xml.etree.cElementTree as etree
tree = etree.parse('find_title.xml')
for value in tree.getiterator(tag='title'):
print value.text
</code></pre>
| python | [7] |
789,722 | 789,723 | add function to an array in php | <p>I'm having trouble declaring an array in conjunction to a function. Here is my code, what am I doing wrong? </p>
<pre><code>private function array_list(){
return array('1'=>'one', '2'=>'two');
}
private $arrays= array(
'a'=>array('type'=>'1', 'list'=>$this->array_list())
);
</code></pre>
<p>Getting unexpected T_VARIABLE error when I run this code.</p>
| php | [2] |
3,868,092 | 3,868,093 | Are there any python libraries/packages like Ruby's Juicer/Sprockets/bundle_fu? | <p>Looking for a python library that handles minifying and merging JS\CSS files together...</p>
| python | [7] |
2,051,429 | 2,051,430 | Use of List inside map C++ | <p>Can I use follwing syntax?</p>
<pre><code> std::map<int,std::list<int>> mAllData;
</code></pre>
<p>Where Key Value(int) will be ID of data.
and said data could have multiple types so storing all them against said key value. I am trying to use it. Can somenody provide sample code how this should work or do I have any other data structure to do so.</p>
<p>Thanks</p>
| c++ | [6] |
4,303,389 | 4,303,390 | what does mean "_Default" partial class and inherited class "System.Web.UI.Page" | <p>I just wanted to know the details that in asp.net, the code behind comes with a partial class "_Default" and this class also inherit from a other class "Page".</p>
<p>what all the functionality in "Page" class and what does mean "_Default" class....why this class is partial. </p>
<pre><code>namespace WebApplication2
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
</code></pre>
| asp.net | [9] |
5,503,706 | 5,503,707 | Downaload a file programatically on android | <p>i am downloading files from web server programatically. after download is complete, i checked the file.the size ,extension and all other parameters are correct but i when i try to play that file in media player it is showing that it is corrupt.</p>
<p>plz help..</p>
<p>code:</p>
<pre><code> byte[] b = null;
InputStream in = null;
b = new byte[Integer.parseInt(size)]; // size of the file.
in = OpenHttpConnection(URL);
in.read(b);
in.close();
File folder = new File("/sdcard", "folder");
boolean check = folder.mkdirs();
Log.d("HttpDownload", "check " + check);
File myFile = new File("/sdcard/folder/" + name);
myFile.createNewFile();
OutputStream filoutputStream = new FileOutputStream(myFile);
filoutputStream.write(b);
filoutputStream.flush();
filoutputStream.close();
</code></pre>
| android | [4] |
5,175,838 | 5,175,839 | I want that when the mouse is over one option in my dropdownlist, the background color of the option value on my second mask must be changed | <p>I have 2 dialog mask on my window. </p>
<p>On the fist one I have a drop-down list with different option values.</p>
<p>On the second I have a div table.</p>
<p>I want that when the mouse is over one option in my drop-down list, the background color of the option value on my second mask must be changed and when I leave the background color be restored to white, so that I can know the corresponded feet and meter's value before i selected.</p>
<p>Please look at the screenshot</p>
| jquery | [5] |
2,149,791 | 2,149,792 | Deleting python modules? | <p>Can you delete python modules? I've installed one that I would like to remove, and can't seem to figure out how.</p>
<p>Thanks</p>
| python | [7] |
825,741 | 825,742 | Detecting health related usb devices(BP,COPD) | <p>How to get notification at the time when we connect the health related usb devices(BP,COPD) to cpu so that I can change the appearance of device image(e.g. Uncheck to check) in my wpf application using c#. The device makers are Lifesource, microlife etc. Is there any way to get the information(like device name,device type,serial number) of the devices when we connect to the cpu to indentify which device is connected on some button click etc?</p>
| c# | [0] |
1,514,731 | 1,514,732 | How to get the output on this PHP script? | <p>I'm a newbie to programming and PHP learning about two dimensional arrays.</p>
<p>When I run this code below, it just gives me a blank page. When I put an echo in front of the function call like this <code>echo usort($a, 'mysort1');</code> the page shows me a 1 (I have no idea why). </p>
<p><strong>What I really want to see is the output of the array after it's been sorted.</strong></p>
<p>Doing <code>var_dump($a);</code> is not what I'm after. how do I show the result of the function?</p>
<p>How? Thanks if you can help.</p>
<pre><code><?php
$a = array (
array ('key1' => 940, 'key2' => 'blah'),
array ('key1' => 23, 'key2' => 'this'),
array ('key1' => 894, 'key2' => 'that')
);
function mysort1($x, $x) {
return ($x['key1'] > $y['key']);
}
usort($a, 'mysort1');
?>
</code></pre>
| php | [2] |
220,270 | 220,271 | how to pass cookies to a new activity? | <p>Say i have one activity that gets a cookie and then starts a new activity.</p>
<pre><code>Intent myIntent = new Intent(this, act2.class);
this.startActivity(myIntent);
</code></pre>
<p>But how do I pass that cookie to the new activity?</p>
<p>Thanks!</p>
| android | [4] |
5,515,036 | 5,515,037 | How to concatenate var names in javascript? | <p>How can i concatenate var names to declare new vars in javascript?:</p>
<pre><code>var foo = 'var';
var bar = 'Name';
</code></pre>
<p>How can i declare variable varName?</p>
| javascript | [3] |
3,758,340 | 3,758,341 | Get current currency rates automatically with a currency converter apps? | <p>I am creating a currency converter app. I know that the value of currencies change, so I was wondering if there is a way to access the Internet in my app to get current rates, and incorporate them into the app seamlessly?</p>
<p>Thank you.</p>
<p><em>UPDATE</em>:</p>
<p>I think my question is being slightly misunderstood. Getting the actual current currency rates is not what is hard for me; the hard part is writing the code to do so. Can someone put me in the right direction and help me understand how to write the code to process this 'return
' format?</p>
| android | [4] |
2,996,411 | 2,996,412 | PHP output to command line | <p>I start my script from command line and it outputs things as they happen but a week ago it stopped outputing and now outputs everything when script finishes. I have ob_start() but as I know this does not effect command line output. </p>
| php | [2] |
3,919,068 | 3,919,069 | Find string between 2 known values in textbox in C# WinForms application | <p><strong>Example:</strong> I want to find 1234 in a string named target:</p>
<pre><code>string target = "55555>>><<[1234]<>>>788";
</code></pre>
<p>How can I find the number between [,] without knowing how much digits between [], before[ or after ]? I need a small code for my project.</p>
<p>Thanks.</p>
| c# | [0] |
145,929 | 145,930 | BitSet vs. raw bitwise manipulation performance | <p>How does BitSet performance compare vs. raw manipulation of say, long values?</p>
| java | [1] |
3,270,067 | 3,270,068 | Problem in mouseover event in JQuery? | <p>I am using a table navigation menu in my website in that i have used JQuery <code>fadeTo()</code> for when I mouse over the menu items (<code><td></code>) it working only once. After same menuitem mouseover is not working. Please tell me whats wrong in my code?</p>
<pre><code>$(document).ready(function() {
$("table.nav td").mouseover(function() {
$("table.nav td:hover").fadeTo("slow", 1.0);
});
});
</code></pre>
| jquery | [5] |
4,083,876 | 4,083,877 | How to find out what's the first child tag name? | <p>I need to find what the first child of an element is.</p>
<h3>For example:</h3>
<pre><code><div class="parent">
<div class="child"></div>
<img class="child" />
<div class="child"></div>
</div>
</code></pre>
<p>In this example the FIRST child is a <code>div</code>.</p>
<h3>Another example:</h3>
<pre><code><div class="parent">
<img class="child" />
<img class="child" />
<div class="child"></div>
</div>
</code></pre>
<p>In this example the first child is a <code>img</code>.</p>
| jquery | [5] |
459,710 | 459,711 | jquery print on newline | <p>I have this jquery code i would like it printing on a new line everytime i click the button.</p>
<pre><code><script language="javascript">
$('.example-default-value').each(function () {
var default_value = this.value;
$(this).focus(function () {
if (this.value == default_value) {
this.value = '';
}
});
$(this).blur(function () {
if (this.value == '') {
this.value = default_value;
}
});
});
function example_append() {
$('#step').append($('#example-textarea'+ /n).val());
}
</script>
</code></pre>
| jquery | [5] |
5,135,690 | 5,135,691 | Image is not posted to twitter in android | <p>I used the below code to post image to twitter,</p>
<p>I am using twitter4j-core-2.2.5 jar file in my application, I really cant understand why it is not posting image to twitter.</p>
<p>IS it possible to post image to twitter?</p>
<pre><code>File f = new File("/mnt/sdcard/13615320329.jpg");
mTwitter.uploadPic(f, String.valueOf(Html
.fromHtml(TwitterApp.MESSAGE)));
public void uploadPic(File file, String message)
throws Exception {
try {
StatusUpdate status = new StatusUpdate(message);
status.setMedia(file);
mTwitter.updateStatus(status);
} catch (TwitterException e) {
Log.d("TAG", "Pic Upload error" + e.getExceptionCode());
throw e;
}
}
</code></pre>
<p>But it is posting only the message,is there anything wrong with Twitter api or did I need to change anything</p>
<p>please answer
Thanks </p>
| android | [4] |
4,284,733 | 4,284,734 | what's the best way to make sure the contents of a list of li does not overflow the static size div? | <p>what's the best way to make sure the contents of a list of li does not overflow the static size div?</p>
<p>For example, lets say I have a ul li of variable sizes of content</p>
<pre><code> <ul>
<li>xxx</li>
<li>xxx</li>
<li>xx</li>
<li>xxxxxxxx</li>
<li>xxxxxx</li>
</ul>
</code></pre>
<p>Now I want the li content to fit into a static size div</p>
<pre><code> <div style="height=40px width=200px"></div>
</code></pre>
<p>How can ensure the data contents of the li does not show cut off data? In other words, is there a way to get the data width of the contents of li to equal less the width of container div of 200px</p>
| jquery | [5] |
2,516,569 | 2,516,570 | File Download Script in PHP | <p>I don't know if this is possible.
I have a webpage with about 250 links, each on a separate line. My initial thought was to use fopen() to get the files, but it did not help much because it requires supplying the name of the file to read/download.</p>
<p>But the files I want to download are listed as links vertically, on one web page like so:</p>
<p><img src="http://i.stack.imgur.com/A9hvr.jpg" alt="enter image description here"></p>
<p>Those are clickable links - think of it like a directory browsing with links to files.
Is there a way to loop through those links on that page and download the files they point to? </p>
<p>There are roughly about 250 links in all.
Thanks for your assistance.</p>
| php | [2] |
1,232,598 | 1,232,599 | Switch focus between opened dialogs | <p>is there any way to programmatically switch focus between shown dialogs?
To resume...
I need method dialog.requestFocus(), but there is no some like that...</p>
<p>Thanks...</p>
| android | [4] |
1,592,656 | 1,592,657 | Android::findViewByID - how can I get View of a TextView through a Listener of another UI element? | <p>This is going to be a bit lame question. I have the following code:</p>
<pre><code>..............
public void onCreate (Bundle bundle)
{
super.onCreate(bundle);
this.setContentView(R.layout.main2);
Button bnt = (Button) this.findViewById(R.id.browser);
bnt.setOnClickListener(new ButtonListener());
}
..............
class ButtonListener implements android.view.View.OnClickListener
{
public void onClick(View v)
{
// I have a TextView in my xml layout file.
// I'd like to get it and change my text when I click this button.
// But I can't get it (the TextView) unless I make it as a value of a static member of this class and pass it to the constructor.
//I believe I am missing a big point here, so i'd be very thankful if you could explain how this is meant to be done ?
}
}
</code></pre>
<p>Any help is appreciated.</p>
| android | [4] |
3,846,484 | 3,846,485 | How to MapPath in a unit test in C# | <p>I want to load an external XML file in a unit test to test some processing code on that XML. How do I get the path of the file?</p>
<p>Usually in a web app I would do:</p>
<pre><code>XDocument.Load(Server.MapPath("/myFile.xml"));
</code></pre>
<p>But obviously in my unit test I have no reference to Server or HttpContext so how can I map a path so that I don't have to specify the full path?</p>
<p><strong>UPDATE:</strong></p>
<p>I just want to make it clear that the code I'm actually testing is for an XML parser class, something like:</p>
<pre><code>public static class CustomerXmlParser {
public static Customer ParseXml(XDocument xdoc) {
//...
}
}
</code></pre>
<p>So to test this I need to parse a valid XDocument. The method being tested does not access the file system itself. I could create the XDocument from a String directly in the test code but I thought it would be easier to just load it from a file.</p>
| c# | [0] |
984,979 | 984,980 | how to extract element from xml/string | <p>i am using 3rd party api and this is what is its returning me:</p>
<pre><code><?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>
\u000a
<errorNotification>
\u000a\u0009
<message>invalid company code<\/message>
\u000a
<\/errorNotification>
</code></pre>
<p>my question is: how can just extract the <code><message></code> from the above string/xml?</p>
| jquery | [5] |
3,799,853 | 3,799,854 | I have method that can change date format and return it but it gives exception | <p>I am trying to display the log file in my application as i need for that i have to format the content to display as i require i firslt trying to display the date for which i can get content from los my log file looks like ... .</p>
<pre><code>[1324649399] Nagios 3.3.1 starting... (PID=3751)
[1324649399] Local time is Fri Dec 23 09:09:59 EST 2011
[1324649399] LOG VERSION: 2.0
[1324649400] ndomod: NDOMOD 1.4b9 (10-27-2009) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1324649400] ndomod: Could not open data sink! I'll keep trying, but some output may get lost...
[1324649400] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1324649400] Finished daemonizing... (New PID=3752)
</code></pre>
<p>in real application data is display for every one and two minut so the content of above file show date/time which is in square bracket "[1324649399]" so i want to change it in this format "[12-27-2011 08:51:22]"
in my method i am trying to change the date first getting from string first then i would implement it for the whole log file my code is,</p>
<pre><code>public Date Date() throws SQLException, ParseException
{
DateFormat Format;
Date date;
String dat="1324649399";
Format=new SimpleDateFormat("dd-MMM-yy");
date=(Date)Format.parse(dat);
return date;
}
</code></pre>
<p>may be the date format is not like that as i mentioned but i need to format it as i mentioned above and it just giving error of exception and nothing more
Hopes to listen from you soon your suggestions </p>
<p>Thanks in Advance!</p>
| java | [1] |
665,851 | 665,852 | What does [[]]*2 do in python? | <pre><code>A = [[]]*2
A[0].append("a")
A[1].append("b")
B = [[], []]
B[0].append("a")
B[1].append("b")
print "A: "+ str(A)
print "B: "+ str(B)
</code></pre>
<p>Yields:</p>
<pre><code>A: [['a', 'b'], ['a', 'b']]
B: [['a'], ['b']]
</code></pre>
<p>One would expect that the A list would be the same as the B list, this is not the case, both append statements were applied to A[0] and A[1].</p>
<p>Why?</p>
| python | [7] |
681,913 | 681,914 | Draw activity Android | <p>For an app i'm making, people need to be able to sign their signature on a white canvas, with a special tactile pen, or their finger. I haven't found a clear way of accomplishing this on the android developer website, or on random tutorials.</p>
<p>Can someone point me in the right direction? </p>
| android | [4] |
5,289,796 | 5,289,797 | how to set value for <select> tag | <p>Using Php I have wrote the drop down list box code.
for Edit employee details I have used the same code and I tried to set the value on list box but the value is not set. how to do this.</p>
<pre><code>Employee Name: <select name=emp_name *$value='$name'*>
<option> -- EMPLOYEE NAME -- </option>
<?
while ($q->fetchInto($row)){
print "<option>$row[0]</option>";
}
?>
</select>
</code></pre>
| php | [2] |
3,499,421 | 3,499,422 | how to use a double value in power function | <p>i am trying to find the power of a value.But the problem is my exponent is a fractional value.power function does not suppporting any datatype other than int.</p>
<pre><code> BigDecimal fd_returns_at_time_of_replace=(BigDecimal.valueOf(capitalDiff).multiply((BigDecimal.valueOf((long)constant1+.09)).pow(temp)));
</code></pre>
<p>here temp is a fractional value.given below is the eror message i am getting.</p>
<pre><code>The method pow(int) in the type BigDecimal is not applicable for the arguments (double)
</code></pre>
<p>please anybody help me to do this.</p>
| android | [4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.