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,605,739
2,605,740
how to send mail in asp.net
<p>hii i m trying to send mail through coding of asp</p> <p>is there any external APIs to send mail like JAVA</p> <p>give some hints if possible sample code!!</p> <p>I m using vs 2005 as well as vs 2008</p>
asp.net
[9]
4,620,103
4,620,104
Getting emails and phone numbers from contact without extending Activity
<p>I'm trying to get the email adresses and phone numbers from a contact. My class doesn't <code>extend Activity</code> and now I'm stuck.</p> <p>How can I overcome this problem?</p>
android
[4]
2,358,044
2,358,045
Convert a python dict to a string and back
<p>I am writing a program that stores data in a dictionary object, but this data needs to be saved at some point during the program execution and loaded back into the dictionary object when the program is run again. How would I convert a dictionary object into a string that can be written to a file and loaded back into a dictionary object? This will hopefully support dictionaries containing dictionaries.</p>
python
[7]
4,810,038
4,810,039
ClearInterval not stopping
<p>I have the following JQuery code:</p> <pre><code>JModel.ClipThumbs.Clip.prototype = { interval: null, setThumb: function(src) { this.mainThumb.src = src; }, mouseEntered: function(el) { var temp = this; var x = 0; this.interval = setInterval(function() { if (x &gt;= temp.galleryImgs.length) { x = 0; } // set main thumb temp.setThumb(temp.galleryImgs[x].src); // increment for the display (0/7 being bad looking to users) x++; // update image count display $(temp.clipCount).html(""+x+"/"+temp.galleryImgs.length); }, 1000); }, mouseLeft: function(el) { clearInterval(this.interval); } }; </code></pre> <p>When I leave the gallery rotation doesn't stop</p> <p>Ideas?</p> <p><strong>EDIT</strong>: the fix was:</p> <pre><code>jQuery(this.mainThumb) .bind('mouseenter', jQuery.proxy(this.mouseEntered, this)) .bind('mouseleave', jQuery.proxy(this.mouseLeft, this)); </code></pre> <p>The <code>mouseleave</code> had to have a <code>jQuery.proxy</code> with this bound also to access this.</p>
jquery
[5]
1,280,137
1,280,138
Android - keeping the activity alive
<p>I have a puzzling problem. If I deploy my application from Eclipse on any device/emulator, I can use the Back and Home buttons to minimize it and then I can click the launcher icon to resume it. </p> <p>If I take the apk, put it on the phone and install it (using the Astro file manager), then press Back or Home, when I click the launcher icon again, my application will be recreated instead of resumed: the activity is not destroyed.</p> <p>This goes against everything written about on the android developer website regarding activities and their lifecycle. </p> <p>For instance, this is what I do when the user uses the Back button: </p> <pre><code>@Override public void onBackPressed() { moveTaskToBack(true); } </code></pre> <p>Yet my application is recreated when I click its launcher icon. Any ideas?</p>
android
[4]
5,355,955
5,355,956
Caused by: java.lang.NullPointerException while trying to call other Activity
<p>I am trying to call, ProductsActivity.java whenever user do click on OK in AlertDialog in ProductInformationActivity.java, but always getting an Error <strong>Caused by:java.lang.NullPointerException</strong> at line number 76th, which is </p> <pre><code> KEY_CATEGORY = bdl.getString("category"); </code></pre> <p><strong>ProductInformationActivity.java:</strong></p> <pre><code> alertdialog.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { finish(); } }); </code></pre> <p><strong>ProductsActivity.java:</strong></p> <pre><code> list.setAdapter(adapter); Bundle bdl = getIntent().getExtras(); // below is the line number 76 KEY_CATEGORY = bdl.getString("category"); </code></pre> <p><strong>Logcat:</strong></p> <pre><code>05-18 16:23:25.027: E/AndroidRuntime(922): Caused by: java.lang.NullPointerException 05-18 16:23:25.027: E/AndroidRuntime(922): at com.erachnida.restaurant.versionoct.menu.ProductsActivity.onCreate(ProductsActivity.java:76) 05-18 16:23:25.027: E/AndroidRuntime(922): at android.app.Activity.performCreate(Activity.java:5104) 05-18 16:23:25.027: E/AndroidRuntime(922): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 05-18 16:23:25.027: E/AndroidRuntime(922): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) 05-18 16:23:25.027: E/AndroidRuntime(922): ... 11 more </code></pre>
android
[4]
3,878,824
3,878,825
How to display \ in android textview?
<p>I am familiar with using \n in a textview to display on the second line, however I want to display the / in my textview. I get the escape errors in eclipse when trying to display "C:\directorya\directoryb\" is there a code I should be using to display \ instead?</p>
android
[4]
1,709,157
1,709,158
Whats the best way to learn java if you have trouble concentrating on what your doing?
<p>I Want to learn java for personal and maybe eventually professional use but every time I pick up book i lose focus forget everyhing and have to read it all over. Is there a better way to learn java or any programming language in general then by using a book like head first java?</p>
java
[1]
4,266,054
4,266,055
reasons for php hang
<p>My hosting provider has suspended my account with a notice that php gets hang often.</p> <p>They have also send usage report.</p> <pre><code>User | Domain | % CPU | % MEM | MySQL Processes lufadea1 lufadeal.com 20.88 1.30 0.6 13337 lufadea1 20 0 132m 17m 7656 R 2.3 0.1 0:00.07 /usr/bin/php/home/lufadea1/public_html/index.php 13346 lufadea1 20 0 129m 13m 7128 R 1.7 0.1 0:00.05 /usr/bin/php/home/lufadea1/public_html/index.php 13344 lufadea1 20 0 127m 10m 6204 S 1.3 0.1 0:00.04 /usr/bin/php/home/lufadea1/public_html/index.php 13347 lufadea1 20 0 126m 10m 6204 R 0.7 0.1 0:00.02 /usr/bin/php /home/lufadea1/public_html/index.php </code></pre> <p>I wants to know what are the possible reason which can cause the php hang problem. I am using codeigniter framework. Let me know if you need any other information.Thanks.</p>
php
[2]
634,916
634,917
How to create a shortcut for an app from an other app in c#?
<p>I'm trying to make a window's form application with c# that can copy an other application's shortcut to an especial folder.I use this code to copy files but cannot make a short cut...</p> <pre><code>system.io.file.copy("what","where"); </code></pre> <p>I use this but it doesn't work</p> <pre><code> System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(".\\calc.exe"); string destination = @"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\Startup"; System.IO.FileInfo[] files = dir.GetFiles("*.exe"); foreach (var shorcut in files) { System.IO.File.Move(shorcut.FullName, destination); } </code></pre> <p>What is the easiest way?</p>
c#
[0]
5,830,172
5,830,173
How to get the resolution of image in iphone programmatically?
<p>how can I programmatically get resolution of an image in iPhone?</p> <p>Thanks. </p>
iphone
[8]
217,834
217,835
Testing for presence of UTF-8 character in JQuery string failing
<p>I'm trying to create a JQuery function that will test a string for the presence of a specific UTF-8 Character.</p> <p>In this case the character is <code>U+00AD</code> (<em>Soft Hyphen</em>). </p> <p>Here is one variation of the function I've tried, but just can't find a working solution.</p> <pre><code>var index = obj.value.indexOf($('&amp;#x00ad;').text()); var isMatch = index &gt;= 0; if (isMatch) { //Do match work } </code></pre> <p>Can anyone suggest a fix; or something else; I can use to accomplish this?</p>
jquery
[5]
4,318,411
4,318,412
Python permutation difference
<p>Is there something built-in to tell the permutation difference between two list? E.g.</p> <pre><code>difference("ijk", "ikj") = (0,2,1) difference("jik", "ikj") = (2,0,1) etc ... </code></pre> <p>oops, nevermind, here is a snippet</p> <pre><code>[a.index(i) for i in b] </code></pre>
python
[7]
2,134,918
2,134,919
The second .click() function is not working
<p>The first .click function is used to add an element(div) in a container and the second one is used to remove it from the container. The container initially has no elements. The removing of the function by clicking on it is not working</p> <pre><code>$(document).ready(function(){ $(".class1").click(function(){ //Code for adding element to the container and // removing class1 from it and adding class2 }); $(".class2").click(function(){ alert("hi"); //Even the alert is not displayed $(this).fadeOut(100); }); }); </code></pre> <p>However, it works if the element is already there before the page loads in the container. Any reasons why? Is it because of document.ready function? Solutions?</p>
jquery
[5]
3,600,525
3,600,526
Android - way to load large data in ListView any cache mechanism on cursors or something which loads listview faster
<p>I have a large dataset in database, I want to load this data in listview as fast as possible. I have tried a Async task which progressively adds elements from database to list which is bind to list view. But first records get loaded faster but to scroll down to last record it take much time. Is there any way that android cache these lists cursors and is synchronized with database like observers? There are examples like sms apps, contact list apps which loads faster. How to get such fast speed in loading listview?</p>
android
[4]
1,430,440
1,430,441
Gauss error function implementation for JavaScript
<p>Is there a free (BSD- or MIT-licensed) <a href="http://en.wikipedia.org/wiki/Error%5Ffunction" rel="nofollow">Gauss error function</a> implementation written in <a href="http://en.wikipedia.org/wiki/JavaScript" rel="nofollow">JavaScript</a>?</p>
javascript
[3]
44,789
44,790
How to show the "Who are you with?" and "Where are you?" using the com.facebook.android.Facebook
<p>I'm using com.facebook.android.Facebook to post a message to facebook I can post a message just fine using the code below</p> <pre><code>// post on user's wall. Bundle params = new Bundle(); params.putString("name", "app name"); params.putString("caption", "Caption"); params.putString("description", "this is the description"); params.putString("link", "http://somewebsite.com"); params.putString("message", "this is the message"); params.putString("picture","http://someimage"); this._facebook.dialog(this, "feed", params, new PostDialogListener()); </code></pre> <p>but the dialog that appears gives me a edit text for "Say something about this..." but no option for "Who are you with?" and "Where are you?"</p> <p>Is there a permission I need to enable or a setting in com.facebook.android.Facebook that I need to set?</p>
android
[4]
2,956,399
2,956,400
TCP client in JavaScript
<p>I am a newbie to java scripting, hence need help. I am looking for a tcp client code written in java script that constantly reads data from a server socket and prints to the console. Any help is highly appreciated.thanks</p>
javascript
[3]
5,402,824
5,402,825
issue regarding tokenize.py
<p>In python2.x tokenize() function has two arguments namely, 'readline' and 'tokeneater'. Second argument takes care of the output mechanism for tokenize() and is called once for each token. Now we know that in python3.x second argument 'tokeneater' is not there. How is output mechanism in python3.x being taken care of ? </p>
python
[7]
5,661,238
5,661,239
Can't add project as library to my project
<p>I'm trying to use ABS library in my project. I added library project to my workspace, checked this state ("Is Library" is true in project's settins), added this project to my one "Java Build Path" -> "Projects". But I can't mark this project as library ("Android"->"Libraries" in properties). I had added that, but when I opened it again, I saw that project hadn't been added. How can I fix it? </p>
android
[4]
5,265,095
5,265,096
How to hook into all Android click events?
<p>I'm looking for a relatively simple method of hooking into all click events in already existing code. Whenever a click occurs, I want the already assigned click event handler to run, and then I want to run the additional click handler that will do whatever I need it to do. Essentially, I want a simple way of adding a new OnClickListener to everything that can accept it.</p> <pre><code>For each component c add extra OnClickListener to c </code></pre>
android
[4]
1,175,669
1,175,670
How to remove the white-bar which remains after typing in Android
<p>For some reason, after a user enters text into an EditText within my Android app the white-bar which contains "suggestions" remains at the bottom of my Layout! If you press the "Back" button, it disappears.</p> <p>How can I stop this from remaining after completing text entry?</p> <p>EDIT:</p> <p>Screenshots</p> <p>Editing the text, white bar appears with suggestions:</p> <p><img src="http://i.stack.imgur.com/4JiKy.png" alt="alt text"></p> <p>And after going back to the ListView activity</p> <p><img src="http://i.stack.imgur.com/jG1r4.png" alt="alt text"></p>
android
[4]
4,278,669
4,278,670
Flashing Actionbar Icon
<p>I have an ActionBar icon which is a button to a chat message screen. I have two copies of the icon. One standard grey, and one yellow.</p> <p>When I display the yellow icon to indicate there is a message waiting, I want it to flash slowly.</p> <p>Is this possible with an actionbar icon?</p>
android
[4]
4,501,881
4,501,882
Returning a reference in JavaScript
<p>Here is the code:</p> <p><a href="http://jsfiddle.net/GKBfL/" rel="nofollow">http://jsfiddle.net/GKBfL/</a></p> <p>I am trying to get <code>collection.prototype.add</code> to return a reference such that the final alert will display <code>testing, testing, 123, testing</code>. Is there a way to accomplish what I'm trying to do here?</p> <p>HTML:</p> <pre><code>&lt;span id="spantest"&gt;testing, testing, 123, testing&lt;/span&gt;​ </code></pre> <p>JavaScript:</p> <pre><code>var collection = function () { this.items = {}; } collection.prototype.add = function(sElmtId) { this.items[sElmtId] = {}; return this.items[sElmtId]; } collection.prototype.bind = function() { for (var sElmtId in this.items) { this.items[sElmtId] = document.getElementById(sElmtId); } } var col = new collection(); var obj = {}; obj = col.add('spantest'); col.bind(); alert(obj.innerHTML);​ </code></pre>
javascript
[3]
1,910,782
1,910,783
Android appstore
<p>Just a quick question, On Android there are various appstore's. For instance Google's own, Amazon's etc.</p> <p>Is it possible for other 3rd parties to easily create there own app store?</p>
android
[4]
1,934,826
1,934,827
change font color of label at time interval in iphone sdk?
<p>I want to change the font color of the label at some time interval. Can anyone tell how to do it?</p>
iphone
[8]
5,318,341
5,318,342
JAVA - error variable for do.. while
<p>I having issue when compiling my assignment code.</p> <p>When I use the scanner input for the switch menu as integer value, the <code>do-while</code> is working fine, but due to assignment requirement, the menu input need to be char, so I alter it as below, but it keeps giving me error stating the variable of <code>m</code> is not found.</p> <pre><code>do { System.out.println(displayMenu("")); option = scn.nextLine(); char m = option.charAt(0); switch (m) { case 'A': TMA_Q3.enterInput(0); break; case 'B': System.out.println(" "); break; case 'C': System.out.println(""); break; case 'D': System.out.println(""); break; case 'E': System.out.println(""); break; case 'F': System.out.println(""); break; } } while(m != 'F'); // error occurs on this line stating m is not found </code></pre>
java
[1]
4,784,470
4,784,471
Is there any jQuery plugin which display an horizontal accordion showing half images?
<p>Basically I need one like this:</p> <p><a href="http://yogafasting.org/" rel="nofollow">http://yogafasting.org/</a></p> <p>First, it displays a partial image and then when you hover it, it shows the full image.</p>
jquery
[5]
2,902,519
2,902,520
Close android application programmatically
<p>How can i close my application programmatically?</p> <p>I used</p> <pre><code> finish(); </code></pre> <p>Or</p> <pre><code>rocess.killProcess(android.os.Process.myPid()); </code></pre> <p>Or</p> <pre><code>System.exit(0); </code></pre> <p>Or</p> <pre><code>moveTaskToBack(true); </code></pre> <p>but it closed the current running activity, but i need to close the whole application??</p> <p>I need to close app to retrieve some memory and then restart application again.</p> <p>Or </p> <p>does there is a way to clear all memory of the application?</p>
android
[4]
2,631,448
2,631,449
Lock screen doesn't cause onStop() to get called
<p>My app uses GPS, so I remove GPS updates in onStop() so it doesn't use up battery when it shouldn't. However, I noticed that the battery on my test phone was running down if my app was open when the lock screen comes on.</p> <p>So to test it, I added a Log.i(...) to the onStop() method of my activity. Sure enough, onStop() does not get called when I press the off button on my HTC Incredible (which turns off the screen).</p> <p>Is there any way to listen for the lock screen, or the screen turning off, since it doesn't call onStop() like it should?</p> <p>Thanks.</p>
android
[4]
1,711,945
1,711,946
C# interface implementation and generic collections question
<p>Suppose I have following code:</p> <pre><code>public class CBase: AbstractC,IRenderable { //code here } public class CBaseGroup { private List&lt;IRenderable&gt; CCollection; public CBaseGroup(List&lt;IRenderable&gt; c) { CCollection=c; } } public class CGroup:CBaseGroup { public CGroup(List&lt;CBase&gt; c):base(c) //here fails because cannot convert List&lt;CBase&gt; to List&lt;IRenderable&gt; { } } </code></pre> <p>Why it does not compile?</p> <p>Please feel free to suggest a nappropriate title.</p> <p>From Matthew Scharley answer I found that the code should look like:</p> <pre><code> public class CGroup:CBaseGroup { public CGroup(List&lt;CBase&gt; c):base(c.Cast&lt;IRenderable&gt;().ToList()) // cast to list since I'm not using IEnumerable { } } </code></pre> <p>This at least satisfies compiler.</p>
c#
[0]
3,760,606
3,760,607
Android What Event Is fired when user click on an EditText box?
<p>I am trying to prefill an EditText widget with some instr. but erase the moment the user clicks in the box so they start leftmost point? I tried registering onClickListener(), onKeyListener but I was not able to capture this? Thanks What can I register to detect this first click within the text editing area? </p>
android
[4]
3,715,186
3,715,187
How many times is a local var created when instantiating an object?
<p>In the message object below, if I call it like this:</p> <pre><code>var message_object = new Message( response_element ); message_object.display( 'empty' ); </code></pre> <p>is the messages array created for each call to new Message()...if so how can I ensure there is only one messages array, as that is all I need?</p> <pre><code>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 &lt;a class="d" href="mailto:chris@arcmarks.com"&gt;support&lt;/a&gt; to reset your password', } this.display = function( type ) { element.innerHTML = messages[ type ]; new Effects().fade( element, 'down', 4000 ); } }; </code></pre>
javascript
[3]
3,776,836
3,776,837
PHP - Weird characters when disabling error reporting
<p>This is basically all I'm doing</p> <pre><code>echo @file_get_contents("http://******.org/ti.php?i=".$i."&amp;s=".$s); </code></pre> <p>But when I remove the ti.php file from that server to test if it hides the error I get this in my browser where the error would be:</p> <pre><code> </code></pre> <p>What the hell is that (lol) ? I've never seen it before and can't think of an explanation of why it would appear, any ideas?</p>
php
[2]
2,490,341
2,490,342
Is it possible to replace a part of the settings application on Android?
<p>I am building an application that will make it easier to manage certain settings on an Android device. For now it will just be a separate app in Android market.</p> <p>But long term I would like the app to actually replace part of the Android settings app. Is it possible to have the app invoked or overwrite a certain part of the settings that the bundled app manages?</p>
android
[4]
5,558,730
5,558,731
Displaying iso-8859-1 encoded content in WebView
<p>I am obtaining HTML coded content from an SQlite database that I would like to display in a WebView . I am currently using:</p> <pre><code>public class ShowAbstracts extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); if (extras != null) { String body = extras.getString(DatabaseHelper.KEY_BODY); WebView webview = new WebView(this); setContentView(webview); String summary = "&lt;html&gt;&lt;body&gt; "+body+" &lt;/body&gt;&lt;/html&gt;"; webview.loadData(summary, "text/html", "iso-8859-1"); } } } </code></pre> <p>It works in that it opens a WebView and displays the contents but I get strange characters and for some content it just crashes. The Database is ISO-8859-1 encoded. Is there any way to take care of the special characters in my database content and display them properly?</p> <p>Thanks very much in advance!</p> <p>Rik </p>
android
[4]
3,776,430
3,776,431
Is it possible to send a custom HTTP request
<p>With javascript you can do it with xmlhttp.open, what other ways can do this?</p>
javascript
[3]
4,178,246
4,178,247
webview paging and book reading
<p>i am new developer in iphone</p> <p>how to paging in webview and not scrolling + i'm trying to implement ibook style like ipad book reading</p>
iphone
[8]
1,472,585
1,472,586
Having trouble reading from a file
<p>I have a more complex program that involves using what's written in a text file but it wasn't working at all, nothing was being displayed and everything is dependent on the file. If i just make the string equal to something in my code and get rid of reading from the file then it works. I tried something as simple as displaying the line that is read but it doesn't display anything when i run it.</p> <p>Edit: It can't find the path to the file... where is the default file usually in? The file is in the same directory as the program but it can't find it, why?</p> <pre><code>public static void main(String[] args) { String s; try { FileReader fstream=new FileReader("input.txt"); BufferedReader in=new BufferedReader(fstream); while((s=in.readLine())!=null){ System.out.print(s); }}catch(IOException e){ System.exit(0); } } } </code></pre>
java
[1]
2,590,956
2,590,957
How to setup parsing emails?
<p>How do I setup a server so I can get emails and parse them in python?</p>
python
[7]
2,307,498
2,307,499
Check active div onload
<p>I'm using something like this in a layout</p> <pre><code>&lt;nav id="main-nav"&gt; &lt;a href="#link1"&gt;Link1&lt;/a&gt; &lt;a href="#link2"&gt;Link2&lt;/a&gt; &lt;a href="#link3"&gt;Link3&lt;/a&gt; &lt;/nav&gt; &lt;div id="link1"&gt; some content goes here &lt;/div&gt; &lt;div id="link2"&gt; some content goes here &lt;/div&gt; &lt;div id="link3"&gt; some content goes here &lt;/div&gt; </code></pre> <p>So when i click on some nav link it scrolls down to the correct div. The thing is that NAV is a fixed positioned menu, and it uses 200px from the top. the JS i use to scroll is this:</p> <pre><code>$('#main-nav a').click( function(event) { var nome = $(this).attr("href"); $('html, body').animate({ scrollTop: $(nome).offset().top-198 }, 1600); }); </code></pre> <p>Ok, so there's this internal page, where the nav links become:</p> <pre><code>&lt;a href="http://www.mysite.com/#link1"&gt;Link1&lt;/a&gt; </code></pre> <p>The problem is that it loads the home ok, but the div starts from top, under the NAV (because there's no <code>offset().top-198</code> when it loads the page.) I think what i need is to find a way to get the <code>#link</code> from the url that loads and make a <code>onLoad</code> <code>scrollTop</code>, is that right?</p> <p>Any helps please?</p>
jquery
[5]
5,784,457
5,784,458
How can I have one button execute two actions?
<p>Is it possible to have the one “Save” button execute these two actions?</p> <p>Action 1:</p> <pre><code>&lt;td&gt; &lt;?php $target = TRoute::_("index.php?option=com_adsmanager&amp;task=save"); if ($this-&gt;nbcats == 1) { $this-&gt;displaySingleCatChooser(@$this-&gt;content-&gt;id,$this-&gt;conf,"com_adsmanager",$this-&gt;cats,$this-&gt;catid); } ?&gt; &lt;/table&gt; </code></pre> <p>Action 2:</p> <pre><code>&lt;input type="button" onclick="countDown(this.form)" value="SAVE"&gt;&lt;p&gt; </code></pre> <p>Thanks in advance.</p>
php
[2]
1,390,096
1,390,097
C# : how can i switch between my two network interface
<p>can i switch between my two network cards,i need to use on card to send mails so i need to switch control to it.si there a way to do this by c# code? any help will be appreciated</p>
c#
[0]
3,396,349
3,396,350
Java Class Path
<p>I am learning java at the moment and I am a bit confused on where or how to set a class path?</p> <p>I am using Jcreator Pro.</p> <p>Do I set it in the source file or in the IDE or in Windows somewhere?</p> <p>Any help would be greatly appreciated.</p>
java
[1]
750,523
750,524
error in android calcualtor application
<p>hi to all i have android application which is calculator that perform only one operation (addition) the result is always 3.0 whatever the two numbers are what is the solution??? here is the code </p> <pre><code>import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class claculator extends Activity { /** Called when the activity is first created. */ EditText nu1,nu2; Button add; TextView txtv; double x,y,z; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); nu1=(EditText)findViewById(R.id.n1); nu2=(EditText)findViewById(R.id.n2); add=(Button)findViewById(R.id.btn); txtv=(TextView)findViewById(R.id.tv); x= Double.parseDouble(nu1.getText().toString()); y= Double.parseDouble(nu2.getText().toString()); add.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { z=x+y; txtv.setText(String.valueOf(z)); } }); } } </code></pre>
android
[4]
3,950,572
3,950,573
Create file and folders recursively
<p>I got an array containing path names and file names</p> <pre><code>['css/demo/main.css', 'home.css', 'admin/main.css','account'] </code></pre> <p>I want to create those files and folders if they are not existed yet. Overwrite them if they are already existed.</p>
php
[2]
1,067,503
1,067,504
How create a frame "tap to sign" as SIGNificant Signature Capture?
<p>I want create a signature app on android, but i don't know 'how create a frame "tap to sign" as SIGNificant Signature Capture'.(this tab is a tool of zoom or tab normal..?)help me...</p>
android
[4]
286,940
286,941
custom tabbar problem in navigation
<pre><code>@interface CustomTabbarController : UITabBarController { } @end -(void)tabBarControllerView{ tabBarController.navigationController.navigationBarHidden=YES; tabBarController.delegate=self; [window addSubview:tabBarController.view]; [window makeKeyAndVisible]; } - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{ [(UINavigationController*) viewController popToRootViewControllerAnimated:NO]; return YES; } -(void)call{ [((className*)[[UIApplication sharedApplication]delegate]) tabBarControllerView]; ((className*)[[UIApplication sharedApplication]delegate]).tabBarController.view.hidden = NO; [((className*)[[UIApplication sharedApplication]delegate]).window bringSubviewToFront:((BP_LogAppDelegate*)[[UIApplication sharedApplication]delegate]).tabBarController.view]; [((className*)[[UIApplication sharedApplication]delegate]).tabBarController viewWillAppear:YES]; </code></pre>
iphone
[8]
2,159,552
2,159,553
how can i play small music file when i tuch an image in android?
<p>I am New to android, My task is to playing a small audio file when we touch an image?</p>
android
[4]
3,481,438
3,481,439
Dimen value not working like expected
<p>I'm having trouble understanding the dimen resource attribute.</p> <p>I have 3 value folders: value-normal, value-large and value-xlarge.</p> <p>I have defined the titlesize as 20 for normal, 25 for large and 30 for xlarge, this is my normal value file:</p> <pre><code>&lt;resources&gt; &lt;dimen name="titleSize"&gt;20sp&lt;/dimen&gt; &lt;/resources&gt; </code></pre> <p>But when I try to get this value</p> <pre><code>Resources r = getResources(); tvTitleSize = r.getDimension(R.dimen.titleSize); </code></pre> <p>tvTitleSize is equal to 40 which is offcourse to big. Why is the value the double of the original and how can I fix this? </p> <p>Ps: my device is galaxy nexus.</p>
android
[4]
2,331,501
2,331,502
SelectedIndex property of a drop down list
<p>In my web application I'm having a drop down list and a text box. I want to disable the text box for certain values in drop down list. I wrote the code for the selectedIndexChanged event of the drop down list. I made the AutoPostBack property of the drop down list true.</p> <p>But when I'm running the application and selecting a value from the drop down it suddenly change to the initial value. Therefore all the time I get the value 0 for the SelectedIndex. What can I do for this? </p>
asp.net
[9]
5,273,483
5,273,484
replace for loop of javascript using jQuery
<p>I wrote a sample html which retrieves the JSON from servlet and displays. But only the thing is i want to know how to iterate the returned JSON response using jQuery. Currently i'm iteratng using javascript for loop.</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="javascript/jquery-1.4.4.js"&gt;&lt;/script&gt; &lt;!-- Here we need to load the trends on page load starts --&gt; &lt;script&gt; $(document).ready(function(){ // now load the results from servlet // $("#trends").load("ReadRSSTrendsUsingServlet"); // now get the result and retrieve each entry $.getJSON("ReadRSSTrendsUsingServlet",function(data){ // alert(data.trends[2]); for(var i=0;i&lt;data.trends.length;i++) { $("#trends").append(data.trends[i]).append("&lt;br&gt;"); } }); }); &lt;/script&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt; &lt;title&gt;Insert title here&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="trends"&gt; &lt;!-- Here is the data to be loaded --&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>After that it displaying the list of JSON values. My JSON object is like below</p> <pre><code> {"trends":["test1","test2","test3","test4","test5"]} </code></pre> <p>What i want is to know the equivalent of jQuery for below steps</p> <pre><code>for(var i=0;i&lt;data.trends.length;i++) { $("#trends").append(data.trends[i]).append("&lt;br&gt;"); } </code></pre>
jquery
[5]
4,465,881
4,465,882
C++ pointers and constructors
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3040868/question-about-copy-constructor">question about copy constructor</a> </p> </blockquote> <p>if I have this snippet of the code </p> <pre><code>A a1(i); A a2 = a1; A *pa1 = new A(a2); </code></pre> <p>can somebody please explain what exactly the last line does, it makes copy of the a2 and pointer for this new object is pa1 or it just creates pointer for a2, thanks in advance</p>
c++
[6]
4,130,650
4,130,651
how to display web view in android
<p>Intent intent = new Intent(this, MainActivity.class); startActivity(intent);</p>
android
[4]
5,646,247
5,646,248
Pop up Window with jQuery
<p>I have implemented a chat solution and I will like to create a pop up window (Not Modal) that drops down from the top when the user visits the website asking them to "Chat with an Agent".</p> <p>How can I achieve this using jQuery?</p> <p>Thanks in advance.</p>
jquery
[5]
4,105,495
4,105,496
Sorting a sublist within a Python list of integers
<p>I have an unsorted list of integers in a Python list. I want to sort the elements in a subset of the full list, not the full list itself. I also want to sort the list in-place so as to not create new lists (I'm doing this very frequently). I initially tried</p> <pre><code>p[i:j].sort() </code></pre> <p>but this didn't change the contents of p presumably because a new list was formed, sorted, and then thrown away without affecting the contents of the original list. I can, of course, create my own sort function and use loops to select the appropriate elements but this doesn't feel pythonic. Is there a better way to sort sublists in place?</p>
python
[7]
5,588,090
5,588,091
How do I construct a javascript Date object from string
<p>I have the date value "06/12/2012" in string format. How do I construct a Javascript Date object, so that I can perform before/after comparisons?</p>
javascript
[3]
4,939,120
4,939,121
telerik:RadEditor ViewPaths http folder
<p>I want to set <a href="http://subdomain.supersonic2010.com/tut/images" rel="nofollow">http://subdomain.supersonic2010.com/tut/images</a> as ViewPaths of ImageManager in telerik:RadEditor IT Shows 'http://subdomain.supersonic2010.com/tut/images' is not a valid virtual path.</p> <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p> <p>Exception Details: System.Web.HttpException: 'http://get.therealstudy.com/tut/images' is not a valid virtual path.</p>
asp.net
[9]
498,377
498,378
concatenate var in loop
<p>A basic question please, I am trying this code:</p> <pre><code>var number_questions = postsJSON1[i]['question'].length; for (a=0; a&lt;number_questions; a++) { var post+[a] = postsJSON1[i]['question'][a]; } </code></pre> <p>this line give an error: <code>var post+[a]</code> </p> <p>What is the correct way ?</p>
javascript
[3]
4,581,415
4,581,416
How to generate UML diagram for classes using Java existing code?
<p>I have Java project with source code, and I want to get UML diagram for this code automatically. Are there any ways to do it? </p>
java
[1]
414,278
414,279
pass connection string to datasource of data grid that created at design time
<p>1-I have created a web page with asp.net and put a data grid on it and have config my data grid in design time.</p> <p>2-I define individual user in SQL server and define user action for each user(insert, update, delete, select),</p> <p>3-How could i create connection string at run time and passed this connection string to data grid's datasource </p>
asp.net
[9]
2,341,389
2,341,390
How can set onClickListner fo buttons..?
<p>I am new to android. I want to set OnclickListner for different buttons which are located in different xml layouts.</p>
android
[4]
3,635,331
3,635,332
Passing data between functions in PHP
<p>Let's take a simple example:</p> <pre><code>Class someClass{ function __construct($param1,$param2){ } function foo(){ } } </code></pre> <p>How do I use $param1 &amp; param2 in foo() function?</p>
php
[2]
129,206
129,207
how to append elements to the Div previous to the current element in JQuery
<p>i am having two divs ,</p> <pre><code> &lt;div id="input text"&gt; &lt;fieldset&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;div id=1&gt; &lt;/div&gt; </code></pre> <p>in my JQuery i am trying to append some elements to the Div that is previous to #1 how to do so..</p> <pre><code> $("&lt;p&gt;title&lt;/p&gt;").appendTo(previous to 1 and inside fieldset ); </code></pre> <p>since i am having many such divs i am trying to append using previous to 1 ??please suggest me...</p>
jquery
[5]
1,896,680
1,896,681
What is the significance of the return statement inside a method whose return type is void
<p>What is the significance of the return statement inside a method whose return type is void . For example see this below program (I cant paste my companys code so i pasted some sample )</p> <pre><code>public class Pavan { public static void main(String args[]) { Pavan r = new Pavan (); r.kiran(); } public void kiran() { int a = 10; if (a == 10) { return; } System.out.println("Hi I am Kiran"); } } </code></pre>
java
[1]
598,005
598,006
open source code for kids and baby learning games
<p>Does anybody know of any baby or small kids open source games? </p>
android
[4]
4,417,114
4,417,115
how to connect sqlite to an android application?
<p>I am trying to connect my android application to sqlite, i dont knw how to configure SD card in emulator to have a database... can anyone help me please?</p>
android
[4]
5,976,886
5,976,887
Javascript: Run "document.write" in createElement script failed
<p>I have a problem with <code>document.write</code>. Now, I have a page to load script dynamically. So, I use <code>document.createElement</code> to create a <code>&lt;script&gt;</code>. And in the javascript file, I use <code>document.write</code> to create a <code>dom</code> or <code>iframe</code> element. But it does not work in every browser. Why not?</p> <p>Code in homepage:</p> <pre><code>var script = document.createElement('script'); script.setAttribute('src', 'http://yoururl/test.js'); document.getElementsByTagName('head')[0].appendChild(script); </code></pre> <p>Code in script test.js:</p> <pre><code>(function(){document.write('hello');})(); </code></pre>
javascript
[3]
582,507
582,508
String To integer JavaScript
<p>I want to get the integer in this string <code>xyzabc123</code>.</p>
javascript
[3]
5,844,851
5,844,852
Can I Register more than one shutdown function in PHP?
<p>using <code>register_shutdown_function</code> I can register code to execute at the end of a PHP script execution "no matter what".</p> <p>Can I have more than one function registered?</p> <p>This question arises since I may not know if someone has already registered one when I'm about to register my own.</p> <p>Thanks.</p>
php
[2]
2,137,536
2,137,537
why the result is not my object?
<pre><code>var name = "The Window"; var object = {   name : "My Object",   getNameFunc : function(){     return function(){       return this.name;     };  } }; alert(object.getNameFunc()()); </code></pre> <p>when i tested the code. the result is The Window. but i think <code>this.name;</code> should be <code>My Object</code>. what's wrong with my thinking. </p> <p>when i add var before the <code>name : "My Object",</code> it show's an error.? why?</p>
javascript
[3]
968,552
968,553
Creating an Account with dummy authenticator
<p>I am trying to create an account in Accounts &amp; Sync which doesn't require authentication. I have already referred to <a href="http://developer.android.com/resources/samples/SampleSyncAdapter/src/com/example/android/samplesync/index.html" rel="nofollow">SampleSync</a> example. The key difference between the example and what I am trying to build is Authentication. I don't want to display an Authentication/Login activity to the user. Is it possible to create an account directly from Authenticator service without having an Authentication activity?</p>
android
[4]
4,078,210
4,078,211
Javascript finding the Maximum
<p>So i have a script with 3 scores, and I want the code to find the highest score and print a message based on which variable is the highest score. I know that <code>Math.max()</code> finds the maximum, but I want it to find the variable name that has the maximum. How do i do this?</p>
javascript
[3]
3,907,152
3,907,153
activity stack corrupted after update?
<p>Initial Activity (A) launches activity (B). When the user is on (B), presses home, and then returns to the app, (B) is shown again. If you update the app (I am updating from an email as it is not published yet) and launch it from the update screen, it will no longer remember to return to (B). It just restarts activity (A).</p> <p>If you exit the app by pressing the back button, then from there on it continues to work correctly.</p> <p>I see something like this described here: <a href="http://stackoverflow.com/q/1845460/758074">Activity history stack wrong upon first install on device?</a>. Is this a known Android bug? I am running honeycomb and ICS.</p>
android
[4]
3,535,955
3,535,956
How can I draw a line between two points in Google map in Android?
<p>I am new to Android. I want to draw a line from one location to another in my application. How can I draw a line between two points in Android? Please help me.</p>
android
[4]
776,475
776,476
How to get name of calling function/method in PHP?
<p>I am aware of function <code>debug_backtrace</code>, but I am looking for some ready to use implementation of function like <code>GetCallingMethodName()</code>? It would be perfect if it gave method's class too (if it is indeed a method).</p> <p>I hope it (not doing it myself) want be taken as normal laziness, but as good programming laziness.</p> <p><strong>EDIT:</strong> Here is the answer: <a href="http://stackoverflow.com/questions/190421/caller-function-in-php-5/190426#190426">http://stackoverflow.com/questions/190421/caller-function-in-php-5/190426#190426</a></p>
php
[2]
3,865,247
3,865,248
BMI calculations
<p>The formula for calculating body mass index is weight * 703 / height². Create a web page that contains three text boxes: weight in pounds, height in inches, and one that will contain the BMI result. Create a script with a function named calcBMI() that performs the calculation using the values in the weight and height text boxes and assign the result of the BMI text box. Convert the result to an integer by using the parseInt() function. Reference the text boxex from within the function by using the document object, form name, and name and value attributes of each text box (don’t use function arguments). Perform the calculation by calling the function from onclick event in a button element.</p> <p>This what I could come up with:</p> <pre><code>&lt;html&gt;&lt;head&gt; &lt;title&gt;...&lt;/title&gt; &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8" /&gt; &lt;script type="text/javascript"&gt; /*&lt;CDATA[[*/ function calcBMI(){ var weight, height, total; document.form.height.value = weight * 703; document.form.weight.value = (height * height); var total = weight / height; document.form.result.value = total; } /*]]&gt;*/ &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="form"&gt; Weight: &lt;input type="text" name="weight" /&gt;&lt;br /&gt; Height: &lt;input type="text" name="height" /&gt;&lt;br /&gt; Result: &lt;input type="text" name="result" /&gt;&lt;br /&gt; &lt;input type="button" value="BMI Result!" onclick="calcBMI()" /&gt; &lt;/form&gt; </code></pre>
javascript
[3]
5,431,637
5,431,638
Android: how to run video from resource folder
<p>I have already seen the other questions similar to mine, but the problem persists. Thanks in advance.</p> <p>Here's the code </p> <pre><code>package com.akk.mysecondvideo; import android.app.Activity; import android.content.Context; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.widget.VideoView; public class MySecondVideo extends Activity { Context context; MediaPlayer mp; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); VideoView videoView = (VideoView)findViewById(R.id.VideoView); //MediaController mediaController = new MediaController(this); // mediaController.setAnchorView(videoView); //videoView.setMediaController(mediaController); Uri uri = Uri.parse("android.resource://com.akk.mysecondvideo/" + R.raw.bommarillu); videoView.setVideoURI(uri); //mp = new MediaPlayer(); //mp = MediaPlayer.create(context, R.raw.bommarillu); videoView.start(); } } </code></pre> <p>It shows a force close when i try to run it, and the logcat shows error <code>NULLPOINTEREXCEPTION</code> in line 28 which is <code>videoView.setVideoURI(uri);</code></p> <p>VideoView is part of main.xml. The main.xml file:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;VideoView android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/VideoView" /&gt; &lt;/LinearLayout&gt; </code></pre>
android
[4]
4,116,007
4,116,008
How to flick through a deck of cards?
<p>I'm making an iPhone cards game where each use has a deck of cards, I'd like to give the user the option to drag his finger through the cards and each card get's highlighted while his finger is on it. This effect is already done in Uno for iPhone. My cards are put into UIButton, what i tried to do is to set a small image to the button in normal state and a bigger image in the highlighted state, it did achieve the effect i was looking for but, the user has to highlight each card individually to be able to see the bigger picture.</p> <p>Here is the code i used to set the normal and highlighted state of the UIButton:</p> <pre><code>//player413 is an IBOutlet to a UIButton, and img,imgHigh are UIImages [player413 setImage:img forState:UIControlStateNormal] ; [player413 setImage:imgHigh forState:UIControlStateHighlighted] ; </code></pre> <p>Any guidelines ?</p>
iphone
[8]
870,558
870,559
I want to call a webservice when the application will uninstall. Is it possible with Android?
<p><em>Basically i want to perform some database interaction at the time of uninstall</em></p>
android
[4]
5,926,529
5,926,530
Is there an Android Spotify developers API?
<p>I was looking into building an android app that utilizes the Spotify API but when i looked on this page it doesn't list an android API? is there one out there somewhere? if not are there any other streaming music services that have API's for android?</p> <p><a href="http://developer.spotify.com/en/libspotify/overview/" rel="nofollow">http://developer.spotify.com/en/libspotify/overview/</a></p>
android
[4]
4,521,591
4,521,592
Subtracting known chars or last 7 chars from form attribute using jquery
<p>example</p> <pre><code>&lt;form id='A_forward' name='A_forward' action='/some_url.php' method='POST'&gt; &lt;/form&gt; </code></pre> <p>How can I using jquery get name of this form, subtract <code>'forward'</code> chars and alert <code>'A_'</code> ?</p>
jquery
[5]
5,330,186
5,330,187
Mouseover during scroll
<p>This fiddle doesn't detect the mouseover on a span if during the scroll the mouse pass over the span : <a href="http://jsfiddle.net/S7tnB/" rel="nofollow">http://jsfiddle.net/S7tnB/</a><br> How can I detect it?<br> I test on firefox 12, on a OSX lion.</p> <p><strong>EDIT :</strong> I thought of something that could work : <code>onscroll</code>, we test if the position of the cursor is in the area of the span! But I had another problem, <code>e.pageX</code> don't work when I write <code>onscroll=theFunction(event)</code>. If you solve this, it is like you solve the main problem.</p>
javascript
[3]
4,380,273
4,380,274
Can't understand why JavaScript void function is used
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/666936/what-is-the-point-of-void-in-javascript">what is the point of void in javascript</a> </p> </blockquote> <p>At many places I have seen <em>Javascript Void</em>, but I am still not able to understand why this one is used. I am able to do complex javascript coding but not clear about this particular function.</p>
javascript
[3]
1,540,875
1,540,876
Jquery and iFrame update
<p>I want to create a page that has a dropdown and an iframe, so that the iframe location will change based on the url in the dropdown. What is the correct syntax to get jquery to update the iframe's url?</p> <p>thanks</p>
jquery
[5]
1,501,164
1,501,165
How to Capture and Set a Webpage as Live WallPapaer within Wallpaper Service And Engine
<p>I want to capture a web page from any website like "www.google.com" and then i want to convert that web page in a bitmap image and then set that bitmap image like "google.jpeg" as live wallpaper.. please help me..</p> <p>i have tried to get input stream of a web page and then i want to convert it in bitmap and save in sdcard or if it will directly convert in bitmap then it is the best..</p> <p>my code is</p> <pre><code>public Bitmap getRemoteDataMain(URL aURL) { try { URLConnection connection = aURL.openConnection(); connection.connect(); BufferedInputStream bis = new BufferedInputStream(connection.getInputStream()); Bitmap bm = Bitmap.createBitmap( 200,200, Bitmap.Config.ARGB_8888); ByteArrayBuffer baf = new ByteArrayBuffer(bis.available()); int current = 0; while ((current = bis.read()) != -1) { baf.append((byte) current); Log.v("3 BAF " + baf ,"BAF"); } FileOutputStream fos = new FileOutputStream("/sdcard/image.jpeg"); fos.write(baf.toByteArray()); bm.compress(Bitmap.CompressFormat.JPEG, 90, fos ); bm = BitmapFactory.decodeStream(bis); bis.close(); return bm; } catch (IOException e) { return null; } } </code></pre>
android
[4]
1,899,460
1,899,461
how to make my win app in windows taskbar's notification area
<p>I've created one win app that exe file run successfully but now i want to make it all time active when windows start up and i want to display it in windows task bar' notification area. how could iachive this thing Pls. suggest me...</p>
c#
[0]
1,783,810
1,783,811
Editable div not working on firefox
<p>Hi i am using an dynamic div which is editable for input text. its working fine on IE but not on firefox. I need to show html content in div. can we make div editable for firefox also?</p>
jquery
[5]
5,624,672
5,624,673
How to implement this UI
<p>Just curious if the tab bar UI element in screenshots is some built in class or customized. If it is customized, then please give me a hint on what classes I might check to have something like that.</p> <p>The first screenshot is initial tab bar. When I tap on the last icon the tab bar smoothly(animated) resize itself as on second screenshot. If I press the edit button the icons are shaking(as on iPhone home) and I'm able to arrange them.</p> <p>first</p> <p><img src="http://img686.imageshack.us/img686/3899/photo2aw.jpg" alt="tab bar"></p> <p>second</p> <p><img src="http://img38.imageshack.us/img38/5673/photo3kq.jpg" alt="more buttons"></p>
iphone
[8]
731,886
731,887
slidedown jquery problem
<pre> function show_destination(country_id,airport_id){ $.ajax({ type: "POST", url: "function.php", data: "country_id="+country_id+"&airport_id="+airport_id+"&action=destination", beforeSend: function() { $("#loader_destination").html(''); }, success: function(msg){ // $(".loader_destination").empty(); //$("#destination_div").html(msg); //$("#destination_div").slideDown("slow",function(){$("#destination_div").html(msg);}) //$("#destination_div").html(msg,function(){$("#destination_div").slideDown("slow");}); $('#destination_div').slideDown(500, function() { $('#destination_div').html(msg);}); } }); } </pre> <p>slideDown this effect not working , output simply display , am not find any effect on display output, </p>
jquery
[5]
3,399,980
3,399,981
Mail function problem in PHP
<p>I am having trouble sending emails with PHP. Can you see any problems in my code?</p> <p>php.ini mail settings:</p> <pre><code>[mail function] SMTP = mail.ntserv.co.in smtp_port = 26 </code></pre> <p>Code:</p> <pre><code>&lt;?php $to = "vijay@gmail.com"; $subject = "Test mail"; $message = "hi, How r u"; $from = "vijay@ntserv.co.in"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?&gt; </code></pre> <p>Output:</p> <blockquote> <p>Warning: mail() [function.mail]: SMTP server response: 551 This mail server requires authentication before sending mail from a locally hosted domain. Please reconfigure your mail client to authenticate before sending mail. in C:\xampp\htdocs\vijay\demo\msg.php on line 7 Mail Sent.</p> </blockquote>
php
[2]
4,305,104
4,305,105
Android:: Calling methods form Broadcasr Receiver class?
<p>I have an SMSreceiver class, I am new to android, now my question is that is it possible to call any methods in other class from that class. Basically what I am trying to do is to add each received message to the linked list of strings. Here is my code...</p> <pre><code>public class SMSReceiver extends BroadcastReceiver { /** * @see android.content.BroadcastReceiver#onReceive(android.content.Context, android.content.Intent) */ static List&lt;String&gt; recNumList = new LinkedList&lt;String&gt;(); static String message; static Integer count = 0; static String phoneNum; static String newMessage = null; List&lt;String&gt; recMsgs; public void onReceive(Context context, Intent intent) { Bundle bundle = intent.getExtras(); Object messages[] = (Object[]) bundle.get("pdus"); SmsMessage smsMessage[] = new SmsMessage[messages.length]; for (int n = 0; n &lt; messages.length; n++) { smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]); } phoneNum = smsMessage[0].getDisplayOriginatingAddress(); message = smsMessage[0].getMessageBody() + "\n" + "Time Stamp:" + smsMessage[0].getTimestampMillis(); recMsgs.add(message); } } </code></pre> <p>But the application force closes and does not add anything. Can someone help me please?</p>
android
[4]
1,516,768
1,516,769
C++ -- Get internal pointer to a vector
<p>I use the following method to get an allocated memory space without worrying about how to reclaim the allocated resource.</p> <pre><code>#include &lt;vector&gt; using namespace std; int _tmain(int argc, _TCHAR* argv[]) { vector&lt;int&gt; vecInts; for(int iInd=0; iInd&lt;10; i++) vecInts.push_back(iInd); int* pInt = &amp;vecInts[0]; // Is this a good method? // now can I use pInt to modify the value of the vecInts? // I will NOT resize the vector and just simply manipulate the values inside return 0; } </code></pre> <p>However, I am not sure whether such a method is a good one or not.</p> <p>Thank you</p>
c++
[6]
1,375,378
1,375,379
Refresh page when url hash is present
<p>I have a navigation system on my site that uses javascript to slide horizontally stacked divs left and right into view. I'm trying to make the site function better with javascript turned off, so I have a second navigation system that uses hash values to 'go to' the appropriate section. <br /><br /> The problem arises if someone is on say <a href="http://mysite.com/#page2" rel="nofollow">http://mysite.com/#page2</a> then turns javascript on. The page reloads at the #page2 section which then causes the javascript enabled navigation system to not work correctly. e.g. it reloads thinking the page is at section 1 when it is actually displaying section #whatever.<br /><br /> I have tried adding parent.location.hash = ''; but when the page reloads, it still stays on whichever section it was on.<br /><br /> Any ideas on how to make the page fully refresh when javascript gets turned on?</p>
javascript
[3]
347,933
347,934
Best way to convert query string to dictionary in C#
<p>I'm looking for the simplest way of converting a query string from an HTTP GET request into a Dictionary, and back again.</p> <p>I figure it's easier to carry out various manipulations on the query once it is in dictionary form, but I seem to have a lot of code just to do the conversion. Any recommended ways?</p>
c#
[0]
1,778,690
1,778,691
Remove only the input elements in the List in JQuery
<p>I am having a list like</p> <pre><code> &lt;li style="display: list-item;" id="listChoices"&gt; &lt;label class="topspace"&gt;Enter the Choices&lt;/label&gt; &lt;input value="Choice1" maxlength="150" id="Choice1"/&gt; &lt;input value="Choice2" maxlength="150" id="Choice2"/&gt; &lt;input value="Choice3" maxlength="150" id="Choice3"/&gt; &lt;/li&gt; </code></pre> <p>I want to delete the input tag alone so i tried it with </p> <p>$("#listChoices").empty(); // which removes the entire content of the list . But i want to remove only the input elements so i tried it with </p> <pre><code> $("#listChoices input").empty();//But its not working..Why so??? </code></pre>
jquery
[5]
467,449
467,450
Getting name attribute of an object
<p>I set up a function that gets the name attribute of an object and runs a function. The name of the object is set up as a variable but it's not working when I called it. What am I missing?</p> <p><a href="http://jsfiddle.net/rexonms/wPUhK/1/" rel="nofollow">http://jsfiddle.net/rexonms/wPUhK/1/</a></p>
jquery
[5]
4,093,665
4,093,666
Concept name required
<p>I can't remember the name of this concept.</p> <pre><code> public interface MainInterface { public void method1(); public void method2(); } void testMethod() { methodMain(new MainInterface() { @Override public void method1() { System.out.println("This is method1"); } @Override public void method2() { System.out.println("This is method2"); } }); } void methodMain(MainInterface mi) { mi.method1(); mi.method2(); } </code></pre> <ul> <li>I create the instance of MainInterface without giving the name of object</li> <li>I implement the interface methods</li> <li>Then pass the instance with unknown name to methodMain.</li> </ul> <p>What is this concept and how exactly it works?</p>
java
[1]
5,788,973
5,788,974
XObjects in Java?
<p>I am receiving a library and there are quite a lot of Xobjects missing, for example:</p> <pre><code>XStep XApplication XMapping </code></pre> <p>Is anyone familiar with these classes? from which library?</p> <p>Thanks in advance.</p>
java
[1]
3,047,431
3,047,432
How to Detect Touch event in UIWebview
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/990870/handling-touches-inside-uiwebview">Handling touches inside UIWebview</a> </p> </blockquote> <p>How to Detect Touch event in UIWebview? i am not able to handle touch event in UIWebview.</p> <p>Thankyou</p>
iphone
[8]