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,275,809 | 2,275,810 | Manipulated Underlying Apps or Android OS | <p>My initial question dealt with building a translucent view that allowed manipulation of a view below it. Bluefalcon did an excellent job answering this and helped me understand view mechanics a little better: </p>
<p><a href="http://stackoverflow.com/questions/11635934/touch-through-translucent-app">touch through translucent app</a></p>
<p>I'm still unsure of how to manipulate an underlying view that is not part of my app. The effect I'm trying to achieve is like the Screen Filter App: </p>
<p><a href="https://play.google.com/store/apps/details?id=com.haxor&hl=en" rel="nofollow">https://play.google.com/store/apps/details?id=com.haxor&hl=en</a></p>
<p>In this app, once started, it seems a "filter" view is placed on top of everything but you can still interact with whatever is running under it. The app store, email, home screen etc. </p>
<p>I currently have getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE); in my app's onCreate method. This seems to get close. If I swipe on my app nothing updates, but when i back out of the app the home screen updates as if i swiped.</p>
<p>Any help will be greatly appreciated! </p>
| android | [4] |
941,220 | 941,221 | How can i import contacts from yahoo,gmail and hotmail into my application using java | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/397933/taking-contact-list-from-hotmail-gmail-yahoo-in-java">Taking contact list from hotmail gmail yahoo in java ?</a> </p>
</blockquote>
<p>How can i import contacts from yahoo,gmail and hotmail into my application, can anyone give a step-by-step description about this from the beginning ? As am new in this world of programming? </p>
| java | [1] |
3,517,103 | 3,517,104 | How to store the selected checkbox values in arraylist in android? | <p>I am working on <strong>quiz application</strong>. For each question there are <strong>multiple answers</strong> and so for that I have used <strong>checkboxes</strong>. In each page <strong>I am displaying single question with options</strong> and when next button is clicked next question will be displayed. <strong>So when multiple answers are selected by the user I need to store them in an arraylist and need to compare the selected answers with that in database.</strong> In my code I am storing the selected value id's one by one but at a time it is storing only one value. How to store all the selected checkbox id's in my arraylist? </p>
<p>My Code:</p>
<pre><code>ArrayList<String> selchkboxlist;
CheckBox[] cbs;
cbs = new CheckBox[20];
for(k=0; k<List3.size(); k++)
{
arr = List3.get(k);
cbs[k] = new CheckBox(getContext());
Rl.addView(cbs[k]);
cbs[k].setText((CharSequence) arr.get(2));
cbs[k].setTextColor(Color.parseColor("#000000"));
cbs[k].setId(k);
cbs[k].setOnClickListener( new View.OnClickListener()
{
public void onClick(View v)
{
CheckBox cb = (CheckBox) v ;
if (((CheckBox) v).isChecked()) {
chk = Integer.toString(v.getId());
selchkboxlist = new ArrayList<String>();
selchkboxlist.add(chk);
Toast.makeText(Select1.this, "Selected CheckBox ID" + v.getId(), Toast.LENGTH_SHORT).show();
} else {
selchkboxlist.remove(chk);
Toast.makeText(Select1.this, "Not selected", Toast.LENGTH_SHORT).show();
}
}
});
}
</code></pre>
<p>Please help me regarding this....Thanks in Advance</p>
| android | [4] |
6,009,185 | 6,009,186 | Prevent Android from closing my service/thread | <p>I have an app that uses a service in the background to do some upload/download operations.
These operations can take some time, depending on the user selection (amount and size of files). </p>
<p>While with my device (nexus s) and in the testing emulator, all works as planned, I am getting reports from users that the operation gets stuck sometimes when choosing to upload/download big data.</p>
<p>The operation is done using a thread that runs in a background service. My guess is that the OS sometimes kills the thread and/or service on devices with low memory.</p>
<p>In the service onStartCommand() function I am raising the thread that will do the operation (the data to handle comes within the intent), then I am returning START_NOT_STICKY.
At the activity I am using startService(i), no binding is done.</p>
<p>How can prevent this? How can I ensure the system will not kill either my service or thread?</p>
| android | [4] |
2,584,597 | 2,584,598 | Fatal error: Cannot redeclare class ProjectConfiguration | <p>I am trying to clear the cache using command 'php symfony cc' but getting " Fatal error: Cannot redeclare class ProjectConfiguration in /home/dev/project/devz/config/ProjectConfiguration.class.php on line 46 ". Please help me on this. Thanks in advance</p>
| php | [2] |
4,786,690 | 4,786,691 | How clear error gridview | <p>I have designing in my web page.</p>
<p>I have used the gridview, I have used the gridview <code>delete</code> option. Get the following error,</p>
<blockquote>
<p>Multiple controls with the same ID
'Ddl' were found. FindControl requires
that controls have unique IDs.</p>
</blockquote>
<p>My code is as follows,</p>
<pre><code>protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
Label Amount = (Label)(DisplayGrid.Rows[e.RowIndex].FindControl("lblAmount"));
Label Account = (Label)(DisplayGrid.Rows[e.RowIndex].FindControl("ddlAccount"));
DataTable dt = new DataTable();
dt = CreateDataTable();
dt = (DataTable)Session["myDatatable"];
dt.DefaultView.AllowDelete = true;
dt.DefaultView.Delete(e.RowIndex);
dt.AcceptChanges();
Session["myDatatable"] = dt;
BindGrid();
}
</code></pre>
| asp.net | [9] |
5,263,825 | 5,263,826 | iPhone:How to implement Push Notification in iPhone like facebook? | <p>I want to implement push notification functionality in my apps like Facebook provide us so please tell me any link or any idea to develop this functionality.</p>
| iphone | [8] |
4,291,870 | 4,291,871 | mouse-enter event function not working in Firefox | <p>I have this image:</p>
<pre><code><img src="..." class="scroller_poster" alt="Some information about movie">
</code></pre>
<p>... and I'm trying to display the value in ALT in a DIV elsewhere on my page:</p>
<pre><code><div class="scroller_movie_data"></div>
</code></pre>
<p>... using this function (contained in $(document).ready):</p>
<pre><code>$('.scroller_poster').mouseenter(function() {
var movie_data = $(this).attr('alt');
if (movie_data) {
$('.scroller_movie_data').html(movie_data);
$(this).mouseleave(function() {
$('.scroller_movie_data').html('');
});
}
});
</code></pre>
<p>This works in all browsers except Firefox and I cannot figure out why. Can somebody shed some light on this please?</p>
<p><strong>NOTE:</strong></p>
<p>The image that gets hovered sits inside a jQuery plugin (<a href="http://www.smoothdivscroll.com" rel="nofollow">SmoothDivScroll</a>), which I believe is causing the problem.</p>
<p>Below is a screenshot on what I am working on, it might help understand what I'm doing. Where it says "Madagascar 3: Europe's Most Wanted (2012)" is where I'm trying to get each hovered ALT value to show.</p>
<p><img src="http://i.stack.imgur.com/mZq0V.png" alt="enter image description here"></p>
| jquery | [5] |
4,431,558 | 4,431,559 | Why blank(empty file) java do not not show any error? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2467723/what-happens-if-you-compile-an-empty-java-file">What happens if you compile an empty java file?</a> </p>
</blockquote>
<p>I tried to compile a blank file(.java file)hoping it will show an error.But Java compiler did not shown any error why so?</p>
| java | [1] |
4,710,456 | 4,710,457 | How do I open a socket below 1024 | <p>I'm trying to create a ServerSocket on a port below 1024.</p>
<p>Obviously, this is restricted to root access only. </p>
<p>But I'm struggling on getting the right permissions for my app.</p>
<p>I'm using this code, for example, to test if I have root access (or trigger the dialog)</p>
<p>But it still doesn't let me ServerSocket work.</p>
<p>AFAIK, the process that is created with the SU command has the root access, not my app. How do I get root access into my own process?</p>
<pre><code>public stat
ic boolean getRoot() {
try {
Process p = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(p.getOutputStream());
os.writeBytes("echo \"Do I have root?\" >/system/sd/temporary.txt\n");
os.writeBytes("exit\n");
os.flush();
try {
p.waitFor();
if (p.exitValue() != 255) {
return true;
} else {
return false;
}
} catch (InterruptedException e) {
e.printStackTrace();
return false;
}
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
</code></pre>
| android | [4] |
3,017,132 | 3,017,133 | Insufficient permission when running 'adb shell' | <p>I am on Ubuntu 12.04. And I need to use 'adb shell' to connect to my device on linux:</p>
<p>I get Insufficient permission when running 'adb shell'as myself.
But when I run it as 'root', it works.</p>
<p>How can I fix 'adb shell' so that I don' need to run it as root everytime?</p>
| android | [4] |
2,403,933 | 2,403,934 | Dynamically add properties to a existing object | <p>I create the person object like this.</p>
<p>Person person=new Person("Sam","Lewis")
It has properties like this.
person.Dob
person.Address</p>
<p>But now I want to add properties like this and set the values at the run time after creating the object.
person.Age
person.Sex</p>
<p>How can I add those extra properties after creating the object. Those property name can be changed time to time. Therefor can't hardcode the "Age" and "Sex".</p>
| c# | [0] |
5,657,193 | 5,657,194 | String Operation to get particular value inside the string using java | <p>I have a string as below.</p>
<pre><code><employees>
<emp>
<name>yaakobu</name>
<sal>$20000</sal>
<designation>Manager</designation>
</emp>
<emp>
<name>daaniyelu</name>
<sal>$2000</sal>
<designation>Operator</designation>
</emp>
<emp>
<name>paadam</name>
<sal>$7000</sal>
<designation>Engineer</designation>
</emp>
</employees>
</code></pre>
<p>The above xml i am getting as a string.i was asked not to use parsing due to performance issue.I need to get the second employee 's salary($2000) using java's string operation.Please provide me some pointers.</p>
<p>Your help appreciated.</p>
| java | [1] |
300,086 | 300,087 | passing a method to Thread which have multiple arguments in C# | <p>I would like to execute a method in a thread. The method has multiple arguments and expects return value. Can anyone help?</p>
| c# | [0] |
1,389,262 | 1,389,263 | Removing specific QueryStrings | <p>Let's assume an aspx page gets multiple querystrings, for example <code>books.aspx?author=Arthor&level=4&year=2004</code>.</p>
<p>I'd like to create a button that clears specific querystring.</p>
<p>For example when <code>clearAuthorBtn</code> is clicked, user should be redirected to <code>books.aspx?level=4&year=2004</code></p>
<p>How can I make it?
Thank you very much.</p>
| c# | [0] |
2,317,656 | 2,317,657 | Validating email address - stopping double dots | <p>I am currently <a href="http://swiftmailer.org/" rel="nofollow">SwiftMailer</a> to send out emails. I have a seperate email validation script that checks emails to ensure they are valid before using SwiftMailer to send. It works pretty well.</p>
<p>However, my validator doesn't pick up accidental double dots (..) in email addresses like:</p>
<p>ben..sinclair@email.com
OR
ben.sinclair@email..com</p>
<p>Here's my code... what would I need to add in to give an error if they put double dots anywhere in the email address?</p>
<pre><code>function valid_email($email) {
if (preg_match("/[_a-z0-9-]+(\.[_a-z0-9-]+)*@([_0-9a-z][_0-9a-z-]*[_0-9a-z]\.)+[0-9a-z][a-z]+/", $email, $matches))
return true;
return false;
}
</code></pre>
| php | [2] |
1,103,170 | 1,103,171 | Getting x and y Position? | <p>How to Get the X and Y axis of UIImage, I have one images which are randomly changes
it's position so how to get the image current x and y position so i can match with
another image x and y position.I have to get the position of Image without any touch
on screen. please suggest some solution.</p>
<p>Thank You.</p>
| iphone | [8] |
3,464,027 | 3,464,028 | java create and write to windows custom view | <p>I'm using this code in order to write to my windows event viewer:</p>
<pre><code>import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.nt.NTEventLogAppender;
public class EventLogExample {
public static void main(String[] args)
{
Logger logger = Logger.getLogger(EventLogExample.class);
NTEventLogAppender ntAppender = new NTEventLogAppender("EventLogExample message");
logger.setLevel(Level.INFO);
logger.addAppender(ntAppender);
logger.info("Test message 1: info message text");
}
}
</code></pre>
<p>when I'm using this the log message is being written into EventViewer->WindowsLogs->Application.</p>
<p>I want to create a new view so that when i write the logs they will be written to the new view and not to the application view.</p>
<p>Is this possible? how can i create in java a new view and then write to it? I couldn't find any java example for this.</p>
<p>Thank's In Advance. </p>
| java | [1] |
1,343,116 | 1,343,117 | String to Date Conversion Issue | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1576753/parse-datetime-string-in-javascript">Parse DateTime string in JavaScript</a> </p>
</blockquote>
<p>How do I convert this string "09-20-2011::20:00:00" to the seconds from 1st jan, 1970. aka Unix epoch time in javascript.</p>
| javascript | [3] |
618,952 | 618,953 | go from activty A to B and come back to A android | <p>I have read a lot but still havn't got my full answer.
When starting app A,within onCreate method I get data from Api and set on ListView.
Here also I have button and when I click to it I am going to Activity B and send some data.
Within my B activity I send data to my api and if response status is ok I want to go back to activity A and reload data:call oncreate method in wich located my call function to api.
In my manifest I have set<br>
<code><activity android:name=".A"
android:launchMode="singleInstance" ></activity></code></p>
<p>but when I call startActivity: </p>
<pre><code>Intent i = new Intent(B.this,A.class);
Bundle b = new Bundle();
String from = "upload";
b.putString("action", from);
startActivity(i);
</code></pre>
<p>I dont start activty A from point onCreate.
I have already tried call finish() function after going to activity B but this doesn't get my any result.
I want to append that in A activity I get file from gallery and pass uri to activity B. </p>
<p>Thanks.</p>
| android | [4] |
2,669,203 | 2,669,204 | translating C++ snippet | <p>I am working on porting a framework from C++ to Java, and it is turning out to be harder than I expected, as I don't know a whole lot about C++. I came across this one snippet that I don't really understand. If someone could tell me what the lines marked do that would be awesome.</p>
<pre><code> /** Heap data, stored as a vector */
std::vector< std::pair< _Tp, _Val > > data;
/** Maps objects to their positions in the data vector */
std::map< _Tp, int> mapping;
//I understand that this method takes a pair of type <_Tp, _Val>
template <class _Tp, class _Val>
void Heap<_Tp,_Val>::push(std::pair< _Tp, _Val > x)
{
int index=data.size();
//Here is where I run into trouble
//I can't seem to figure out what this line is doing
//I know it is inserting a Key-Value pair into the map
//but why is .second being called? and what exactly is this if statement
//checking?
if (mapping.insert(std::make_pair(x.first,index)).second)
{
data.push_back(x);
percolate_up(index);
}
}
</code></pre>
| c++ | [6] |
3,083,302 | 3,083,303 | Android Hello World | <p>I am using android.com tutorial to learn android using eclipse. I have just started 1st program. It says <code>Open the Android folder, select Android Project and click Next. But there is no new</code>Android Project` option in android folder, rather it has three options for a new project.
1) android application project
2) android sample project<br>
3) android test project</p>
<p>which is one I should choose for creating an Android project for that tutorial.</p>
| android | [4] |
4,889,304 | 4,889,305 | What actually happens internally | <p>I have these three linse in code </p>
<pre><code>int i = 5;
object a = i;
i += 1;
</code></pre>
<p>I was thinking value of a will also be 6, but it is 5.</p>
<p>What happens actually please clear it</p>
| c# | [0] |
1,973,117 | 1,973,118 | jQuery in Wordpress - Why is it not working? | <p>I am using this as my starter template: <a href="http://html5reset.org/" rel="nofollow">www.html5reset.org/</a></p>
<p>It's pretty nice, but I believe something is wrong with jQuery in there.</p>
<p>In the <code>functions.php</code> it says:</p>
<pre><code>// Load jQuery
if ( !function_exists(core_mods) ) {
function core_mods() {
if ( !is_admin() ) {
wp_deregister_script('jquery');
wp_register_script('jquery', ("//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"), false);
wp_enqueue_script('jquery');
}
}
core_mods();
}
</code></pre>
<p>This seems fine to me - is it alright?</p>
<p>There also is a premade JS file. In this file it says:</p>
<pre><code>// remap jQuery to $
(function($){})(window.jQuery);
</code></pre>
<p>I don't know really what this does, but it seems also ok.</p>
<p>To test if jQuery works, I tried the following - none of it is woking, jQuery is not defined.</p>
<pre><code>$(document).ready(function() {
alert("This is a test.");
});
jQuery(document).ready(function() {
alert("This is a test.");
});
$(document).ready(function($) {
alert("This is a test.");
});
</code></pre>
<p>So, can you tell ma what could be wrong with this? Thank you!</p>
| jquery | [5] |
2,558,789 | 2,558,790 | How create a class that is abstract, but not internally | <p>Is this possible in c# somehow? This is the exact case I need it for:
He (the user) must not be able to create instances of this class. However, I want to be able to create instances of this class inside my project. (hence: internally)
Other classes should be able to inherit from it.
I want to force the user to only use the bigger Sound class.
The big "BUT": The user must be able to use instances of this class if I give it to him, that's why I can't just make it internal and be done with it. Neither can I make it abstract, because I want to make copies myself. I thought about giving the user only interfaces like IChannel back, but that doesn't solve my problem that he shouldn't be able to make an instance of Channel. He will still be able to see the class if he looks for it, and if he is adventureous enough even try to create an instance.
But as I mentioned before: I can't make it abstract because I need to make copies internally.</p>
<p>Appreciate your help!</p>
| c# | [0] |
5,539,369 | 5,539,370 | Use Of Service In Android | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4353570/android-service">Android Service</a> </p>
</blockquote>
<p>I Am New In Android And I Am Not Familiar About Services. So Please Give Me A Small Application So That I Understand Services. </p>
| android | [4] |
5,044,434 | 5,044,435 | User Error Messages | HTML data vs JavaScript | <p>I have this object below:</p>
<p>I thought about putting the messages in html like this</p>
<pre><code><div id = "text_identifier">text_here</div> // div is hidden.
</code></pre>
<p>and then using getElementById to pull the message into JavaScript and finally display to the user in the correct element ( the parameter element in <code>Message</code> )</p>
<p>Two related questions?</p>
<p>Is it bad practice to have content in JavaScript like this?</p>
<p>If I do move the messages into the HTML, is the method I described above best practice?</p>
<pre><code>/**
*Message
*/
var Message = function( element )
{
var messages =
{
name: 'Please enter a valid name',
email: 'Please enter a valid email',
pass: 'Please enter passoword, 6-40 characters',
url: 'Please enter a valid url',
title: 'Please enter a valid title',
tweet: 'Please enter a valid tweet',
empty: 'Please complete all fields',
email_s: 'Please enter a valid email.',
same: 'Please make emails equal',
taken: 'Sorry, that email is taken',
validate: 'Please contact <a class="d" href="mailto:guy@host.com">support</a> to reset your password',
}
this.display = function( type )
{
element.innerHTML = messages[ type ];
new Effects().fade( element, 'down', 4000 );
}
};
</code></pre>
| javascript | [3] |
2,661,485 | 2,661,486 | Knowing the number of searches in playstore | <p>How can I know if how many have search my application in google playstore and fetch it by using codes? Especially if they use keyword search. Thank you!</p>
| android | [4] |
5,361,684 | 5,361,685 | How to get the current Y offset of a ScrollView | <p>ScrollView has a method for setting the x and y scroll offset, but no method for getting the current offset (all I'm really interested is the y offset, since ScrollView only supports vertical scrolling). I don't see any method that would work in the superclasses, and tried getTop() for the content view, which is always zero. Am I missing something?</p>
| android | [4] |
2,482,026 | 2,482,027 | how to show a disclosure indicator button in table view editing mode | <p>How to show a disclosure indicator button in table view editing mode .</p>
<p>Thanks </p>
| iphone | [8] |
2,266,063 | 2,266,064 | How to display skip button for facebook Single Sign on? | <p>I am using this method to allow the user to sign on to facebook at the beginning of the application, If they want.</p>
<pre><code>package com.greatap;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import com.facebook.android.*;
import com.facebook.android.Facebook.*;
public class MyGreatActivity extends Activity {
Facebook facebook = new Facebook("YOUR_APP_ID");
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
facebook.authorize(this, new DialogListener() {
@Override
public void onComplete(Bundle values) {}
@Override
public void onFacebookError(FacebookError error) {}
@Override
public void onError(DialogError e) {}
@Override
public void onCancel() {}
});
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
facebook.authorizeCallback(requestCode, resultCode, data);
}
</code></pre>
<p>}</p>
<p>If they dont want to then the can just press skip to continue using the app without signing in. Ive seen this in many applications. I dont see any instructions on the developer's page for facebook to implement this.
Some help would be greatly appreciated!</p>
| android | [4] |
5,081,509 | 5,081,510 | Android where to store credential info like url, username, passcodes? | <p>I have an app which will connect to server and provide some basic connection credential information like server url, userer, application id etc What is the best option for storing this information within the android app? Should it be a preference? not sure where to store these items. I should clarify this question a bit. There are different levels of security requirements, so I am interested in hearing about how to encrypt the password etc, but there are also items which are generally not encrypted like connection urls etc, so I am also interested in how to store such information as well. I am basically looking for a better solution</p>
| android | [4] |
5,445,075 | 5,445,076 | How to print control characters in Console Window | <p>I have tab characters assigned in ASCII (09) or Unicode</p>
<pre><code>char ch = '\x09';
(or)
char ch = '\u0009';
</code></pre>
<p>How do I print <code>'\t'</code> in console window ?</p>
<p>None of the below works.(maybe it prints a tab, but not as a canonical representation of '\t')</p>
<pre><code>Console.Write(ch);
Console.Write(ch.ToString())
</code></pre>
<p>Guess,<code>Console.Write()</code> is not the right way to do it</p>
| c# | [0] |
4,438,127 | 4,438,128 | Android Graphical Layout | <p>I am experimenting with Graphical Layout, the imageView under Image and Media why is its frame always snapping to left? Can I move it to the center? I can't seem to do that.</p>
<p>Likewise with the Frames of Layout, they are always snapping to the left.</p>
| android | [4] |
2,809,048 | 2,809,049 | C# string parsing problem | <p>I have a file thats exported with a ton of lines. I want to be able to parse the file into a neat order that I can easily use.</p>
<p>I have a sample string here:</p>
<pre><code><a href="http://www.foxnews.com/us/2010/07/28/cemetery-allows-father-war-veteran-fly-flag-grave/?test=latestnews">deal reached on cemetery flags</a>
| <a href="#" onclick="foxgrabplayer('4295654','','grave insult to grieving family');return false;"><img src="/i/redes/icon-video.gif"></a><br>
- <a href="http://www.foxnews.com/politics/2010/07/27/obama-missing-historic-boy-scout-jamboree-fundraisers-view-taping/">obama skips out on scouts for 'the view'</a><br>
- <strong class="em">you decide: </strong><a href="http://www.foxnews.com/opinion/2010/07/27/decide-right-obama-miss-boy-scout-jamboree/">right call?</a></li>"
</code></pre>
<p>All of that is 1 line. I'd want it to output like the following:</p>
<pre><code>http://www.foxnews.com/us/2010/07/28/cemetery-allows-father-war-veteran-fly-flag-grave|Deal reached on cemetery flags
http://www.foxnews.com/politics/2010/07/27/obama-missing-historic-boy-scout-jamboree-fundraisers-view-taping|obama skips out on scouts for 'the view
</code></pre>
<p>sort of www|description for every href in the line. Hope this makes sense!</p>
| c# | [0] |
1,163,568 | 1,163,569 | jQuery add a class only if it does not have another class | <p>I have a navigation animation that is being applied to elements with the "js" class - via a css background. I don't want this animation to occur on the link for the current page (a class "current" is being echo'd out by PHP to the current page). </p>
<p>So basically the page your on (current page) link in the main nav will have a class of current, the others a class of js - and get the animation. How do apply that logic in a funciton? I can do it via css background but want to do it in js.
Here is working js used in combination with css for desired look:</p>
<pre><code> $(function() {
$("ul#mainNav li a").addClass("js");
$("ul#mainNav li a").hover(
function () {
$(this).stop(true,true).animate({backgroundPosition:"(0 0)"}, 200);
$(this).animate({backgroundPosition:"(0 -5px)"}, 150);
},
function () {
$(this).animate({backgroundPosition:"(0 -130px)"}, 200);
}
);
});
</code></pre>
<p>What I'm trying to no avail:</p>
<pre><code>$(function() {
if($("ul#mainNav li a").hasClass("current")) {
//do nothing
} else {
$(this).addClass("js")
}
//rest of animation function
</code></pre>
<p>});</p>
<pre><code>});
</code></pre>
| jquery | [5] |
5,067,597 | 5,067,598 | What are the advantages of SoundPool's load method that takes offset and length parameters? | <p>I am intrigued by the <code>SoundPool.load(FileDescriptor fd, long offset, long length, int priority)</code> method in the Android API. Does it exist just as a convenience for people that were already storing audio this way? Does it do anything for performance?</p>
| android | [4] |
629,580 | 629,581 | saving images from webcam stream directly to web server with java | <p>Is it possible to save images directly from the webcam of my system to a web server in Java? Maybe it can directly passed to an URL address and can be <code>GET</code> at the server or anything else.</p>
| java | [1] |
1,167,584 | 1,167,585 | location.hash disappears immediately | <p>I'm building a live search + filter method, and I've noticed when I use that method (it's an example) that hash after it shows in the URL - it is immediately being removed. If I move that hash set to e.g. button's click method it works fine. Why ?</p>
<pre><code>$('.menu-link').click(function () {
window.location.hash = 'search-container';
});
</code></pre>
| jquery | [5] |
4,311,454 | 4,311,455 | point of having an instance variable as final? | <p>what is the point of having an instance variable as final?</p>
<p>isn´t it better to have that variable set as a static final variable then?</p>
<p>cause if it can't be changed by any of the objects, then it's the same as a class (static) variable, right?</p>
| java | [1] |
1,343,702 | 1,343,703 | run javascript via url | <p>My Problem is:</p>
<p>I have an eibport:
www.bab-tec.de/</p>
<p>You can See a live demo in the live section.</p>
<p>Now the problem.</p>
<p>I would like to start or run a javascript on this page with entering the url like:
<code> http:// IP-EIBPORT /#javascript:click(Button)</code></p>
<p>or in another way.</p>
<p>Can someone helps me?</p>
| javascript | [3] |
1,356,664 | 1,356,665 | "Fatal Python error: deallocating None" and urlgrabber | <p>I'm trying to fetch 1m+ pages over HTTP from single site. urlgrabber seemed like fast solution using "keep alive" connections. However, after a while my script fails without any stack trace with: "Fatal Python error: deallocating None"</p>
<p>Here is isolated python code that fails (for simplification, file:// URL is used, gives same results):</p>
<pre><code>import urlgrabber
url = "file:///some/existing/file.html"
for i in range(0, 15000):
print i
handle = urlgrabber.urlopen(url, timeout = 1)
# do something useful
handle.close()
</code></pre>
<p>It fails after ~3231 cycles.</p>
<p>What I am doing wrong?</p>
| python | [7] |
5,649,449 | 5,649,450 | Can we display a image in asp which is stored in hard disk | <p>I have many images stored in my hard disk in C: drive.</p>
<p>Now i made a application which is working fine but it is unable todisplay tha image.</p>
<p>but im my aspx it does not show image.</p>
<p>by the above application i extracted the path which is stored in my database,but not the image at that path.</p>
<p>Any suggestions?</p>
| asp.net | [9] |
5,139,097 | 5,139,098 | Jquery val() won't work? | <pre><code>$("input[type=radio]").change(function(){
alert(this.val());
});
</code></pre>
<p>Why this won't work?
What I want is that every time a radio button is selected, the page alerts its value.</p>
| jquery | [5] |
1,292,255 | 1,292,256 | Android: Behaviour of launchMode="singleTask" not as described? | <p>I've been learning Android and have come across an issue with launchMode="singleTask". The documentation states that when this attribute is used, the Activity is always launched into a new task as the root Activity. Secondly, the documentation states that if an Intent is targeted at such an Activity when there are Activities sitting above it in its task stack, such Intents are discarded (although the task is still brought to the foreground).</p>
<p>I've been playing around with this, and the behaviour I observe is completely different. In particular:
- Activities with launchMode="singleTask" are not always the root Activity in a task stack. They are just plonked ontop of the existing stack with the same affinity.
- When an Intent is targeted at such an Activity and there are other Activities above it in the stack, the Intent is not discarded. Instead the Activities above it in the stack are discarded. The Intent is then delivered via onNewIntent to the Activity as normal.</p>
<p>Can someone confirm that this is the actual behaviour? If so, why are the documents incorrect? If not what have I done wrong. . .</p>
<p>EDIT:</p>
<p>An example demonstrating this behaviour can be found here:
<a href="http://groups.google.co.uk/group/android-developers/browse_thread/thread/fd8f249803b4688a#">http://groups.google.co.uk/group/android-developers/browse_thread/thread/fd8f249803b4688a#</a>
Sorry for the cross-post, however I was unable to get the example in a decent format to post here...</p>
| android | [4] |
5,887,504 | 5,887,505 | What is the different between {$hello}, ${hello} & $hello when use double quotes? | <p>I'm a bit confuse with </p>
<pre><code>$hello = "hello";
echo "Say $hello";
echo "Say {$hello}";
echo "Say ${hello}";
</code></pre>
<p>and the output is same <code>Say hello</code>. When should I use <code>{$hello}</code> and <code>${hello}</code>? and why it cannot be used in single quote?</p>
| php | [2] |
4,416,658 | 4,416,659 | Want to print data in TreeView in C# | <p>i have developed a Project and i wanna to print the data in the Treeview (Medical Test Notes ...) when the User Click on the Print Button (Print Requested Tests )
any one have any idea how i can do it ?
<img src="http://i.stack.imgur.com/TFCPW.png" alt="enter image description here"></p>
| c# | [0] |
4,941,180 | 4,941,181 | Is it possible in C++ to declare an attibute in the body? | <p>Is it possible in C++ to declare an attibute in the body, that is, the .cpp file ?</p>
| c++ | [6] |
2,539,623 | 2,539,624 | When to update bin folder | <p>I have an ASP.NET application (web application as opposed to website), and several class libraries.</p>
<p>Just to make sure, every time a change is made to the class library, do I need to recompile and refresh/update the dll from thbe bin folder of my web app?</p>
<p>Thanks</p>
| asp.net | [9] |
2,250,589 | 2,250,590 | Put a image in Android | <p>i need to show a image, when i press a button on my application.</p>
<p>I'm trying with: </p>
<p><strong>ImageView imageView = (ImageView) findViewById(R.id.imageView2);
imageView.setImageDrawable(R.drawable.loading);</strong></p>
<p>but it shows an error.</p>
<p>Anyone can help me? Thanks.</p>
| android | [4] |
1,079,967 | 1,079,968 | Double.ToString with N Number of Decimal Places | <p>I know that if we want to display a <code>double</code> as a two decimal digit, one would just have to use</p>
<pre><code>public void DisplayTwoDecimal(double dbValue)
{
Console.WriteLine(dbValue.ToString("0.00"));
}
</code></pre>
<p>But how to extend this to <code>N</code> decimal places, where <code>N</code> is determined by the user?</p>
<pre><code> public void DisplayNDecimal(double dbValue, int nDecimal)
{
// how to display
}
</code></pre>
| c# | [0] |
3,667,888 | 3,667,889 | Display unicode characters in TextView Android | <p>There are a number of posts all over the internet on this topic, however none of them have been able to isolate and solve the problem.</p>
<p>I am trying to show some special UTF-8 encoded symbols stored in a SQLite database using a TextView, however all it shows is boxes. I understand what this means is that right font is not installed. But when I print those symbols using Arial font on Mac it works.</p>
<p>I am trying to use an Arial typeface on the device and the emulator.</p>
<p>Any advise.</p>
| android | [4] |
1,781,294 | 1,781,295 | jQuery - Ability to Change an IMG Source, and show a loader until the image is loaded by the browser | <p>I have a frame with an image tag inside, like a photo gallery</p>
<pre><code><div id="frame">
<img src="yahoo.com/logo.gif" id="photo" />
</div>
</code></pre>
<p>With jQuery I'm going to dynamically change the img src to a different image URL. This causes the frame to jump in height as the image dimensions are different. It also cause a flash as the browser loads the image. It's a bad experience.</p>
<p>What'd I'd like to know if is possible, is whenever the img src is changed, is for jQuery to show a default loader, and then once the image is fully loaded, then show the image and remove the loader.</p>
<p>Any suggestions? hopefully a plugin? thanks</p>
| jquery | [5] |
4,050,957 | 4,050,958 | Casting array of objects (which implement interface IFoo) to IFoo[] in C# | <pre><code>class A : IFoo
{
}
...
A[] arrayOfA = new A[10];
if(arrayOfA is IFoo[])
{
// this is not called
}
</code></pre>
<p>Q1: Why is <code>arrayOfA</code> not an array of <code>IFoos</code>?</p>
<p>Q2: Why can't I cast <code>arrayOfA</code> to <code>IFoo[]</code>?</p>
| c# | [0] |
792,863 | 792,864 | Does javascript have to be in the head tags? | <p>I believe javascript can be anywhere (almost), but I almost always see it in between <code><head></head></code>. I am using jquery and wanted to know if it has to be in the head tags for some reason or if will break something if I move it. Thank you.</p>
<p>EDIT: Why is it almost always in the head tags?</p>
| javascript | [3] |
2,116,232 | 2,116,233 | JS listener for global var? | <p>I want to keep everything contained within a single function, and not make all the various variables global.</p>
<p>Is it possible to set up an event listener within the function main to watch a global var?</p>
<p>in this example call doTheStuff() when the index is altered? or might I be going about this the wrong way?</p>
<pre><code>var index = 0;
function main(data, data, data, data, data, data,)
{
fucntion one(){ two() }
function two(){ three() }
function three(){ }
function doTheStuff(){ }
}
</code></pre>
| javascript | [3] |
200,221 | 200,222 | Can AVPlayer play MP3 files on iPad | <p>Can AVPlayer place MP3 files? </p>
<p>It does not list MP3 in the apple documentation.</p>
| iphone | [8] |
1,644,746 | 1,644,747 | Strange for-loop behavior in Javascript | <p>I have next problem: arr has only two elements. Next loop tries to execute his body 3 times:</p>
<pre><code>var selectHTML = "";
for (var i = 0; i< arr.length; i++) {
selectHTML += '<option value="' + arr[i].id + '">' + arr[i].name + '</option>';
}
</code></pre>
<p>Next loop tries to execute his body only 2 times as I expect:</p>
<pre><code>var selectHTML = "";
for (var i = 0; i< arr.length; i++) {
alert(i);
selectHTML += '<option value="' + arr[i].id + '">' + arr[i].name + '</option>';
}
</code></pre>
<p>Why (tested in Firefox 14.0.1)?</p>
<p>Updated: sorry for the semicolon after counter increment, it's a typo. But the code still doesn't work event without it.</p>
<p>Updated: Ok, this code was simplified. Whole code itself:</p>
<pre><code>var selectHTML = "";
timeSheet.steps = [ { name:"Leave as is", id:-1}, { name:"Approved", id:2} ];
for (var counter = 0; counter < timeSheet.steps.length; counter++) {
selectHTML += '<option value="' + timeSheet.steps[counter].id + '">' + timeSheet.steps[counter].name + '</option>';
</code></pre>
<p>}</p>
<p>In Firebug I can see that timeSheet.steps.length equals 2. By the way, instead of placing "alert(i)" I've added a comment and body executes 2 times. Magic...</p>
| javascript | [3] |
2,929,626 | 2,929,627 | Why I am unable to change this checkbox if i use data to restore textbox values beside to it | <p>Hi As stated in the Question i am unable to uncheck/check the textbox..<br>
Fiddle : <a href="http://jsfiddle.net/Uehnh/1/" rel="nofollow">http://jsfiddle.net/Uehnh/1/</a><br>
Here is my HTML </p>
<pre><code><table>
<tr>
<td><input type='checkbox'><span>Text1</span><input type='text'></td>
</tr>
<tr>
<td><input type='checkbox'><span>Text2</span></td>
</tr>
<tr>
<td><input type='checkbox'><span>Text3</span></td>
</tr>
<tr>
<td><input type='radio'><span>None of all</span></td>
</tr>
</table>
</code></pre>
<p>The below code is not allowing me to uncheck or check the checkbox..Actually this is intended to restore the previously cleared data of textbox..</p>
<pre><code> $('.humble').live('change',function()
{
var th=$(this);
var input=th.closest('td').find('input[type="text"]');
if(th.prop('checked',false))
{
input.data('text',input.val());
input.val('');
}
else
{
input.val(input.data('text'));
}
});
</code></pre>
<p>and here is the fiddle with complete code <a href="http://jsfiddle.net/Uehnh/1/" rel="nofollow">http://jsfiddle.net/Uehnh/1/</a><br>
I am trying to restore the text with previous text using data property.. But here i am unable to check the first checkbox.. This is not allowing me to do..<br>
Please check and let me know errors..</p>
| jquery | [5] |
4,040,471 | 4,040,472 | Handled socket exception causing force close dialog on Android device | <p>I have an android app (client) and a server app on my PC. In order to test the connection with the server, I need to open a new socket with the proper IP address and the port on which the server is listening.</p>
<p>I want my client app to have a test connection feature. The problem is: whenever I open a connection through a socket when the server is not running, the android app closes and displays the force close dialog although I do handle that exception. Why is that?</p>
<p>The app always crashes at the bottom try/catch block of the following code:</p>
<pre><code> InetAddress serverAddr=null;
try {
serverAddr = InetAddress.getByName(serverIP);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
Log.e("TCP","error 1", e);
}
Log.i("TCP", "C: Connecting...");
try {
socket = new Socket(serverAddr, serverPort);
} catch (IOException e) {
// TODO Auto-generated catch block
Log.e("TCP","error 2", e);
}
</code></pre>
<p>Edit here is the log output:</p>
<pre><code> error 2 java.net.ConnectException: /192.168.1.101:3000 - Connection refused at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:254)
at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:219)
at java.net.Socket.startupSocket(Socket.java:800)
at java.net.Socket.<init>(Socket.java:316)
at com.jackusz.TCPClient.run(TCPClient.java:56)
at java.lang.Thread.run(Thread.java:1096)
</code></pre>
| android | [4] |
683,468 | 683,469 | c++, when do you need/have to pass data as (*&) | <p>I came across people passing data objects as:</p>
<p>declaration:</p>
<pre><code>DataObject * data = 0;
</code></pre>
<p>calling it as:</p>
<pre><code>SomeMethod( data );
</code></pre>
<p>definition of Somethod:</p>
<pre><code>void SomeMethod(SomeObject * & object)
</code></pre>
<p>My obvious question is, when and why do you have to do this (& *)?
Is it passing the pointer as reference?</p>
| c++ | [6] |
619,038 | 619,039 | C++ byte const* write to file | <p>I'm receiving the following as an argument in a callback function in C++.</p>
<p>byte const* Buffer()</p>
<p>The Buffer is a pointer to a buffer containing video frame.
How can I save that to a file?</p>
<p>Thanks</p>
| c++ | [6] |
2,343,186 | 2,343,187 | C# version of CopyOnWriteArrayList | <p>We do not have C# version of <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/CopyOnWriteArrayList.html" rel="nofollow">CopyOnWriteArrayList</a> in standard library. Is there any other open source library available?</p>
| c# | [0] |
1,955,940 | 1,955,941 | Change HTML/CSS from ASP(C# or VB) code | <p>In my case, I have an HTML/CSS Menu <strong>in the site master</strong>.</p>
<p><img src="http://i.stack.imgur.com/tL5Pw.png" alt="enter image description here"></p>
<p>So, when you hover your mouse over "Graphics", it highlights it (using CSS onHover).</p>
<p>Now what I need to do is that when you actually click on "Graphics" (and it takes you to the graphics page), it remains highlighted, if possible in a different colour.</p>
<p>I'm thinking of modifying the Site.Master style from C# or VB code.</p>
<p>Any ideas? Thanks.</p>
| asp.net | [9] |
3,832,420 | 3,832,421 | Storing data on iPad | <p>My application needs to store a list of airports. This list needs be setup manually i.e. its not coming from a web service.</p>
<p>I am thinking of creating a Core Data database and then inputting this list myself. This Core db will then ship with the App.</p>
<p>Would you recommend any other ways of doing this? Should I perhaps rather use an XML file or some other way of doing it?</p>
| iphone | [8] |
1,549,976 | 1,549,977 | Why does Output to file not work but print statement does? | <p>I have the following code:</p>
<pre><code>for node, value in sorted(d.iteritems()):
outfile.write([node] + value)
print(node, value)
</code></pre>
<p>I read a few different SO posts about this and am still somewhat confused. The print statement works perfectly, printing the key and value correctly in the interpreter. But I couldn't figure out a way to get the outfile.write() statement to work here. Would greatly appreciate any clarification!</p>
| python | [7] |
5,784,503 | 5,784,504 | over coming extra . in filenames with move_uploaded_file | <p>the $_FILES['tmp_name'] is empty when I'm trying to move the files on the server to the upload dir- i have put the error down to some pdfs have the filename convention of bla.pub.pdf- could this be my problem? how do i over come it?</p>
| php | [2] |
5,241,320 | 5,241,321 | I Have a problem with understanding some Java code | <p>The Code:</p>
<pre><code>package com.keyoti.rapidSpell;
import java.util.Comparator;
// Referenced classes of package com.keyoti.rapidSpell:
// RapidSpellChecker
class RapidSpellChecker$CompareL
implements Comparator
{
public int compare(Object a, Object b)
{
return (int)(100D * (suggestionScore2b(topWord, (String)b) - suggestionScore2b(topWord, (String)a)));
}
public void with(String w)
{
topWord = w;
}
private String topWord;
RapidSpellChecker$CompareL()
{
}
}
</code></pre>
<p>This is the one the many classes in the application.</p>
<p>What does the <code>$</code> sign in <code>class RapidSpellChecker$CompareL implements Comparator</code> signify?Is it simply the class name or has some significance?</p>
| java | [1] |
340,087 | 340,088 | detecting browser scrolling | <p>How can I know when the user has scroll on the screen?</p>
| javascript | [3] |
4,144,131 | 4,144,132 | How to produce these views? How Android screens go beyond the simple controls that have Android? | <p>How Android screens go beyond the simple controls that have Android, look at this for example.
How come so that each key responds independently? Is it a single image, several or a drawing?
<img src="http://i.stack.imgur.com/HJKI2.jpg" alt="enter image description here"></p>
<p>How to put each circle in the specific country? What if I want a country to be selected? <img src="http://i.stack.imgur.com/wBYIH.jpg" alt="enter image description here"></p>
| android | [4] |
4,101,345 | 4,101,346 | ascii char representation in Java? | <p>If I use a single int to represent an ascii character set, how is using it reducing the storage space by a factor of 8 ? as compared to an array of 256 boolean values ? The single int is also functioning like a bit vector. </p>
<p>A boolean in java will occupy 1 bit as it can represent only true or false values. So for example if i have an array of boolean values. boolean[] char_set = new boolean[256] This will occupy 256 bits correct ? I'm reading that if i use a single int like a bit vector which means I can use 32 bits to cover 256 values. I guess that is reduction by a factor of 8. But why does the code below work ? </p>
<p>It is checking if there are any duplicates in the string. They are assuming an ascii char set. Str is some string. </p>
<pre><code>int checker = 0;
for(int i=0;i<str.length();i++)
{
int val = str.charAt(i) - 'a';
if(checker& (1<<val)) > 0)
{
return false;
}
checker |= (1<<val);
}
return true;
}
</code></pre>
<p>Can someone particularly explain how the bit vector logic works in this case. They are assuming the string contains lowercase characters. </p>
| java | [1] |
225,706 | 225,707 | Iterate through session array? | <p>I haven't use PHP for some time, and I need some help to create some lines of code. I wrote this line of code some years ago for a website</p>
<pre><code>array_push($_SESSION['buildingsAlreadySeenList'],$id);
</code></pre>
<p>This is my problem, I just want to iterate through the array and put the first value at index 0 to $buildingId and then next time put the value of index 1 to $buildingId with som While loop i guess? I know it's easy, but sadly I haven't used PHP for some time! Preciate the help! Thanks!</p>
| php | [2] |
4,383,799 | 4,383,800 | focus not getting set on td | <p>I am coding for a html wysiwyg editor. I am trying to modify a table already present in the editor. I have a menu from which i can modify rows/columns to the table.</p>
<p>After I insert a new row/column I need to set the focus to the new row/column. This works fine.</p>
<p>But when i delete a row/column, I am not able to set focus to the nearby row/column.</p>
<p>I am setting tabIndex property to td to focus it.</p>
<pre><code>tbody.removeChild(tr); //tr is the row to be deleted
pre_tr.childNodes[td.cellIndex].tabIndex = 1; //pre_tr has the previous tr to be focused
pre_tr.childNodes[td.cellIndex].focus();
</code></pre>
<p>Any help in this regard is appreciated. Thanks.</p>
| javascript | [3] |
3,083,907 | 3,083,908 | How to display start time and stop time | <p>I am very new to C# programming, I have start button in one class, Transfer Start and Transfer Stop labels with TextBox in another class. As well as both are in different tabs in the design also. I am able to display start and stop time in the same tab and class but i am not able to display in another class.I have attached simple design as below.![Sample][1]</p>
<p>When i click"start" button in Project tab then it has to display the start time in the textbox with label "transfer start". same with stop button also. I want to display start and stop times. in the project tab i have some other functionality to add but i haven't displayed here.</p>
| c# | [0] |
3,802,728 | 3,802,729 | Is it bad to run a thread for longer period (+30mins) in Android? | <p>I'm running a thread from a service where i'm listening for changers in the acceleronometer every 3 seconds. So i run the listener in a while loop with Thread.sleep(3000). But it tends to work with shorter duration. But in longer run it seems to get crash the whole application. </p>
<p>Any suggestions?</p>
| android | [4] |
4,062,019 | 4,062,020 | Can we print an ' A ' with ' * '' using for loop in C# | <p>I want to print the letter "A" on screen. The letter should be built using the asterix symbol (*). For instance in a console application.</p>
<p>Can this be done in simple way using for loop. </p>
<p>For example:</p>
<pre><code> **
* *
* *
******
* *
* *
</code></pre>
<p><strong>EDIT :</strong></p>
<p>Answers below are totally unrelated to the OP, but <strong><em>Very Intriguing, Knowledgeable, and Meaningful</em></strong></p>
| c# | [0] |
4,742,606 | 4,742,607 | Searching LPSTR string | <p>I want to find some words after i get the whole file to char*. I know how to do it using the string class functions but i don't want to copy the data again to a string variable. is there any similar functions available to use for char* strings or should i still use string class?</p>
| c++ | [6] |
3,752,373 | 3,752,374 | programmatically execute Touch event in android | <p>Can we execute touch event programmatically in android by some method, such as passing screen co-ordinates(x,y)? Is there any such method? Please guide me.</p>
| android | [4] |
2,435,015 | 2,435,016 | convert image.jpg to <img src="image.jpg"> | <p>i have seen this is Facebook, when the user paste the image link
www.blahblah.blah\blah.jpg
it automatically gets to <code><img src="...."/></code>
how to do it in PHP ?</p>
| php | [2] |
4,705,874 | 4,705,875 | cloned android source from github but can't compile it | <p>I just used <code>repo</code> to clone the android source via the following commands</p>
<pre><code>repo init -u git://github.com/android/platform_manifest.git --repo-url=git://github.com/android/tools_repo.git
repo sync
</code></pre>
<p>I now have a directory layout that looks like this:</p>
<pre><code>~/android-src/
bionic
build
dalvik
development
external
frameworks
hardware
packages
prebuilt
system
</code></pre>
<p>from <code>~/android-src/</code> I ran <code>. build/envsetup.sh</code> and than used <code>lunch</code> to select a build configuration.</p>
<p>I than tried to run <code>make</code> as described in the google build instructions <a href="http://source.android.com/source/building.html" rel="nofollow">here</a>, however I have no idea where to run <code>make</code> from. I have no make file in my <code>~/android-src</code> folder and executing <code>m</code> doesn't find a makefile either.</p>
<p>I'm really confused as to how to actually start compiling the android source and trying to find relevant information on the web has been frustrating.</p>
<p>Update:
Based on the below answer from Yuri (which I tried previously as wel) I am now getting this when running <code>repo sync</code></p>
<pre><code>Initializing project platform/abi/cpp ...
fatal: '../platform/abi/cpp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/abi/cpp
</code></pre>
<p>So it appears either the directions are wrong or there is something wrong with their repo. Or am I missing something?</p>
| android | [4] |
2,102,142 | 2,102,143 | How to Check in asp.net the Email Id exists or not in asp.net | <p>I want to know that when user registering how to check the email id is exists or not.</p>
| asp.net | [9] |
2,217,635 | 2,217,636 | how to create a place finder application | <p>I am new to android and trying to develop one place finder application,gps is detecting my current location but how it can show the coffee shop in that area in listview</p>
| android | [4] |
977,281 | 977,282 | How to place cursor to certain EditText box? | <p>My XML contains Five <code>EditText</code> box and One Button. My cursor is now pointed to the First <code>EditText</code> box. How can I click a button to place the cursor automaticly to Third <code>EditText</code> box.</p>
<p>Thank you!</p>
| android | [4] |
1,315,300 | 1,315,301 | Price formatting for Portuguese | <p>On my website, <code>echo $symbols['currency']; echo $fields['price'];</code> holds a value in US currency format and it outputs R$19800</p>
<p>and <code>echo $symbols['currency']; echo number_format($fields['price']);</code> outputs R$19,800</p>
<p>How do I format it to output <strong>R$19.800,00</strong> which is Portuguese price formatting? </p>
<p>I tried </p>
<pre><code>echo $symbols['currency'];
setlocale(LC_MONETARY, 'it_IT');
echo money_format('%.2n', $fields['price']);
</code></pre>
<p>and it outputs <strong>R$EUR 19.800,00</strong> which is corrent, but Im finding it hard to remove EUR from printing. Thanks a lot.</p>
| php | [2] |
5,538,183 | 5,538,184 | Javascript: Different return types | <p><br>
I saw I could return different type for the same function in JS, which I am new to. Is it idiomatic, or should be discouraged. A mock example is below.</p>
<p>thanks.</p>
<p>Eg:</p>
<pre><code>somefn = function(e) {
switch (e.type)
{
case 'mousedown':
return false;
case 'mousemove':
return {x:10, y:20};
}
};
</code></pre>
| javascript | [3] |
1,018,139 | 1,018,140 | create HWND in c# | <p>am import some dll for create the live video. here myprob is i have c++ code like </p>
<p>int PLAYER_SDK_SPEC CreatePlayer( HWND hWndParent, RECT& rectPlayer, const char* szWndTitle );</p>
<p>in c# i have import dll like </p>
<p>[DllImport("PlayerLib")]
public static extern int CreatePlayer(IntPtr Handle, Rectangle RECT, StringBuilder szWndTitle);</p>
<p>am call that funcation like
CreatePlayer( this.Handle, rect, str6);</p>
<p>but it's generate some unhandled exception... please help me to solve this prob
thanks in advance</p>
| c# | [0] |
1,331,191 | 1,331,192 | How to count lines in a string? | <p><strong>I am removing text from a string and what to replace each line with a blank line.</strong></p>
<p><em><strong>Some background:</em></strong>
I am writing a compare function that compares two strings. Its all working fine and are displayed in there two separate web browsers. When i try scroll down on my browsers the strings are different lengths, I want to replace the text i am removeing with a blank line so that my strings are the same length.</p>
<p><strong>In the code below i am looking to count how many lines aDiff.Text has</strong></p>
<p><strong>Here is my code:</strong></p>
<pre><code>public string diff_prettyHtmlShowInserts(List<Diff> diffs)
{
StringBuilder html = new StringBuilder();
foreach (Diff aDiff in diffs)
{
string text = aDiff.text.Replace("&", "&amp;").Replace("<", "&lt;")
.Replace(">", "&gt;").Replace("\n", "<br>"); //&para;
switch (aDiff.operation)
{
case Operation.DELETE:
//foreach('\n' in aDiff.text)
// {
// html.Append("\n"); // Would like to replace each line with a blankline
// }
break;
case Operation.EQUAL:
html.Append("<span>").Append(text).Append("</span>");
break;
case Operation.INSERT:
html.Append("<ins style=\"background:#e6ffe6;\">").Append(text)
.Append("</ins>");
break;
}
}
return html.ToString();
}
</code></pre>
| c# | [0] |
4,238,523 | 4,238,524 | Webservice replacing old service in .net application | <p>I am trying to replace the old web service with a new web service. Is it possible to replace the old service with a new one?</p>
<p>If it's possible in coding where and are all I have to change .. Please help me on this..</p>
<ul>
<li>old service name <code>is:xyz.wsdl</code></li>
</ul>
<p>How can we know that service takes which values and returns which values?</p>
<p>Thanks in advance</p>
| c# | [0] |
798,821 | 798,822 | Break decimal value into two values (before and after decimal) | <p>How to break a decimal value into integer values, first value should be the value before decimal and the other value of after decimal.</p>
<p>Problem : Decimal place is unknown as well as the number of digits;
ex : </p>
<pre><code>double value = 2635.215;
int firstValue = 2635; // Should be
int secondValue = 215; // Should be
</code></pre>
| c# | [0] |
3,537,556 | 3,537,557 | cgi scripts with no server | <p>My goal is to use to make it easy for non-programmers to execute a Python script with fairly complex options, on a single local machine that I have access to. I'd like to use the browser (specifically Safari on OS X) as a poor man's GUI. A short script would process the form data and then send it on to the main program(s).</p>
<p>I have some basic examples of python scripts run using the built-in Apache server, by clicking submit on a form whose html is th:</p>
<p><img src="http://i.stack.imgur.com/Dy5hA.png" alt="alt text"></p>
<p>e.g. <a href="http://telliott99.blogspot.com/2010/11/simple-server-running-python-script-on_17.html" rel="nofollow">here</a>. What I want to do now is do it <i>without</i> the server, just getting the form to invoke the script in the same directory. Do I have to learn javascript or ...? I'd be grateful for any leads you have. Thanks.</p>
| python | [7] |
4,717,801 | 4,717,802 | How can i determine when my application is running? | <p>I have an application that uses a Service to fetch data in the background both while the application is running and when it's not.
When it is not running i would like to show a notification when there is new data, but not when the app is running.</p>
<p>How do i determine in my service whether the app is running or not?</p>
| android | [4] |
292,833 | 292,834 | C++ -- How to prevent an object from being allocating on stack? | <p>you have a class A, where you set ctor to be private, so a client can't call</p>
<pre><code>A a;
</code></pre>
<p>to create obj on stack.
But someday another developer adds a new ctor:</p>
<pre><code>A(int)
</code></pre>
<p>and try to call "A a(1);" inside main(). So this will create a obj on stack. How do you prevent that?</p>
<p>Here is my solution but I don't know whether or not it makes sense.</p>
<p>Use private or protected destructor for the class A and provides a factory function to allocate the object and a function to release the resource (i.e. call destructor)</p>
<p>Thank you</p>
| c++ | [6] |
1,896,582 | 1,896,583 | Creating closures in a loop in JavaScript | <p>I have this scenario:</p>
<pre><code><html>
<head>
<script type="text/javascript" src="jquery-1.4.4.js"></script>
<script type="text/javascript">
var actions = {
'view' : function(){alert("view");},
'history': function(){alert("history");},
'renewal': function(){alert("renewal");}
}
for(var action in actions){
$('.' + action).live('click', function(e){
e.preventDefault();
if(actions[action])
actions[action]();
});
}
</script>
</head>
<body>
<a class="view" href="#">view</a>
<a class="history" href="#">history</a>
<a class="renewal" href="#">renewal</a>
</body>
</html>
</code></pre>
<p>I think a closure is created, since clicking a link always alerts "renewal" and I am not able to fix it.</p>
| javascript | [3] |
5,330,959 | 5,330,960 | Create ISO image file from CD/DVD with C# | <p>So I nedd to develop an application in C#, the user of this application will choose a source device (CD or DVD) from wich the iso image will be created, and a destination of the ISO image. My question is what libraires available that I can use to acheive what I just described?</p>
<p>Thnaks</p>
| c# | [0] |
1,740,132 | 1,740,133 | Best way to represent a tooltip on a table | <p>I have a table with lot of information that needs to display on each cell. I currently have images to represent the presence of information and on hover of these images, I would like to display additional info. I was impressed with the meetup.com and facebook style tool tips divs which display more information on hover and the div would expand based on the amount of information. Which is the best way to represent this kind of info? I would like to use jQuery/Javascript/HTML/CSS to achieve this effect.</p>
<p>Note 1: I have looked at few jquery plugins but they all seem to use the title attribute of a tag to represent the information. But I have large amount of information I need to show on the tooltip and also need to style the information so using title attribute is not very helpful.</p>
<p>Note 2: The tooltip also needs to adjust its position if the left/right or bottom/top of the table is detected. </p>
<p>see the image to get a look at the table that is likely to contain the above format.</p>
<p><img src="http://i.stack.imgur.com/UnPz0.png" alt="http://imgur.com/f8EQf"></p>
| jquery | [5] |
2,482,823 | 2,482,824 | Invoke SAP Webmethods in ASP.NET app? | <p>Can any body help me on calling a SAP Webmethod using ASP.NET application.</p>
<p>Thanks,
-Narendra</p>
| asp.net | [9] |
4,362,022 | 4,362,023 | How big in bytes is a DataRow | <p>I have a one-time process (hashing all our user passwords) written using datasets. The performance needs improvement so we've profiled the application and found that increasing the 'batch size' of the update will improve performance. I also know that if I load the entire data set into memory the application will start hitting swap and slow down.</p>
<p>The question is: how big is a System.Data.DataRow derived class? I'd like to calculate a batch size which I know won't force the application into swap.</p>
| c# | [0] |
4,314,232 | 4,314,233 | How to change the width of the row of a UITableView | <p>Can we resize the width of the row of a UITableView.</p>
| iphone | [8] |
2,323,636 | 2,323,637 | Iteration in a single line | <p>I have some code of the form:</p>
<pre><code>for i in range(nIterations):
y = f(y)
</code></pre>
<p>Where <code>f</code> is a function defined elsewhere. hopefully the idea of that code is that after it's run <code>y</code> will have had <code>f</code> applied to it <code>nIterations</code> times.</p>
<p>Is there a way in python to write this in a single line?</p>
| python | [7] |
1,563,207 | 1,563,208 | Self modifying code - iPhone | <p>After reading this wikipedia article :</p>
<p><a href="http://en.wikipedia.org/wiki/Self-modifying_code" rel="nofollow">http://en.wikipedia.org/wiki/Self-modifying_code</a></p>
<p>I am wondering if this technique has been done on iPhone.</p>
<p>Thanks</p>
<p>Thierry</p>
| iphone | [8] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.