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 |
|---|---|---|---|---|---|
2,850,163 | 2,850,164 | jQuery event not working after load | <pre><code>$(document).ready(function(){
$(function() {
$('a.ajaxload').click(function(e) {
var url = $(this).attr('href');
$('#desktopcontainer').load(url); // load the html response into a DOM element
e.preventDefault(); // stop the browser from following the link
});
});
$(function() {
$(".accordion .accordion-tabs .tab").each(function(){
$(this).click(function(){
if ($(this).hasClass('tab')){
$(this).removeClass('tab');
$(this).addClass('active');
}else{
$(this).removeClass('active');
$(this).addClass('tab');
}
$(this).next().slideToggle('slow');
return false;
});
});
});
});
</code></pre>
<p>My tab works fine but after I click the "a.ajaxload" to add a content to the page, then my tab doesn't respond anymore.</p>
<p>Can anyone please tell me where the problem is?</p>
<p>SOLVED!!!</p>
<p>What I did was to add the function after my load ... look at the new code below and see the difference. I hope it helps someone.</p>
<pre><code>$(document).ready(function(){
initDashboard();
$(function() {
$('a.ajaxload').click(function(e) {
var url = $(this).attr('href');
$('#desktopcontainer').load(url); // load the html response into a DOM element
e.preventDefault(); // stop the browser from following the link
initDashboard();
});
});
function initDashboard() {
$(".accordion .accordion-tabs .tab").each(function(){
$(this).click(function(){
if ($(this).hasClass('tab')){
$(this).removeClass('tab');
$(this).addClass('active');
}else{
$(this).removeClass('active');
$(this).addClass('tab');
}
$(this).next().slideToggle('slow');
return false;
});
});
}
});
</code></pre>
| jquery | [5] |
2,956,906 | 2,956,907 | Merging 2 Collection<T> | <p>I got a Function that returns a Collection<string>, and that calls itself recursively to eventually return one big Collection<string></p>
<p>Now, i just wonder what the best approach to merge the lists? Collection.CopyTo only copies to string[], and using a foreach() loop feels like being inefficient. However, since I also want to filter out duplicates, I feel like i'll end up with a foreach that calls Contains() on the Collection.</p>
<p>I wonder, is there a more efficient way to have a recursive function that returns a list of strings without duplicates? I don't have to use a Collection, it can be pretty much any suitable data type.</p>
<p>Only exclusion, I'm bound to Visual Studio 2005 and .net 3.0, so no LINQ.</p>
<p><strong>Edit:</strong> To clarify: The Function takes a user out of Active Directory, looks at the Direct Reports of the user, and then recursively looks at the direct reports of every user. So the end result is a List of all users that are in the "command chain" of a given user.Since this is executed quite often and at the moment takes 20 Seconds for some users, i'm looking for ways to improve it. Caching the result for 24 Hours is also on my list btw., but I want to see how to improve it before applying caching.</p>
| c# | [0] |
1,456,774 | 1,456,775 | Console application not doing anything | <p>basically I would like to write an application to perform this in command prompt:</p>
<p><code>sslist -H -R -h s234.ds.net /mobile > listofsnapshot.txt</code></p>
<p>then this is my code when i create a c# console application:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Search
{
class Program
{
static void Main(string[] args)
{
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "sslist.exe";
p.StartInfo.Arguments = "-H -R -h s234.ds.net /mobile";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.Start();
string procOutput = p.StandardOutput.ReadToEnd();
string procError = p.StandardError.ReadToEnd();
TextWriter outputlog = new StreamWriter("C:\\Work\\listofsnapshot.txt");
outputlog.Write(procOutput);
outputlog.Close();
}
}
}
</code></pre>
<p>why when i execute my console script, it just hangs there and not do anything?</p>
| c# | [0] |
5,872,826 | 5,872,827 | C#, what is a binary null character? | <p>I have a requirement to create a sysDesk log file. In this requirement I am supposed to create an XML file, that in certain places between the elements contains a binary null character. </p>
<p>Can someone please explain to me, firstly what is a binary null character, and how can I write one to a text file?</p>
| c# | [0] |
3,399,565 | 3,399,566 | Python max-by function? | <p>Example:</p>
<pre><code>print max(chain_length(i) for i in xrange(1,10001))
</code></pre>
<p>This returns the maximum/biggest "chain_length" (an arbitrary function), but what I want is the <code>i</code> value for input that produces the biggest value.</p>
<p>Is there a convenient way to do that?</p>
| python | [7] |
2,328,243 | 2,328,244 | jump forward in jQuery animation? | <p>Is there a way to jump a jQuery animation forward / backward in time?</p>
<p>For example, if I have set an animation on an element to take 10 seconds, can I jump to '5 seconds' into that animation? Preferably, this could be set with a percentage.</p>
| jquery | [5] |
686,553 | 686,554 | Android print stack trace | <p>How can I get the equivalent of a printStackTrace in android? I know I can log an error, by passing in a tag name and a String to the logging method, but that just gives me a nullpointerexception. If I call e.printStackTrace(), where is this data printed to?</p>
| android | [4] |
4,677,761 | 4,677,762 | iOS: How to display multiple images dynamiclly in imageview? | <p>Hi I am new to iPhone.</p>
<p>What I need is, have to display only one image in one case, two images in another case like wise and for that I am using a <code>UIImageview</code> with <code>IBOutlet</code>. </p>
<p>How can I display multiple images in single imageview? </p>
<p>Please help me post some code. </p>
<p>Thank you.</p>
| iphone | [8] |
5,045,387 | 5,045,388 | ILoadValueChangedEventArgs not fired in C# | <pre><code>protected void ILoad1_ValueChanged(object sender, Radactive.WebControls.ILoad.ILoadValueChangedEventArgs e)
{
btnSelectImage.ImageUrl = "~/Uploads/Originals/Temp/" + ILoad1.Value.SelectedImage.FileName;
}
</code></pre>
<p>this event not fired in C# </p>
| c# | [0] |
1,861,313 | 1,861,314 | Can Javascript get information on any window? | <p>A little bit ago I asked <a href="http://stackoverflow.com/questions/4785399/how-to-tell-if-a-window-exists-in-javascript">this question</a> about if a child can get information on its parent. But now I realize that I have a followup question that belongs on its own, rather than in comments: Can Javascript find out if <em>any</em> window is open?</p>
<p>I have a window A which can either be called from window B or window C. However, when I close A, I want certain things in the <code>onUnload</code> only to happen if window C is closed. Now, A <em>may not have been opened</em> by C, so I can't rely on <code>window.opener</code>. Is there any way I can find out information on arbitrary windows? I thought about checking <code>window.opener.location</code> but that still requires that C have been the opener, which it may not have been. The names of all the windows are known, so if I could search by those, I'd be golden.</p>
<p>(as for the why: A is a chat console, B is the main menu, C is the queue monitor. When someone is in the queue monitor, they're marked as available for chat. But to actually chat, they have to load up the chat console to do so. Normally, when you close the chat console, an <code>onUnload</code> tries to mark you unavailable, but I don't want to that to happen if the queue monitor is still open.)</p>
| javascript | [3] |
1,285,205 | 1,285,206 | How to parse Youtube search results? | <p>When a user submits a query, I would like to append this to search results in Youtube and download this "page" on the backend of my code (Python-Django).</p>
<p>What is the best way to do this?
Do you suggest that I do this manually? And create a custom parser? Scanning each line for a certain pattern...</p>
<p>Or is there an easier way, such as using their API?</p>
<p>By the way, I am familiar with crawling. I just want to know the method for YOUTUBE. I understand how to download/parse pages. (I will be using urllib2.)</p>
| python | [7] |
2,867,855 | 2,867,856 | Display local pages with fully functional browser | <p>I originally started out displaying a web page in the assets folder using a WebView. However I seem to have grown beyond that as my page is not behaving as I would expect. According to the developer docs WebView should only be used for static pages that have no interactions. CSS, javascript etc. are not enabled. This makes sense with the behavior I am seeing. While my page renders nicely in the dev environment browser it looks like plain HTML on the device with no css or javascript capabilities. So if I want to display a local (assets folder) html page with css and javascript etc. enabled how would I go about doing that? I assume tutorials exist for such a simple thing but my Googling is coming up empty.</p>
<p>On the off chance my links as bad here is the header.</p>
<pre><code><head>
<link href="folderA/folderB/file.css" rel="stylesheet" />
<script src="folderA/js/file.js"></script>
</head>
</code></pre>
<p>Thank You again for helping this noob.
JB</p>
<p>Just found this. Might be on the right track?
<a href="http://developer.android.com/guide/webapps/index.html" rel="nofollow">http://developer.android.com/guide/webapps/index.html</a></p>
| android | [4] |
285,557 | 285,558 | How to loop my data for PHP | <p>I have some data which was json decoded and looks like this:</p>
<pre><code>stdClass Object
(
[6] => stdClass Object
(
[13] => stdClass Object
(
[buildingId] => 1
)
)
[8] => stdClass Object
(
[20] => stdClass Object
(
[Id] => 1
)
)
</code></pre>
<p>Thing is i don't know how to loop to get the information to use it in my script.</p>
<p>I need to get for example:</p>
<pre><code>$key, $innerkey, $Id = 1
Object [8][20].Id = 1
</code></pre>
<p>The two numbers are X;Y co ordinates so its important i get those values aswell as the id.</p>
<p>I managed to get the first key:</p>
<pre><code>$obj = JSON_decode($_GET['data']);
foreach($obj as $key) {
echo $key;
}
</code></pre>
<p>How do i get the innerkey assigned to a variable ?</p>
| php | [2] |
549,740 | 549,741 | RandomAccessFile to read xml file | <p>I am trying to use RandomAccessFile to read xml file. The thing is that I want to read only certain length at a time until end of file.</p>
<pre><code>ReadUTF() read entire lines in the file which I do not want
Read(byte,start,end) seems what I need, but it is readying in byte so it doesnt contain the actual text of the read content.
</code></pre>
<p>Is there a way I can read a xml file in certain Length at a time using RandomAccessFile?</p>
<p>Thanks.</p>
| java | [1] |
949,735 | 949,736 | Set button clickable property to false | <p>I need to disable the click event for a button in android.Just as a sample i tried doing the following.I have taken a text view named it(entered a text) as "Name" .The condition checks if text view is empty button clickable should be set to false.However this does not happen although the Toast is printed.Can somemone tell me the reason.Also if the text field is non empty i want to reset the clickable event for button as true. </p>
<pre><code>public class ButtonclickabkeActivity extends Activity
{
TextView tv;
Button btn;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tv=(TextView)findViewById(R.id.textView1);
tv.setText("Name");
btn=(Button)findViewById(R.id.button1);
if(tv.getText().toString().length()!=0)
{
btn.setClickable(false);
Toast.makeText(getApplicationContext(),""+tv.getText().toString().length(), Toast.LENGTH_LONG).show();
}
else
{
btn.setClickable(true);
}
btn.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View arg0) {
Toast.makeText(getApplicationContext(), "Button clicked",Toast.LENGTH_LONG).show();
}
});
}
}
</code></pre>
<p>The following is my XML file:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<TextView android:text="TextView" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</LinearLayout>
</code></pre>
| android | [4] |
2,305,441 | 2,305,442 | Do PHP sessions get lost when directing to a payment gateway? | <p>If i was to store some order details in a session whilst the customer is redirected to a payment gateway, would they be lost by the time the custom returns back from the gateway?</p>
<p>My plan is:</p>
<p>website take order -> store order in session -> website goes to paypal -> payment made -> returns using paypal autoreturn to confirmation page -> on return get session order data and submit to database.</p>
| php | [2] |
3,336,800 | 3,336,801 | How to prevent images from being copied from an iPhone/iPad app | <p>My App will require the use of about 500 images and this number could possibly grow. Those images are read-only and the user won't add any pictures while using the app.</p>
<p>Image sizes will probably range between 50 to 250k .</p>
<p>I want to prevent the images from being copied by someone exploring the bundle resources for example.</p>
<p>So far I am thinking of putting all the images in a SQLite database and then encrypt it using SQLCipher for example.</p>
<p>Does this seems a bit over the top ?</p>
<p>In your opinion what would be the best solution ?</p>
<p>Could Apple reject it ?</p>
<p>I understand that people can always take screenshots, etc... but I just want to make it difficult without it being a nightmare to code and use.</p>
<p>Cheers,
Duz</p>
| iphone | [8] |
4,577,761 | 4,577,762 | How to get the word on which a click was made in javascript | <p>can we get the word on which a right click was made and x,y coordinates of that word ?
i tried:
<code>document.onclick=getTextOnClick;</code></p>
<pre><code>function getTextOnClick(e)
{
console.log(e);
if (window.getSelection) {
txt = window.getSelection();
console.log(">>>"+txt);
} else if (document.getSelection) {
// FireFox
txt = document.getSelection();
console.log(txt);
} else if (document.selection) {
// IE 6/7
txt = document.selection.createRange().text;
console.log(txt);
}
}
</code></pre>
<p>Now this code works if i select some text, but can i get the same when i just eight click or click on certain word ? And event object is giving me coordinates of click. can i get coordinates of the word on which the click was made ? Plz help</p>
| javascript | [3] |
4,701,260 | 4,701,261 | Android Activity with camera | <p>Is there any method to find whether an activity which is running is using the camera or not? Thanks in advance.</p>
| android | [4] |
4,495,413 | 4,495,414 | setting smtp server in php geekmail | <p><a href="http://github.com/NeilCrosby/multi-level-vcards/blob/master/via-email/geekMail-1.0.php" rel="nofollow">http://github.com/NeilCrosby/multi-level-vcards/blob/master/via-email/geekMail-1.0.php</a></p>
<p>That's a link to the class. How can I set the smtp server?</p>
<p>My current code looks like:</p>
<pre><code>require_once( 'assetform/geekMail-1.0.php' );
$geekMail = new geekMail();
$geekMail->setMailType('html');
$geekMail->from('xx@gmail.com', 'no-reply');
$geekMail->to('xx@gmail.com');
$geekMail->subject('Request');
$geekMail->message('this is a test email.');
$geekMail->attach($path.'1287448945.pdf');
</code></pre>
| php | [2] |
3,375,973 | 3,375,974 | addEventListener fails inside of function | <p>I'm having trouble adding an event listener. I'm basically encapsulating all keyboard-related functions into a JavaScript class like so:</p>
<pre><code>function Keyboard()
{
this.key = new Array();
for(x=0;x<255;x++)
{
this.key[x] = false;
}
function keyDown(evt)
{
this.key[evt.keyCode] = true;
console.log("Keydown bioch");
}
function keyUp(evt)
{
this.key[evt.keyCode] = false;
}
window.addEventListener('keydown', this.keyDown, true);
window.addEventListener('keyup', this.keyUp, true);
}
</code></pre>
<p>Except that it doesn't work - at all. When I remove the Keyboard function and make everything global (key[], keyDown, keyUp, and addEventListener calls), everything works.</p>
<p>What am I doing wrong?</p>
| javascript | [3] |
5,017,871 | 5,017,872 | How to make top textarea blank when new row is added | <p>I have a jsfiddle <a href="http://jsfiddle.net/4Pc4B/10/" rel="nofollow">http://jsfiddle.net/4Pc4B/10/</a>. In the jsfiddle, type in a question in the textarea and then click on the "Add Question" button. This adds the question in a new row underneath but the problem is that when this happens, the textarea at the top still displays the question. I want it so that if the user has clicked on the "Add Question" button AND if the question is added in a new row, then the textarea on top should go blank. How can this work?</p>
<p>Below is code to make the textarea blank:</p>
<pre><code>var area = document.getElementsByTagName('textarea');
for (var i = area.length-1; i>=0; i--) {
if ('questionText'===area[i].name) area[i].value = "";
}
</code></pre>
<p>Where do I display this code?</p>
<p>Thanks</p>
| jquery | [5] |
633,953 | 633,954 | Is multiple inheritance acceptable for nodes in a tree? | <p>I was wondering:</p>
<p>With a tree, the root can have multiple children and no id. All nodes (except the root) have an id and the leaf nodes can not have children. It is fixed what type must be used for each depth. So the leaves are always of the same type and so are the parents of the leaves.</p>
<p>Since the root and the nodes can have children and only the nodes have an id I was wondering if the following use of multiple inheritance is acceptable:</p>
<pre><code>class NodeWithId
{
private:
std::string m_id;
};
template<typename T>
class NodeWithChildren
{
private:
std::vector<T> m_nodes;
};
class Network: public NodeWithChildren<Subnet>
{
};
class Subnet: public NodeWithChildren<Machine>,
public NodeWithId
{
};
class Machine: public NodeWithChildren<Application>,
public NodeWithId
{
};
class Application: public NodeWithId
{
};
</code></pre>
<p>Or is there a better way to implement this?</p>
<p>edit: </p>
<ul>
<li>removed virtual</li>
<li>changed classnames</li>
</ul>
| c++ | [6] |
3,800,678 | 3,800,679 | Gridview1 Edit event to Common Routine () to Gridview1 onRowEdit | <p>In aspx web site Whenever Gridview Edit event is raises in my project . it first call one common routine for validate edit Authorization and then it continue its event its possible.. ??</p>
<p>like</p>
<p>Gridview1 Edit event - > Common Routine () ->Gridview1 onRowEdit</p>
| asp.net | [9] |
4,320,624 | 4,320,625 | jQuery, trying to save click event, unbind and rebind, unable to rebind | <p>I am stuck trying to unbind and rebind a click event. I want to "save" the click event, unbind it, and rebind it with a conditional statement.</p>
<p>I'm able to get the click handler saved using the information here: <a href="http://stackoverflow.com/questions/2518421/jquery-find-events-handlers-registered-with-an-object/2519061#2519061">jQuery find events handlers registered with an object</a></p>
<p>I am on an older version of jQuery (1.5), so I'm using the data("events") method.</p>
<p>So far...</p>
<pre><code>var events = $('#myElement').data("events");
alert(events.click[0].handler);
$('#myElement').unbind('click');
</code></pre>
<p>Now it will alert me the handler function and it looks correct. I want to add stuff to it, but I thought for starters I would just try rebinding the same click event. However, I'm not sure how to rebind correctly. Things I have tried:</p>
<pre><code>$('#myElement').bind('click', null, events.click[0].handler); // gives 'click.0 is null or not an object
$('#myElement').bind('click', events.click[0].handler); // gives 'click.0 is null or not an object
$('#myElement').bind('click', null, events.click); // seems to have no effect
$('#myElement').bind('click', events.click); // seems to have no effect
</code></pre>
<p>So I feel I almost have it but I'm not sure what to do from here. How do I use the events variable to rebind the click event?</p>
<p>Thank you for any and all help.</p>
| jquery | [5] |
19,717 | 19,718 | How to check selected value of a radio group using id | <p>I've seen many examples in stackoverflow getting the group radio value using input name. Is there any way to find it using id ?</p>
| javascript | [3] |
4,561,730 | 4,561,731 | how to extract web page textual content in java? | <p>i am looking for a method to extract text from web page (initially html) using jdk or another library . please help</p>
<p>thanks</p>
| java | [1] |
1,849,869 | 1,849,870 | Overload Generator | <p>Is there an app or website where I can input parameter info (types and variable names), their defaults, and have it generate all the combinations of method overloads?</p>
<p>I have a class where the constructor can take in five parameters of different types. The parameters get mapped to properties, none of which have public setters. Each parameter has a default value.</p>
<p>I want my class to have overloaded constructors for all the various combinations of the parameters (ranging from no parameters to any and all combinations of the five parameters). To make it more confusing, one of the parameters can be passed in as a specific type or as a string, and I want the various combinations of overloads to take that into consideration.</p>
<p>Update:</p>
<p>I agree this design may not be the best. The class in question is one I'm using in a similar fashion to the PropertyMetadata class of WPF's DependencyProperty. A value is assigned for the property backing, and a new instance of the metadata class is passed in at that time. It's forcing my hand to create this cascading series of constructor overloads. Example:</p>
<pre><code>private ModelProperty<UserModel, string> firstNameProperty =
RegisterProperty(p => p.FirstName, new ModelPropertyMetadata(**** lots of overloads here ****));
public string FirstName
{
get { return GetValue(firstNameProperty); }
set { SetValue(firstNameProperty, value); }
}
</code></pre>
<p>Maybe that's not the best design. I could possibly extend ModelPropertyMetadata to new classes which describe specific overloads, but that just seems like its pushing the problem somewhere else. Any thoughts on how to make this design better?</p>
| c# | [0] |
4,317,629 | 4,317,630 | Why assign a new ArrayList to a List variable? | <p>I am new to java and when I go through the code of many examples on net I see people declaring the variable for an <code>ArrayList</code> as simply <code>List</code> in almost all the cases.</p>
<pre><code>List<String> myList = new ArrayList<String>();
</code></pre>
<p>I don't understand if there is some specific advantage of doing this. Why can't it be an <code>ArrayList</code> itself, like so:</p>
<pre><code>ArrayList<String> myList = new ArrayList<String>();
</code></pre>
| java | [1] |
5,756,425 | 5,756,426 | Circular progress bar | <p>I am working on an application that needs a "circular progress bar" something like this (it doesn't need to have color changes or be empty in the middle, a simple thing would be enought for me, but if you'd like to tell me how to make color changes aswell i'll be happy to learn :) )</p>
<p><img src="http://i.stack.imgur.com/4WSAF.jpg" alt="enter image description here"></p>
<p>I want to use it to show the battery percentage in my app</p>
| android | [4] |
2,878,342 | 2,878,343 | AJAX Callback not firing during cross domain request | <p>I have the following script:</p>
<pre><code>var queryString = $("#recurringForm").serialize();
var action = "https://www.beanstream.com/scripts/recurring_billing.asp?" + queryString;
$.ajax({url : action,
type: 'GET',
success : function () {
alert("this should be called");
submitPayment();
}
});
</code></pre>
<p>Everything here works except for the callback. Is this because I'm posting to a domain different from my own? If so, how do I get around this.</p>
| jquery | [5] |
436,256 | 436,257 | Efficiently adding child nodes | <p>I need to add <code>x</code> children to a div. So far I'm just using:</p>
<pre><code>for (var i = 0; i < x; i++) {
element.appendChild(document.createElement(‘div’));
}
</code></pre>
<p>But I feel like creating the same empty node every time is kinda redundant. However...</p>
<pre><code>var b = document.createElement('div');
for (var i = 0; i < x; i++) {
element.appendChild(b);
}
</code></pre>
<p>Only seems to create a single child.</p>
| javascript | [3] |
3,689,428 | 3,689,429 | how to implement double click in android | <p>I am doing a project in which i want to display a particular message on single touch and another message on double touch using android.How can i implement it.</p>
<p>My sample code is below</p>
<pre><code>if(firstTap){
thisTime = SystemClock.u`enter code here`ptimeMillis();
firstTap = false;
}else{
prevTime = thisTime;
thisTime = SystemClock.uptimeMillis();
//Check that thisTime is greater than prevTime
//just incase system clock reset to zero
if(thisTime > prevTime){
//Check if times are within our max delay
if((thisTime - prevTime) <= DOUBLE_CLICK_MAX_DELAY){
//We have detected a double tap!
Toast.makeText(AddLocation.this, "DOUBLE TAP DETECTED!!!", Toast.LENGTH_LONG).show();
//PUT YOUR LOGIC HERE!!!!
}else{
//Otherwise Reset firstTap
firstTap = true;
}
}else{
firstTap = true;
}
}
return false;
</code></pre>
| android | [4] |
531,053 | 531,054 | Android "Back" button is not behaving as I think it should | <p>I've read through and tried several of the suggested solutions and nothing seems to work. Any guidance would be appreciated.</p>
<p>Here is some additional information. My Application can go as deep as 4 activities. For example, after launching from the home screen, the user is taken to my applications main menu. From here they can click an options menu to view an about screen that gives them version info etc. My assumption would be if they hit back from the about menu that they would be taken back to my applications main menu. Instead, the app exits and they are taken back to the home screen. Logcat gives the following output:</p>
<pre><code>D/MAIN_BROWSER: MainBrowser::onCreate
D/MAIN_BROWSER: MainBrowser::onStart
D/MAIN_BROWSER: MainBrowser::onResume
</code></pre>
<p>** the above is as expected. Now I hit the about activity **</p>
<pre><code>D/MAIN_BROWSER: MainBrowser::onSaveInstanceState
D/MAIN_BROWSER: MainBrowser::onPause
D/ABOUT: AboutBroswer::onCreate
D/ABOUT: AboutBrowser::onStart
D/ABOUT: AboutBrowser::onResume
</code></pre>
<p>** now user hits the back button **</p>
<pre><code>D/ABOUT: AboutBrowser::onBackPressed
D/ABOUT: AboutBrowser::onPause
D/MAIN_BROWSER: MainBrowser::onStop
D/MAIN_BROWSER: MainBrowser::onDestroy
</code></pre>
<p>** now I'm back at the home screen **</p>
<p>Thanks, BRoid</p>
| android | [4] |
1,669,497 | 1,669,498 | Search for file in folder using php | <p>I am storing user uploaded files like pdf images and txt files in separate folders using my php script i want to retrieve the file names from the folder upload and give the pdf and txt in a group and also way to search for specific file.</p>
<p>I also need to rename the file before to <code>$ja</code> variable</p>
<pre><code>$ja
$da = date("dmY");
$ja = $uid.$da;
move_uploaded_file($mi, $uploadpath)
</code></pre>
<p>also used this code which i found in stack</p>
<p>Example 01:</p>
<pre><code><?php
// read all files inside the given directory
// limited to a specific file extension
$files = glob("./ABC/*.txt");
?>
</code></pre>
<p>Example 02:</p>
<pre><code><?php
// perform actions for each file found
foreach (glob("./ABC/*.txt") as $filename) {
echo "$filename size " . filesize($filename) . "\n";
}
?>
</code></pre>
| php | [2] |
4,420,668 | 4,420,669 | milliseconds until next 5th second | <p>So I want to do some monitoring and I want it to be on every fifth minute, so for example if the application starts at 1:47 monitor everything until 1:50 and then reset. I currently have this working for hour but I need to cut it down to every fifth minute and I'm having a little trouble coming up with the math.</p>
<p>I get all of the current time information</p>
<pre><code> Calendar currentCalendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
long currentTimeInMillis = currentCalendar.getTimeInMillis();
int hr = currentCalendar.get(Calendar.HOUR_OF_DAY);
int min = currentCalendar.get(Calendar.MINUTE);
int sec = currentCalendar.get(Calendar.SECOND);
int millis = currentCalendar.get(Calendar.MILLISECOND);
</code></pre>
<p>Now I need to find the next fifth minute, for hour I have this which works.</p>
<pre><code> millisUntilNextHour = currentTimeInMillis + ((60L - min) * SECONDS_IN_MINUTE * 1000L) + ((60 - sec) * 1000L) + (1000L - millis);
</code></pre>
<p>Can anybody think of a way similar to above to get the milliseconds to the closest fifth minute?</p>
| java | [1] |
308,161 | 308,162 | Native Android Application Java Front End | <p>I am trying to produce a java front end, via some sort of Android "view" that will allow me to show the console output from a native C/C++ application binary.</p>
<p>I followed the steps from various google searches and I have a tool chain that produces native binarys that I can then "adb push" onto the android device. I can either use the adb shell or a console application like ConnectBot to native to the pushed path and run the binary like so: ./someApplication.</p>
<p>However as I stated in my opening sentence I would like to wrap this binary with a font end producing an apk that can be loaded onto the phone and when it runs it opens up and directs the stdio output from the native binary to the screen.</p>
| android | [4] |
3,472,183 | 3,472,184 | one handler running in this time click the gallery handler will stop next 3 sec will run handler how can implemented | <p>hi
i am gallery application i am using handler in rotating gallery images
protec</p>
<pre><code>ted void onStart() {
super.onStart();
isUpdateUI = true;
mRedrawHandler.handleMessage(new Message());
}
@Override
protected void onPause()
{
super.onPause();
isUpdateUI = false;
}
class RefreshHandler extends Handler {
@Override
public void handleMessage(Message msg) {
SeaSpell.this.updateUI();
}
public void sleep(long delayMillis) {
this.removeMessages(0);
if(isUpdateUI==true)
sendMessageDelayed(obtainMessage(0), delayMillis);}
}
public void updateUI(){
getImages();//this is gallery rotation method
mRedrawHandler.sleep(5000);}
</code></pre>
<p>next activity gallery image clicking
g.setOnItemClickListener(new OnItemClickListener() {</p>
<pre><code> public void onItemClick(AdapterView<?> parent, View v, final int position, long id)
{
timer.schedule(new TimerTask(){
public void run()
{
try {
isUpdateUI=false;} },5000)});
</code></pre>
<p>click the gallery item or scrooling then handler will stop in 5sec will be running how can implemented this topic critical one please forward some solution i am try to more days but not get any solution please forward some suggestion</p>
| android | [4] |
195,345 | 195,346 | Convert String to Double in android | <p>I have a string 14469562 and I want to convert it to Double.But after converting a get a different value than the excepted value.</p>
<p>This is the code that I did :</p>
<pre><code>String s="14469562 ";
double d = Double.valueOf(s.trim()).doubleValue();
</code></pre>
<p>My result is 1.4469562E7 which is wrong. How can I convert this ? </p>
| android | [4] |
5,700,850 | 5,700,851 | Making a php script that supports modules | <p>Ok, this is kind of non-descriptive, but I wish to make a site in which I am able to add and remove "functions" via adding and removing php modules.
Basically, is it possible to make a site like a framework where you can insert and remove various php modules, similar to how you can enable and disable modules in any other program
Does this make any sense? :)</p>
| php | [2] |
4,489,988 | 4,489,989 | How to check a div is exists or not? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery">Is there an “exists” function for jQuery</a> </p>
</blockquote>
<pre><code> <div class="XXX">
<div class="created">
</div>
</div>
</code></pre>
<p>div <code>class="created"</code> automatically generated by JavaScript using append function jQuery for some validation i need to check whether div is generated or not how can i do this.using jQuery.</p>
<p>something like <code>$('.xxx').html()==' '</code></p>
| jquery | [5] |
1,894,102 | 1,894,103 | Get hours difference from UTC to given timezone with Python | <p>Is there a way to get how many hours a differene there is between UTC and a given timezone?</p>
<p>For instance the difference between UTC and Europe/Amsterdam is +2 hours.</p>
<p>Is there something in python for this?</p>
| python | [7] |
2,961,973 | 2,961,974 | getting full path of a file that is located at ftp server using java | <p>how to get the full path of a file that is located at an ftp server using java (is it possible to get path using sinetfactory api)</p>
| java | [1] |
5,231,517 | 5,231,518 | Will public access modifiers limits flexibility in changing code?If so give some examples | <p>Will public access modifiers limits flexibility in changing code?If so give some examples..</p>
| java | [1] |
5,103,372 | 5,103,373 | c++ problem, maybe with types | <p>I have a little problem in my code. The variables don't want to change their values. Can you say why?
Here is my code:</p>
<pre><code>vector<coordinate> rocks(N);
double angle;
double x, y;
// other code
while (x > 1.0 || x < -1.0 || y > 1.0 || y < -1.0) {
angle = rand() * 2.0 * M_PI;
cout << angle << endl;
cout << rocks[i - 1].x << endl;
cout << rocks[i - 1].y << endl;
x = rocks[i-1].x + r0 * cos(angle);
y = rocks[i-1].y + r0 * sin(angle);
cout << x << endl;
cout << y << endl << endl;
}
// other code
</code></pre>
<p>And the result on the console is:<br>
6.65627e+09<br>
0.99347<br>
0.984713<br>
1.09347<br>
0.984713 </p>
<p>1.16964e+09<br>
0.99347<br>
0.984713<br>
1.09347<br>
0.984713</p>
<p>As you see the values of x, y variables doesn't change and this while be an infinity loop. What's the problem? What do you think?</p>
| c++ | [6] |
4,199,660 | 4,199,661 | Android how to link xml with button? | <p>I know how to screen1.xml to screen2.xml, with onClick method in my .java. But isit possible for me to just redirect to a xml with just ? I mean without anything in .java. Because i am about to have alot of xml layout with button linked to one xml.</p>
<p>Screen1 button > screen5</p>
<p>Screen2 button > screen5</p>
<p>Screen3 button > screen5</p>
<p>Screen4 button > screen5</p>
<p>and so on, i might have like 100over layouts link to screen5 so if i can just done everything in xml without needed to create .java for each of them could do me a big favour.</p>
| android | [4] |
1,823,031 | 1,823,032 | PHP: Inserting a reference into an array? | <p>I'm trying to insert into an array at a certain point:</p>
<pre><code>$hi = "test";
$var2 = "next";
$arr = array(&$hi);
$arr[] = &$var2; // this works
array_splice($arr, 1, 0, &$var2); // this doesn't
</code></pre>
<p>Why does trying to insert it into the array with splice fail and using the first method doesn't?</p>
| php | [2] |
1,438,884 | 1,438,885 | How to implement FmDatabase in my iphone application? | <p>I want some tutorials or some help from that i can get idea of applying fmdatabase to my app.</p>
| iphone | [8] |
843,876 | 843,877 | Converting City&Country to Coordinate points | <p>Is there any fairly fast php code to convert a city + country to latitude and longitude coordinates. I have a list of locations and I need to convert them to coordinates. I tried doing it in javascript, but I encountered some problems trying to get the results back to php to store it in my JSON file. So is there any efficient PHP code to do this?</p>
<p>Thanks.</p>
| php | [2] |
382,113 | 382,114 | Navigation doubts in iphone | <p>I have to pass a value from one view-controller to another view-controller,my this code works fine </p>
<pre><code>NSString *localStringtextnote;
-(IBAction)_clickbtnsyncNote:(id)sender
{
localStringtextnote = textVieww.text;
Googledocmainpage *detailViewController = [[Googledocmainpage alloc] initWithNibName:@"Googledocmainpage" bundle:nil];
detailViewController.localStringtextnote = localStringtextnote;
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
</code></pre>
<p>but i want to pass localStringtextnote through this way</p>
<pre><code>Googledocmainpage *aSecondViewController = [[Googledocmainpage alloc] initWithNibName:@"Googledocmainpage" bundle:nil];
aSecondViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:aSecondViewController animated:YES];
[self.navigationController pushViewController:aSecondViewController animated:YES];
</code></pre>
<p>how to pass a value through the above page rediriction method?i hope u understand my question.thanks in advance.</p>
| iphone | [8] |
1,927,485 | 1,927,486 | when I run my asp.net website and I try create file I have an error 'Access denied' | <p>my website does not create files and I set asp.net to write to directory.</p>
| asp.net | [9] |
5,777,243 | 5,777,244 | Python: use a global list in a callback function | <p>This is my callback function and I set the rcv_buffer to be global</p>
<pre><code>def rx_callback(ok, payload):
global n_rcvd, n_right, rcv_buffer
n_rcvd += 1
(pktno,) = struct.unpack('!H', payload[0:2])
if ok:
n_right += 1
rcv_buffer.append((pktno, payload))
</code></pre>
<p>And in the main() I continuously check the buffer to see whether the buffer is empty:</p>
<pre><code> while 1:
while len(rcv_buffer) > 0:
(pktno, payload) = rcv_buffer.pop(0)
print 'pktno = ', pktno, 'payload = ', payload[2:]
</code></pre>
<p>But I didn't do any synchronizations! Can I be sure that my operations on the list will not crash?Thanks!</p>
| python | [7] |
2,575,240 | 2,575,241 | How to accurately get difference between two DateTime object in "Years" [Closed, use NodaTime] | <p>How to accurately get difference(in years) between two <code>DateTime</code> objects in "Years"?</p>
<p><code>DateTime.Subtract()</code> gives difference in <code>TimeSpan</code> and the maximum denomination is Days. </p>
<p>So, if I would want to get accurately, the difference between Today and a day in 1988(say 29th March 1988), is there an "easier" way to get the accurate age of this person?</p>
<p>What I've tried is:</p>
<pre><code>DateTime March291988 = DateTime.Parse("29/03/1988");
TimeSpan ts = DateTime.Now.Subtract(March291988);
int years = (ts.Days/365);
</code></pre>
<p>More importantly, the question is: How to convert from TimeSpan to DateTime.</p>
| c# | [0] |
3,557,436 | 3,557,437 | Python String display | <p>I want to display whatever is in <em>line1</em> to <em>line3</em>, which are inputs from the user. So I assign it to variable <code>print_out</code> but don't know a way how to make it work so that when it write in a text-file it is endented with <code>\n</code>. What should I put in the string? </p>
<pre><code>line1 = raw_input("line 1: ") #input from user and are store in line1
line2 = raw_input("line 2: ") #input from user and are store in line2
line3 = raw_input("line 3: ") #input from user and are store in line3
print_out = #here i want to assign line1-line 3 as string and assign it to variable print_out
txt.write(print_out) #will write whatever it is typed inside print_out on to a file
</code></pre>
<p>The question is, how do I assign stuff into <code>print_out</code>? I know a way how to do it, but that's more coding, so I want to use string to do it. The other way is:</p>
<pre><code>txt.write(line1)
txt.write("\n")
txt.write(line2)
txt.write("\n")
txt.write(line3)
txt.write("\n")
</code></pre>
<p>But I want to use a string to display this, so I don't have to write so much. How do I do it so it display like that but using string instead of keep writing txt.write to enter new line. thanks.</p>
| python | [7] |
1,991,744 | 1,991,745 | How to put other activity in a tabhost? | <p>I'm a newbie in android can anyone help me with my problem about TabHost?
i have a Tab host and 3 class want i want is to put or call this activiy or class to TabHost. what I'm going to do. Here is my code in my Tab Host:</p>
<pre><code>public class Tab extends Activity {
TabHost th;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab);
Resources res = getResources();
th = (TabHost)findViewById(R.id.tabhost);
th.setup();
TabSpec specs = th.newTabSpec("tag1");
specs.setContent(R.id.tab1);
specs.setIndicator("Settings", res.getDrawable(R.drawable.ic_tab_setting));
th.addTab(specs);
specs = th.newTabSpec("tag2");
specs.setContent(R.id.tab2);
specs.setIndicator("Battery Information",res.getDrawable(R.drawable.ic_tab_batteryinfo));
th.addTab(specs);
specs = th.newTabSpec("tag3");
specs.setContent(R.id.tab3);
specs.setIndicator("Help", res.getDrawable(R.drawable.ic_tab_help));
th.addTab(specs);
}
}
</code></pre>
<p>Where am i going to call those three class that i made?</p>
| android | [4] |
1,801,664 | 1,801,665 | How to save AlarmManager events in database? | <p>I am setting some events through AlarmManager. below is the code.</p>
<pre><code> AlarmManager AM =(AlarmManager)getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent();
intent.setAction(Constants.ALARM_ACTION);
intent.putExtra(Constants.EXTRA_DATA1, data[0]);
intent.putExtra(Constants.EXTRA_DATA2, data[1]);
long selectedTime = Long.parseLong(data[2]);
PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, intent,0);
AM.set(AlarmManager.RTC,selectedTime, pi);
</code></pre>
<p>I want to save each event into database. and when user want to see history of events from the app i can show all the events, when if user choose one event i can be able to delete/reset it.</p>
| android | [4] |
663,865 | 663,866 | What does the paragraph of "NOTA BENE" in stl_list.h mean? | <p>I'm a newbie on cplusplus, and thanks for answering my questions.</p>
<p>The paragraph in the stl_list.h is read as follow:</p>
<pre><code>// NOTA BENE
// The stored instance is not actually of "allocator_type"'s
// type. Instead we rebind the type to
// Allocator<List_node<Tp>>, which according to [20.1.5]/4
// should probably be the same. List_node<Tp> is not the same
// size as Tp (it's two pointers larger), and specializations on
// Tp may go unused because List_node<Tp> is being bound
// instead.
//
// We put this to the test in the constructors and in
// get_allocator, where we use conversions between
// allocator_type and _Node_alloc_type. The conversion is
// required by table 32 in [20.1.5].
</code></pre>
<ol>
<li>Where can I find the [20.1.5]/4 and the table 32 stuffs like that??</li>
<li>Why is the specializations on Tp may go unused? What does this actually mean? (If you can provide a piece of simple source code and a simple explanation, I'll really be appreciate it.)</li>
<li>What if people do need the specializations, is there a way to hack it??:)</li>
</ol>
| c++ | [6] |
3,894,062 | 3,894,063 | Using templates of the wizard control | <p>I learnt that Template allows us to customize the look of the control.
I am practicing wizard control and trying to use template to control it's look.
And it has following Templates available for customization:</p>
<ul>
<li>HeaderTemplate</li>
<li>SideBarTemplate</li>
<li>StartNavigationTemplate </li>
<li>StepNavigationTemplate</li>
<li>FinishNavigationTemplate</li>
<li>LayoutTemplate</li>
</ul>
<p>But I don't know how to use it. Can somebody share an example to use it?</p>
| asp.net | [9] |
2,663,408 | 2,663,409 | UIActionSheet not responding to touches | <p>I have a UIActionSheet that I set up like this:</p>
<pre><code>-(void)trash:(id)sender
{
UIActionSheet *sheet = [[[UIActionSheet alloc] initWithTitle:@"Delete" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Remove text" otherButtonTitles:@"Remove tags", nil] autorelease];
[sheet showInView:self.view];
</code></pre>
<p>}</p>
<p>The sheet appears from the bottom of the screen, as intended, and all correct. However none of the buttons are active. The only way out is to touch the Home button.</p>
<p>Is there something I am missing?</p>
<p>The view self.view is the view of the view controller. The only odd thing about it is that it is less than the full screen height because it sits above the keyboard.</p>
<pre><code>// Never called
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;
{
NSLog(@"%d",buttonIndex);
}
// Never called
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonInde
{
}
// Never called
- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex
{
}
// Called if I hit Home button
- (void)actionSheetCancel:(UIActionSheet *)actionSheet
{
}
// Called second
- (void)didPresentActionSheet:(UIActionSheet *)actionSheet
{
}
// Called first
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet
{
}
</code></pre>
| iphone | [8] |
5,086,693 | 5,086,694 | Is the only way to do this an inline if statement? | <pre><code>var filterMinPV = $('.hidePVVol > td input:first').val();
var filterMaxPV = $('.hidePVVol > td input:last').val();
</code></pre>
<p>Currently they are set to an empty string if the input box is empty. I log these values currently with console.log.</p>
<p>Is it possible to give these values the value of "NULL", the only way I can see of doing this is possibly putting the if statement inside of the val(). But is there a better way perhaps some chaining function I am missing?</p>
<p>So if the input box has a value I want it assigned to the var. If it is an empty string I want "NULL" assigned to the var.</p>
<p>Hope I explained that well enough!</p>
| jquery | [5] |
5,145,203 | 5,145,204 | Fast way to convert a two dimensional array to a List ( one dimensional ) | <p>I have two dimensional array - and I need to convert it to one List ( same object ) </p>
<p>I don't want to do it with 'for' or 'foreach' loop that will take each element and add it to the List. </p>
<p>Is there some other way to do it ? </p>
<p>Thanks</p>
| c# | [0] |
219,980 | 219,981 | How to put a value and an image of a card on an array of cards for my java project | <p>For my assignment I have to put make a card memory game that allows you to click on a button to reveal a card, and then click on another button to reveal a card. If the cards match then the you get a score of three points, if they dont they are both turned upside down again and you lose a point.</p>
<p>The main problem that I am having is that I dont know how to assign a value and an image to each card for the score.</p>
<p>Any suggestions? </p>
| java | [1] |
5,436,873 | 5,436,874 | PHP imagecopy(): Setting X coordinate makes black area | <p>I'm making a script that pulls in an image from an external URL. I am then using imagecopy() to merge the images because it is a transparent image. However, when I specify the X coordinate to be anything but 0, it creates a black area to the side of the image. Here is part of my code.</p>
<pre><code>$src = imagecreatefrompng("URL...");
imagecopy($im, $src, 0, 0, 50, 18, 300, 300);
</code></pre>
<p>Is there any way to fix this?</p>
| php | [2] |
363,792 | 363,793 | Javascript code not working | <p>The following code is not working. Want to check white spaces in an input field. If there are not any white spaces want to alert. Any help</p>
<pre><code><script language="javascript">
document.register.eventdtls.value;
function hasWhiteSpace(strg) {
var whiteSpaceExp=/\s+$/;
if (whiteSpaceExp.test(strg))
alert("Please Check Your Fields For Spaces");
return false;
else
return true;
}
</script>
</code></pre>
| javascript | [3] |
3,690,505 | 3,690,506 | I want to enable PHP short tags. How do I do it? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2185320/how-to-enable-the-to-start-a-php-script-from-php-ini">How to enable the <? to start a PHP script from php.ini?</a> </p>
</blockquote>
<p>what can i do to enable short tag in my php 5 ?thanks in advance....</p>
| php | [2] |
1,385,454 | 1,385,455 | Get 2 unique numbers in a row? | <p>I want to make sure 'grid' can't return 2 same values, but I'm not sure how. Here's my code:</p>
<p><code>grid[rnd(2,x-2) * y + rnd(2,y-2)].height = rnd(25,40);</code></p>
<pre><code>int rnd(int min, int max) {
return min + rand() % (max - min + 1);
}
</code></pre>
<p>I also seeded rand() with <code>srand(time(NULL));</code></p>
<p>I wish I could provide more details or what I tried, but I couldn't quite find anything related to this topic.</p>
<p>EDIT: I could of course do re-randoming, but I feel like it's bad practice :/</p>
| c++ | [6] |
1,785,300 | 1,785,301 | date picker with current date in android | <p>I am using date picker but i have some problems with date and time picker. I need date picker dialog should appears with current date value. Similarly Time picker should appears with current time value. How to do this, please any body help.</p>
<p>Thnks. </p>
| android | [4] |
401,990 | 401,991 | Delete local cookies in php | <p>How can I delete the cookies of a specific domain from php (ran on my computer)?</p>
<p>It would be the same as the js function but in php.</p>
| php | [2] |
2,590,863 | 2,590,864 | Can pages loaded into an iframe from another domain be scrolled via JavaScript? | <p>If yes, could you please show me an example of how to do it?</p>
| javascript | [3] |
3,947,683 | 3,947,684 | Change jQuery(document).ready to $.delegate in wordpress | <p>I am trying to change:</p>
<pre><code>add_action('wp_footer','myscript_in_footer');
function myscript_in_footer(){
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("div.domTip_tipBody").mouseover(function(){
jQuery("#yyy a.tippy_link").css("background-color","yellow");});
jQuery("div.domTip_tipBody").mouseout(function(){
jQuery("#yyy a.tippy_link").css("background-color","red");
});
});
</script>
<?php
}
</code></pre>
<p>To</p>
<pre><code>add_action('wp_footer','myscript_in_footer');
function myscript_in_footer(){
?>
<script type="text/javascript">
function(){
$.delegate('p','mouseover', function(e){
jQuery("#yyy a.tippy_link").css("background-color","yellow");});
$.delegate('p','mouseout', function(e){
jQuery("#yyy a.tippy_link").css("background-color","red");
});
});
</script>
<?php
}
</code></pre>
<p>The first one works but the second one dose not.</p>
<p>The reason for the change is that I have elements that are output by a shortcode (e.g "div.domTip_tipBody") that the first function is not reading and it was suggested that the second method might work, but I can not get the second method functioning even with the element 'p'.</p>
<p>Thanks
Tim</p>
| jquery | [5] |
3,154,119 | 3,154,120 | How can I get the Gmail contact of my account in my .NET application? | <p>How can I get the <a href="http://en.wikipedia.org/wiki/Gmail" rel="nofollow">Gmail</a> contact of my account in ASP.NET. Is there some code to import the Gmail contact?</p>
| asp.net | [9] |
1,498,031 | 1,498,032 | how to check whether data is returned or not in android? | <p>I'm making an application in which I have to do XML parsing.</p>
<p>I have to check if the user is able to access new data only then I have to delete the old data in the database.</p>
<p>For the above I am using the following code:</p>
<pre><code>try{
URL url = new URL(address);
/* Get a SAXParser from the SAXPArserFactory. */
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
/* Get the XMLReader of the SAXParser we created. */
XMLReader xr = sp.getXMLReader();
/* Create a new ContentHandler and apply it to the XML-Reader */
xr.setContentHandler(this);
/* Parse the xml-data from our URL. */
InputSource is = new InputSource(url.openStream());
//once data is obtained then delete the table.
hb.executeSql("DELETE FROM Products,Category");
xr.parse(is);
}
catch{
e.printstacktrace();
}
</code></pre>
<p>If there is an error in the input stream then an exception will be thrown which I'm catching and the code for deleting the table will never be executed.</p>
<p>Is the logic correct?</p>
| android | [4] |
2,607,308 | 2,607,309 | Overide a class from the bin folder | <p>Is there any way to provide a replacement class from a dll the the bin folder? I want to replace the codebehind of a page written by a third party with my own implementation and don't have access to the source.</p>
| asp.net | [9] |
1,888,368 | 1,888,369 | Maps - difference between satellite and hybrid modes | <p>I can see the difference on Google Maps, but on an Android MapActivity
I'm struggling to find the difference.</p>
<p>For 'map' I call: mapView.setSatellite(false);</p>
<p>For 'satellite' I call: mapView.setSatellite(true);</p>
<p>But for hybrid view... I tried playing with
mapView.setStreetView(true); but this doesn't seem to affect anything
either way.</p>
<p>Any ideas? </p>
| android | [4] |
5,769,567 | 5,769,568 | Java code compiles but does not execute : "Could not find the main class" | <p>This concerns an attempt to run a network application. The code compiles correctly, however upon trying to run with "java SendMail" java returns :</p>
<pre><code>C:\Butte>java SendMail
Exception in thread "main" java.lang.NoClassDefFoundError: SendMail (wrong name:
je3/net/SendMail)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: SendMail. Program will exit.
</code></pre>
<p>Is this a trivial configuration problem. I have a Java package recent enough to support other networking code. The source code is :</p>
<pre><code>package je3.net;
import java.io.*;
import java.net.*;
/**
* this software sends e-mail via a mailto : url
*/
public class SendMail {
public static void main(String[] args) {
// --- SNIP ----
}
}
</code></pre>
<p>Thank you very much, </p>
<p>Joel</p>
| java | [1] |
4,234,627 | 4,234,628 | Problems accessing a PDF file that is in the internal NETWORK in my android application | <p>can someone help me ?</p>
<p>I have an android application that locates the file on the network and gets its URL.</p>
<p>This URL is passed as a parameter when calling the Adobe Reader, but it does not open the document.</p>
<p>The URL format is returning "http://192.168.1.1..........ex.pdf"</p>
<p>This is a code:</p>
<p>The variable DOC is a URL.</p>
<pre><code> try {
Intent intent = new Intent();
intent.setPackage("com.adobe.reader");
intent.setDataAndType(Uri.parse(doc), "application/pdf");
startActivity(intent);
} catch (ActivityNotFoundException activityNotFoundException) {
activityNotFoundException.printStackTrace();
throw activityNotFoundException;
} catch (Exception otherException) {
otherException.printStackTrace();
throw otherException;
}
}
if(selectedDocumentURL.contains(".pdf"))
{
try {
loadDocInReader(selectedDocumentURL);
} catch (ActivityNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else
{
Intent showPic = IntentFactory.createShowPicture(
WorkOrderDocumentsTable.this, selectedDocumentURL);
startActivity(showPic);
}
} else {
showDialog(getResources().getString(R.string.Atte ntion),
((Exception) msg.obj).getMessage());
}
progress.dismiss();
};
};
</code></pre>
<p>Thanks !</p>
| android | [4] |
4,825,752 | 4,825,753 | Efficient/diffrent way to align data series | <p>What are some ways to align 2 data series (i.e stock data) so that the dates match?</p>
<p>I can think of a few ways.</p>
<ol>
<li>Duplicate older data to fill in </li>
<li>Throw out any missing dates from both sets</li>
</ol>
<p>Not sure how to wrap my head around this to do it efficiently my data is stored in 2 lists.</p>
<p>Thanks for the first reply! Here is what I've tried so far. I don't like these comparer classes, though:</p>
<pre><code> baseBars = baseBars.Intersect(secondaryBars, new BarDateComparer()).ToList();
secondaryBars = secondaryBars.Intersect(baseBars, new BarDateComparer()).ToList();
public class BarDateComparer : IEqualityComparer<Bar>
{
public bool Equals(Bar x, Bar y)
{
return x.Date == y.Date;
}
public int GetHashCode(Bar obj)
{
return obj.Date.GetHashCode();
}
}
</code></pre>
| c# | [0] |
1,670,966 | 1,670,967 | JQuery, adding row but no effect on className | <p>I am trying to add a row to existing table by using clone() method. It is working fine and I also want to change CSS class name for all div elements under each td from the original row. Basically I want to make some td elements as editable. I have tried this by adding "row.find("td div")..." as you see in the code, but this code has no effect at all. Any suggestions?</p>
<pre><code> $("#create_blank_scenario").click(function(){
var row = $('#sortable_offer_table tbody tr:first').clone(true);
row.find("td div").addClass("editable");
row.insertBefore('#sortable_offer_table tbody tr:first');
});
</code></pre>
| jquery | [5] |
1,852,584 | 1,852,585 | Android preference, does it have to be unique? | <p>For my <code>private static final String PREFS_NAME = "mypref";</code> does the PREFS_NAME have to be unique for every application? Or can I use the same one over and over.</p>
| android | [4] |
4,096,612 | 4,096,613 | When working with a form element how would you access what was input into the element to display a message? | <p>I have a form
<code><form>
<input id="input" type="number">
<input type="submit">
</form></code>
I want to be able to input a number into the number and click the submit button and javascript displays a number based on the number submitted. </p>
<p>(My Guess is that this question is very basic but I am pretty knew to javascript.)</p>
| javascript | [3] |
2,472,881 | 2,472,882 | How to increase heap memory in android | <p>I am getting a value from webservice. I am parsing the value and adding it to <code>arraylist</code> while adding array list.</p>
<p>I am getting out of memory error in arraylist. Can anybody tell how to avoid this? </p>
<p>I read that one way to avoid out of memory error using increase heap size, but I don't how to do this - Can anybody tell how to do? Is there anyother way to avoid out of memory error?</p>
| android | [4] |
5,179,377 | 5,179,378 | Make the value of a select box the same as the name of the option without copy paste | <p>my question is how can I replace all the values with the option name without copy paste.
The new list will be happen once, so that it can help me to win hours of copy-paste.</p>
<p>It's been a puzzle to me. Thanks for your solutions and ideas.</p>
<pre><code><option value="61">Talbot</option>
<option value="3830">Tata</option>
<option value="248">Toyota</option>
<option value="63">Trabant</option>
<option value="64">Triumph</option>
<option value="651">Uaz</option>
</code></pre>
<p>This is an example of what I want</p>
<pre><code><option value="Talbot">Talbot</option>
</code></pre>
| php | [2] |
2,333,513 | 2,333,514 | For looping through an array to print one statement java | <p>My piece of code will take a Patient object, and loop through an array which stores patient object and if it matches, it will print out the message on the if statement which is all good. But If the patient is not there, I believe the else segment will print out everytime the patient is not in the waitinglist array. What I'm trying to accomplish is to make the "your patient is not on the waiting list" print once if it's not in the array? Any idea how to do this? I tried to think about a way to do this, but I believe there is a simple solution that my brain cannot just figure out.</p>
<pre><code>public int findWaitingPosition (Patient patient)
{
for (int i=0 ; i <= waitingList.length-1 ; i++)
{
if (waitingList[i].equals(patient))
{
System.out.println ("The patient is on waiting list: " + i+1);
}
else
{
System.out.println ("Your patient is not on the waiting list");
}
}
</code></pre>
| java | [1] |
2,467,921 | 2,467,922 | Wiping data on an actual phone | <p>Ok, usually I use the emulator so I have just to check the "wipe-data" entry and that's it. If I'm using a phone how could I do that? Is there a way to have a "developer profile" on my phone so I don't lose my personal data?</p>
<p>I'm using my personal phone so....</p>
| android | [4] |
5,623,521 | 5,623,522 | Strip unwanted tag in a string (no JQuery) | <p>I have a string that contains the following:</p>
<pre><code><span>A</span>BC<span id="blabla">D</span>EF
</code></pre>
<p>i want to be able to use the JavaScript replace function with regx expression to only remove the spans that do not have an id. So that the result would look like</p>
<pre><code>ABC<span id="blabla">D</span>EF
</code></pre>
<p>I am really not interested in using jQuery. I would rather use pure JavaScript to solve the problem. I have the following but it does not seem to properly work</p>
<pre><code>myText.replace(/(<([^>]+)>)/ig,"");
</code></pre>
<p>Any help would be appreciated! </p>
| javascript | [3] |
2,042,030 | 2,042,031 | What is a good plugin to find out the User Agent in Javascript? | <p>I want to plug so I don't have to handle this every time a new device comes out. Does anyone know a good Github source I can use to check for the user agent? I found so many, but I'm not sure which one would be updated and used more? I just want a selection? I found one but I lost it. </p>
| javascript | [3] |
5,680,740 | 5,680,741 | Why does negation happen last in an assignment expression in PHP? | <p>The negation operator has higher precedence than the assignment operator, why is it lower in an expression?</p>
<p>e.g.</p>
<pre><code>if (!$var = getVar()) {
</code></pre>
<p>In the previous expression the assignment happens first, the negation later. Shouldn't the negation be first, then the assignment?</p>
| php | [2] |
5,007,917 | 5,007,918 | Android AudioTrack() How do you stop a playing stream after it starts | <p>My target API is 2.2
I create audio snippets on the fly so using soundpool or mediaplayer are out of the question.
One item I found that wasnt/isnt well documented is that AudioTrack() will create a set limit of instances. I found it to very between 6 and 12 instances. One thing that was not covered in the docs is that each time initiate a AudioTrack() it creates a new instance. Session ID is not implemented until version 2.3 so GetSessionID() is not available under 2.2. A lot of problems I see with questions about are that each time you do
AudioTrack audioTrack = (new) AudioTrack (the various params here); It starts a new process
so just doing audioTrack.stop(); Does not work if you are trying to stop a previous stream. </p>
<p>SO my problem is I start an audioTrack playing that may be over minute long. This is done in out of stream process (uh separate routine being passed the parameters) the streams play fine. The program is doing some other user directed task and I want to stop the the audiotrack before it completes its' playback buffer. </p>
<p>I need a way of referencing the audio track that is playing and stopping it.
My newbieness and too long a C programmer along with the lack of Java experience is getting in the way. Surely there must be a way to stop audiotrack at any time.
Looking for just a way to reference the audiotrack and stop it.<br>
I thought maybe android.media.audiotrack.stop(); might be close but close dont cut it. Help! I've spent 15 hours looking for an example.
Tnx</p>
| android | [4] |
1,020,389 | 1,020,390 | Checking for null property | <p>I want to check that a property on an array which is itself a child object is not null.</p>
<p>So i have </p>
<pre><code>if (Parent.Child != null && Parent.Child[0] != null && Parent.Child[0].name != null)
var myName = Parent.Child[0].name
</code></pre>
<p>This seems like a very long winded way to get to the child[0].name whilst avoiding null reference exceptions. I am also getting index out of range errors. Is there a better way?</p>
| c# | [0] |
5,949,843 | 5,949,844 | How do I run an animation for a short period of time? | <p>I have a looping animation I want to present for an image button before a static image is used; on each button press. Is there a way to run this animation for around 2000 milliseconds then switch over to the image. What I have tried just results in a pause then the static image.</p>
<pre><code> button.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
animationrun();
long time = System.currentTimeMillis();
time += 2000;
while(time > System.currentTimeMillis())
{}
select();
}
});
public void animationrun()
{
button.setBackgroundResource(R.drawable.ball_anim);
animation = (AnimationDrawable)button.getBackground();
animation.start();
}
public void select()
{
button.setBackgroundResource(R.solidImage);
}
</code></pre>
<p>SOLUTION: <a href="http://www.facebook.com/topic.php?uid=128857303793437&topic=74" rel="nofollow">http://www.facebook.com/topic.php?uid=128857303793437&topic=74</a></p>
| android | [4] |
3,351,742 | 3,351,743 | PHP coding conventions? | <p>Where can I find PHP coding convention references for PHP coding standards?</p>
| php | [2] |
4,856,345 | 4,856,346 | Is there away to change the height of map view programmatically? | <p>I'm having problem in getting the final layout look that I need for my app. </p>
<p>However, i'm thinking if I could change the the width of map programmatically it will solve the problem?</p>
<p>So i wonder if altering the height of map view programmatically is possible?</p>
| android | [4] |
4,220,719 | 4,220,720 | The timestamp to dates problem for PHP >= 5.1 | <p>I may say I'm not a PHP programmer. I've been reading at <a href="http://php.net/manual/en/function.date.php" rel="nofollow">http://php.net/manual/en/function.date.php</a> that:</p>
<blockquote>
<p>The valid range of a timestamp is
typically from Fri, 13 Dec 1901
20:45:54 GMT to Tue, 19 Jan 2038
03:14:07 GMT. (These are the dates
that correspond to the minimum and
maximum values for a 32-bit signed
integer). However, before PHP 5.1.0
this range was limited from 01-01-1970
to 19-01-2038 on some systems (e.g.
Windows).</p>
</blockquote>
<p>I've database full of 1070-based-timestamps. How can I recover them with PHP >= 5.1?</p>
| php | [2] |
2,328,735 | 2,328,736 | Sound Pool - Not Loading File | <p>I'm trying to add a sound to my sound pool</p>
<p>I've been stuck on this for over a week now, tried various methods of loading in via url etc, but nothing works. Any help would greatly be appreciated.</p>
<p>I get the error: android.content.res.Resources$NotFoundException: File res/raw/claps.wav from drawable resource ID.</p>
<p>I know the file is in the apk becuase I unziped the apk to find it under /res/raw/claps.wav.</p>
<pre><code>SoundPool mySoundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);
int myAudioFile = context.getResourceId("raw.claps");
try{
mySoundPool.load(context.getActivity(),myAudioFile,1);
} catch (Exception e){
message = String.valueOf(e);
}
</code></pre>
<p>Thanks!</p>
| android | [4] |
437,735 | 437,736 | What is the point of the string.Empty property | <p>Why was the property <code>string foo = string.Empty</code> included in the BCL? It seems more verbose and no clearer than just using an empty string (<code>string foo = ""</code>)</p>
| c# | [0] |
5,036,268 | 5,036,269 | How to move image on touch,Android | <p>i created a iphone app in which, i hv few images.
If i tap on an image for example a boy standing, than it moves from point a to point b.
I used imageview with array of images, and having 6-8 images in different positions, so when user taps, it looks like boy is moving.</p>
<p>The same thing i wanted to implement in ANDROID.</p>
<p>kindly guide me, how can i, move one image from 1 point to another, on touch event.</p>
<p>Suggestions are always appreciated.</p>
| android | [4] |
5,374,777 | 5,374,778 | validate youtube URL and it should be exists | <p>I am new to php.</p>
<p>I want to check the valid youtube URL and if video is exists or not.</p>
<p>Any suggestion would be appreciated. </p>
| php | [2] |
2,386,326 | 2,386,327 | Not responding to web application | <p>Iam trying to run my webapplication using twitter. It is redirecting to my application but not responding. Showing server error'/' application - runtime error. Please help me out from this.
Thanks in advance.</p>
| asp.net | [9] |
4,356,458 | 4,356,459 | editText in android | <p>I am making an application and I have added an EditText in my layout.</p>
<p>What I'm trying to achieve is that when EditText is selected should open a dialog box, with some general text and an <code>OK</code> button. Which method can I use to accomplish this?</p>
| android | [4] |
67,911 | 67,912 | Write text to picture does not work | <p>I've made a php script, that has the job to print text on a Jpg Image, that will be used as Buttons for my website.
However, it doesn't show any picture with a text on it.
So, i tested the code on a PHP Code checker, and there was nothing wrong with it.
Source file for the JPG Button is on the same directory as the script.</p>
<p><img src="http://i.stack.imgur.com/YmFdd.png" alt="Directory"></p>
<p>PHP Code</p>
<pre><code><?php
$Text = $_GET['value'];
$Image = ImageCreateFromJPEG("Button.jpg");
$Cord = imagecolorallocate($rImg, 0, 0, 0);
imagestring($Image,3,3,3,urldecode("$Text"),$Cord);
header('Content-type: image/jpeg');
imagejpeg($Image,NULL,100);
?>
</code></pre>
<p>The Size of the Picture that it should write text to is "100 x 30"
So, this could be a simple problem, but I am not sure what cause this.</p>
| php | [2] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.