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,428,339
2,428,340
iPhone SDK: How to dismiss keyboard each time user moves to new field
<p>We want the keyboard to be dismissed each time the user moves to a new field. What event would be appropriate to place a resignFirstResponder call?</p> <p>Thanks.</p>
iphone
[8]
3,285,927
3,285,928
Can we create a Javascript confirm box with custom div and message .
<p>I need a javascript confirm box with customized design and dynamic message. My problem is, i need a function to call this popup show .but in that call how can i receive the result of that popup; ( like yes or no). Is that possible? </p>
javascript
[3]
4,376,720
4,376,721
How to access a key in a stdclass
<p>I have this situation:</p> <pre><code>object(stdClass)#203 (1) { ["1"]=&gt; object(stdClass)#212 (7) { ["user_id"]=&gt; int(1) ["type"]=&gt; string(6) "Device" ["name_first"]=&gt; string(0) "" ["name_last"]=&gt; string(0) "" ["name_display"]=&gt; string(0) "" ["gender"]=&gt; string(11) "Unspecified" ["birthday"]=&gt; string(0) "" } } </code></pre> <p>I want to access either "user_id" or the ["1"], but this is of type stdclass so I can't treat it like an array. (Note: this is from <code>json_decode</code>)</p>
php
[2]
2,769,044
2,769,045
Update DataSet, How?
<p>I have DataSet that I fill like this:</p> <pre><code> dsView = new DataSet(); adp = new OleDbDataAdapter("select * from Worki", Conn); adp.Fill(dsView, "Worki"); this.dataGridView1.DataSource = dsView.Tables["Worki"].DefaultView; </code></pre> <p>If I change any cell in the Datagrid, How I can update the DataBase too ?</p> <p>thank's in advance</p>
c#
[0]
5,874,065
5,874,066
success functions refresh div on parent page
<p>I have parent.php which calls child.php through <code>$('#child').load('child.php?id='+id)</code>. On the child.php page I have an onclick event which does some stuff (mysql etc..), with a success function. Back on parent.php I also call anotherchild.php through a similar #div.load().</p> <p>I would like the anotherchild.php to refresh within its div with the child.php success function.</p> <p>Is this possible?</p>
jquery
[5]
3,163,932
3,163,933
PHP Don't run code on refresh
<p>So I have this page that can only be seen by a user 5 times. And I made this code that goes into the database and it adds 1 to the AccessCount field everytime the user logs in. What I want to do is that if the user refreshes his web browser, have the code that records the AccessCount NOT run.</p> <p>How can I do this? Thanks!</p>
php
[2]
911,141
911,142
question regarding GUI in java
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5918935/question-regarding-gui-in-java">question regarding GUI in java</a> </p> </blockquote> <p>how to input string in JTextfield in java</p>
java
[1]
5,603,951
5,603,952
Remove words from string that have a prefix of # or @?
<p>I have a block of text like this:</p> <pre><code>Hello @Simon, I had a great day today. #StackOverflow </code></pre> <p>I want to find the most elegant solution to stripping it down to look like this:</p> <pre><code>Hello, I had a great day today. </code></pre> <p>i.e. I want to strip out all words that have a prefix of # and @. (And yes, im inspecting tweets)</p> <p>I am new to python, and I would be ok doing this on single words, but not sure on the best way to achieve this on a string that contains multiple words.</p> <p>My first thoughts would be to use replace, but that would just strip out the actual @ and # symbols. <strong>Looking for the best way to strip out any word that has a prefix of # or @.</strong></p> <p>-EDIT- Not sure if it this invalidates the answers give, but for acceptance, I also need to strip out where multiple words contain a prefix of # or $. e.g. hello #hiya #ello</p>
python
[7]
5,950,992
5,950,993
Maximum Width of a Printed Double in C++
<p>I was wondering, how long in number of characters would the longest a double printed using fprintf be? My guess is wrong.</p> <p>Thanks in advance.</p>
c++
[6]
4,040,287
4,040,288
how to change the AlertDialogue box title back color in Android?
<p>im new to android development i want to change the title backcolor of alerdialogue box in android which is by default is black ,kindly tell how to change this any help in this regards is greatly appreciated thanks in advance.</p>
android
[4]
530,845
530,846
convert string to predefined 2D array
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8785815/convert-string-to-2d-array-using-php">convert string to 2D array using php</a> </p> </blockquote> <p>I have the string like the following:</p> <pre><code>01,03,02,15|05,04,06,10|07,09,08,11|12,14,13,16 </code></pre> <p>how can I convert the above string to a defined array like the one below:</p> <pre><code>$a[0] = array('column' =&gt; array("row1" =&gt; "01", "row2"=&gt; "05", "row3" =&gt; "07", "row4" =&gt;"12")); $a[1] = array('column' =&gt; array("row1" =&gt; "03", "row2"=&gt; "04", "row3" =&gt; "09", "row4" =&gt;"14")); $a[2] = array('column' =&gt; array("row1" =&gt; "02", "row2"=&gt; "06", "row3" =&gt; "08", "row4" =&gt;"13")); $a[3] = array('column' =&gt; array("row1" =&gt; "15", "row2"=&gt; "10", "row3" =&gt; "11", "row4" =&gt;"16")); </code></pre> <p>I know I should use explode function but not sure how exactly it should be implemented for this, any help would be greatly appreciated, thanks!</p>
php
[2]
3,057,632
3,057,633
PHP 5.3 pass function by reference
<p>Is it possible to pass functions by reference?</p> <p>Something like this:</p> <pre><code>function call($func){ $func(); } function test(){ echo "hello world!"; } call(test); </code></pre> <p>I know that you could do <code>'test'</code>, but I don't really want that, as I need to pass the function by reference.</p> <p>Is the only way to do so via anonymous functions?</p> <p>Clarification: If you recall from C++, you could pass a function via pointers:</p> <pre><code>void call(void (*func)(void)){ func(); } </code></pre> <p>Or in Python:</p> <pre><code>def call(func): func() </code></pre> <p>That's what i'm trying to accomplish. </p>
php
[2]
5,463,119
5,463,120
invoke javascript
<p>I need to retrieve a value from the javascript below in my html code and inject this value into a webbrowser. how can I format and invoke this script ?</p> <pre><code>$(function() { jQuery.liveviewWithTable( { enableCountsTable:false, enableCountTable:true, countTableElement:$("#count"), directionIn:$.getParam("Counter.DirectionIn"), liveSumUrl:"/local/people-counter/.api?live-sum.json", loadingAnimationUrl:"/people-counter/images/ajax-loader.gif", dataTypes:["in","out"] }) }); </code></pre> <p>Thanks alot</p>
javascript
[3]
3,082,431
3,082,432
Position cursor at the end of the email content to be sent using Intent.ACTION_SEND
<blockquote> <p>I am using the following code to send an email from my app.The cursor points to the beginning of the "Please look into this issue". Is there any way to position the pointer at the end of the Text content? Thanks in advance.</p> </blockquote> <pre><code> intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"abc@gmail.com"}); intent.putExtra(Intent.EXTRA_SUBJECT, "Hi"); intent.putExtra(Intent.EXTRA_TEXT, "Please look into this issue:"); startActivity(intent); </code></pre>
android
[4]
5,356,842
5,356,843
Incorrect image dimensions in android when using Bitmap
<p>I have.png image file stored as a resource in my android application. In my code, i am allocationg new Bitmap instance from that image as follow:</p> <pre><code>Bitmap img = BitmapFactory.decodeResource(getResources(), R.drawable.imgName); </code></pre> <p>But when I read the image dimensions from the Bitmap object using getWight() and getHeight() methods, </p> <pre><code>int width = img.getWidth(); int height = img.getHeight(); </code></pre> <p>I am getting different results from the original image... Can some one explain me what am I missing, and how can I retreive the image size?</p> <p>(My project is complied with android 2.2 - API 8)</p> <p>Edit: Ok - found out how to get the real dimensions: setting <code>inJustDecodeBounds</code> property of the <code>BitmapFactory.Options</code> class to true as follow:</p> <pre><code>BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeResource(getResources(), R.drawable.imgName, options); width = options.outWidth; height = options.outHeight; </code></pre> <p>The problem now is that the decoder returns null when we send <code>Options</code> argument, so I need to decode again like I did before (without <code>Options</code> argument...) to retrieve <code>Bitmap</code> instance -bizarre, isnt it?</p>
android
[4]
748,936
748,937
Singleton implementation question
<p>Is it better to rely on IOC Framework to implemented singleton? I heard that either double checked locking or relying on static constructor are not good practice, is this true?</p>
c#
[0]
1,807,122
1,807,123
how to get last inserted date in php MYSQL
<p>I have two tables, and I want to get the last enterd date.</p> <p>The first table is <code>seeker</code>:</p> <pre><code>seeker_nic-----username 111-------------ali 222-------------umer 333-------------raza </code></pre> <p>The second one is <code>requestblood</code>:</p> <pre><code>id-------seeker_nic-----requireddate 1------- 111 ----------2012/10/9 2 ------- 222-----------2012/5/8 3 ------ 111-----------2012/12/12 4 ------- 111-----------2012/11/12 5---------111-----------2012/09/09 6 ------- 222-----------2012/7/9 7 ------- 333 ----------2012/4/4 </code></pre> <p>Now, I want to list the users one time with their last inserted date like..</p> <pre><code>s.no---- username----- requireddate 1------- ali---------- 2012/09/09 2------- umer--------- 2012/7/9 3------- raza--------- 2012/4/4 </code></pre> <p>I am using this query, but it shows maximum date not the latest one.</p> <pre><code>SELECT seeker.username, MAX(bloodrequest.requireddate) AS requireddate, COUNT(bloodrequest.requireddate) AS total FROM seeker JOIN bloodrequest ON seeker.seeker_nic = bloodrequest.seeker_nic GROUP BY seeker.username </code></pre> <p>This shows the maximum date, and it shows total dates. For example, 111 has total "4", but I don't know how to show the last inserted date... I am new in PHP, please help me. :(</p> <p>Thanks in advance!</p>
php
[2]
4,105,444
4,105,445
jQuery Replace One Div with Another
<p>I need to replace one div with another and also i need another container to be removed. Please, see my code:</p> <pre><code>&lt;a id="load-more" href="#"&gt; &lt;div class="text"&gt;Load more&lt;/div&gt; &lt;div id="infscr-loading"&gt; &lt;img alt="Loading..." src="../loading_small.gif" style="display: none; "&gt; &lt;div"&gt;No more posts to load&lt;/div&gt; &lt;/div&gt; &lt;/a&gt; </code></pre> <p>I need this:</p> <pre><code>&lt;span class="text"&gt;Load more&lt;/span&gt; </code></pre> <p>replace with this:</p> <pre><code>&lt;div"&gt;No more posts to load&lt;/div&gt; </code></pre> <p>So, my result should be:</p> <pre><code>&lt;a id="load-more" href="#"&gt; &lt;div"&gt;No more posts to load&lt;/div&gt; &lt;div id="infscr-loading"&gt; &lt;img alt="Loading..." src="../loading_small.gif" style="display: none; "&gt; &lt;/div&gt; &lt;/a&gt; </code></pre> <p>It's possible to do?</p>
jquery
[5]
3,295,340
3,295,341
Get anchor inside td
<p>I use only JavaScript.</p> <p>I have the following code inside a function:</p> <pre><code> siblings=getSiblings(obj); for(var i=0;i&lt;siblings.length;i++) { if(siblings[i].getAttribute('f')=='ytw') { ytw=siblings[i].innerHTML; alert(ytw); } else if(siblings[i].getAttribute('f')=='ol') { orderId=siblings[i].innerHTML alert(orderId); } } </code></pre> <p><code>siblings[i].innerHTML</code> returns either an input tag with some VALUE or an anchor tag with some VALUE.</p> <p>I want to get this value in either case.</p>
javascript
[3]
4,672,628
4,672,629
How to get data from MySQL database and list in the ListView
<p>I've seen numerous questions/tutorials about this, but all of them either use some kind of premade database or work with JSON.</p> <p>I already created a database and a table with simlpe data that resides on my <code>MySQL</code> server, which is running separately as a service on my development machine.</p> <p>I want to pull the data from that table and list it in the ListView(MainActivity) of my Andoird app when it's launched(onCreate).</p> <p>At the moment I'm using a premade list of car names.</p> <p><strong>Cars table</strong>(in mydb database)</p> <p><code>id</code>, <code>name</code>, <code>model</code>, <code>year</code>, <code>vin</code>, <code>km</code>, <code>price</code></p> <p><strong>MainActivity.java</strong></p> <pre><code>package com.example.myfirstproject; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.ListAdapter; import android.widget.ListView; public class MainActivity extends Activity implements OnItemClickListener { protected String[] cars = {"BMW", "Audi", "VW", "Ford", "Subaru"}; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ListAdapter adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, cars); ListView carsList = (ListView) findViewById(R.id.listCars); carsList.setAdapter(adapter); ListView list = (ListView) findViewById(R.id.listCars); list.setOnItemClickListener(this); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) { Intent intent = new Intent(this, DetailsActivity.class); startActivity(intent); } } </code></pre>
android
[4]
5,698,102
5,698,103
Is it possible to add objects or data members to category in objective C?
<p>we know that using category we can add functions to existing class. But i have a doubt that, Is it possible to add objects or data members to category in objective C ??</p>
iphone
[8]
1,865,763
1,865,764
Is there a regular expression to check for correct PHP date format entry?
<p>I have an input box that lets users enter a date format in PHP date format, for example: M j, Y</p> <p>I want to verify on submit that the user actually enters a date that's in PHP date format. I already have the validation script ready, I just need a regular expression or some sort of way to check that the user actually entered a valid PHP date notation. </p> <p>Is this even possible? </p> <p>Thanks for any insights!</p>
php
[2]
3,842,478
3,842,479
Datagrid view to fill based on columns
<p>Below is my Datagridview code to get the data from employee table.</p> <p>the problem am facing is ,my employee table have 10 columns (ID,emplNo,Dob,JoingData...etc)</p> <p>i just want to fill my grid with only ID,EmplyNo and DOB.</p> <p>but the below code get everything,please advise me what i suppose to do to get only particular column</p> <pre><code> string sql = "select * from Employee"; SqlConnection connection = new SqlConnection(CONNECTION_STRING); //SqlDataAdapter dataadapter = new SqlDataAdapter(sql, connection); dataadapter = new SqlDataAdapter(sql, connection); // DataSet ds = new DataSet(); ds = new DataSet(); connection.Open(); dataadapter.Fill(ds, scrollVal, 5, "Employee"); connection.Close(); dgMessages.DataSource = ds; dgMessages.DataMember = "tEmployee"; </code></pre>
c#
[0]
4,389,432
4,389,433
Creating PHP class instance with a string
<p>I have two classes:</p> <p>class <code>ClassOne { }</code> and class <code>ClassTwo {}</code> . I am getting a string which can be either "One" or "Two". Instead of using a long switch statement such as:</p> <pre><code>switch($str) { case "One": return new ClassOne(); case "Two": return new ClassTwo(); } </code></pre> <p>Is there anyway way I can create an instance using a string, i.e. <code>new Class("Class" . $str);</code></p> <p>Thanks,</p> <p>Joel</p>
php
[2]
5,418,680
5,418,681
How to add an advert pic of your app on android market
<p>Added an image from android market. I would like to know how can we get that image in market. <img src="http://i.stack.imgur.com/cPgFc.png" alt="enter image description here"></p>
android
[4]
1,086,348
1,086,349
How do I create these nested dom elements with jquery?
<p>Given these javascript variables:</p> <pre><code>var div_id = "my_div"; var h1_class = "my_header"; var a_class = "my_a_class"; var a_string = "teststring"; </code></pre> <p>and this page element:</p> <pre><code>&lt;div id="container"&gt;&lt;/div&gt; </code></pre> <p>I want to build this html structure with jQuery:</p> <pre><code>&lt;div id="container"&gt; &lt;div id="my_div"&gt; &lt;h1 class="my_header"&gt; &lt;a href="/test/" class="my_a_class"&gt;teststring&lt;/a&gt; &lt;/h1&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>What is the best and most readable way to chain the commands here?</p>
jquery
[5]
2,845,246
2,845,247
Android as an Appliance
<p>I am new to Android and I am trying to use a Android tablet to create an appliance. See this link as a reference. <a href="http://www.youtube.com/watch?v=ouP-CgLfANw" rel="nofollow">http://www.youtube.com/watch?v=ouP-CgLfANw</a> . I don't want to user </p> <p>Is this possible by just modifying the boot process and using a Samsung Galaxy tablet?</p> <p>Thanks, in advance.</p>
android
[4]
1,654,328
1,654,329
passing value into a different class
<p>I have an array of data called msg.data[2] where i have used pubsub i now want to pass this data into the PlotCanvasExample Class</p> <p>Here is where i call the class</p> <pre><code>self.pubsubText.SetLabel("This is the Contact Map for the chain "+msg.data[0]+" in the PDB file "+msg.data[1]) frame = self.GetParent() sizer = wx.BoxSizer(wx.VERTICAL) self.canvas = PlotCanvasExample(self,0, size=(100,100)) sizer.Add(self.canvas,1,wx.EXPAND,0) </code></pre> <p>Here is the class itself</p> <pre><code>class PlotCanvasExample(plot.PlotCanvas): def __init__(self,parent,id,size): plot.PlotCanvas.__init__(self,parent,id,style=wx.BORDER_NONE, size=(300,200)) self.data = [(1,2),(23,2)] line = plot.PolyMarker(self.data) gc = plot.PlotGraphics([line],"CM view", "x-axis","y axis") self.Draw(gc, xAxis=(0,50), yAxis=(0,50)) </code></pre> <p>How can i pass in the variable msg.data into this class</p> <p>I am new to python so an explanation of how to do it would be nice so i can understand how to do it next time</p>
python
[7]
4,739,535
4,739,536
How to get any identifier of the topmost activity?
<p>I have a service and its behavior must change when topmost Activity changes. Say, Activity A is active and then service starts some kind of processing. This processing must stop when Activity A is no longer visible: user pressed "Back", "Home" or did anything else that makes Activity A invisible. This Activity A must not be aware of the service -- i.e. it must not have to explicitly inform the Service that it is going away.</p> <p>In the nutshell, is there a way to:</p> <ul> <li>Get any kind of identification (object reference, class name, ID, etc.) of the topmost Activity,</li> <li>Receive notification when topmost Activity changes?</li> </ul> <p>P.S. This may sound like malware behavior, but it is not! It is legitimate use-case!</p> <p>Edit: Activities are not in my application. They can be just about anything -- browser, maps app, settings, etc.</p>
android
[4]
1,690,580
1,690,581
Android: How to Clear Intent Stack While Using SingleTask
<p>I'm using Twitter <code>oAuth</code> library in my application. Users are logging in with ther Twitter accounts. </p> <p>In activity A, twitter login is available. When user logged in, I want to start activity B with no history. Here is my all stuff:</p> <p>Firstly, <code>Manifest.xml</code>, so I set <code>launchMode=singleTask</code> as Twitter api requested:</p> <pre><code>&lt;activity android:name=".A_Activity" android:label="@string/app_name" android:launchMode="singleTask" android:theme="@android:style/Theme.Black.NoTitleBar"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.VIEW" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;category android:name="android.intent.category.BROWSABLE" /&gt; &lt;data android:scheme="my_twitter_scheme" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>Here is how I'm starting activity B:</p> <pre><code>Intent i = new Intent(A.this, B.class); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); </code></pre> <p>Note: I'm calling activity B over BroadcastReceiver instance.</p> <p>When I logged in, my receivers starting activity B properly, but unfortunately when I pressed the back button, application turning back to activity A. </p> <p>I suppose it's about <code>launchMode</code> and as I said, Twitter needs that option. What am I doing wrong? Any help or suggestion (maybe about Twitter) would be great.</p>
android
[4]
941,692
941,693
To use MSMQ or WCF - VS 2008
<p>This is my situation: 1. have an existing application which relies on XML being fed via FTP. Based on the XML, the application performs tasks.</p> <ol> <li><p>Now i want to download files, path being an element of the XML file, using BITS</p></li> <li><p>I want to create a BITS application and that should work on the download aspect of the project when application in step 1 fires a message to the BITS application.</p></li> </ol> <p>Application in step 1 is in VS-2003 and one version is in VS-2005. I want to create my BITS application in VS-2008, and if I cant use BITS then I would use curlHTTP to do a HTTP GET. The ? is do I use MSQM or WCF to send a message between application in step 1 and my download application?</p>
c#
[0]
1,646,405
1,646,406
how to set a title for spinner which is not selectable..?
<p>I have <code>spinner</code> but in it only selectable items are shown as default title.. </p> <p>is there any way i can set title which doesn't appear when spinner unfolds...</p>
android
[4]
2,674,539
2,674,540
File operation in android
<p>I am new to android platform. I need to create a text file in android. Please let me know how to perform this task in android. I have written a code that is working fine in java but not in android. Please help me on this....the sample code that ihave written is :-</p> <p>try { DataOutputStream dos = new DataOutputStream(new FileOutputStream("test.txt", true)); dos.writeBytes(dataLine); dos.close(); } catch (FileNotFoundException ex) {}</p> <p>the above code snippet is working fine in java but not in android :(</p> <p>Thanks, Ashish </p>
android
[4]
5,245,703
5,245,704
Android AccountManager
<p>Can some one help me with step by step approach to use the AccountManager in android along with a minimalistic example for better understanding?</p>
android
[4]
4,434,515
4,434,516
sftp java client
<p>I am able to connect to server2 via sftp at server1 using public key . But I am facing "Auth fail" error while connecting server 2 from server1 via java code</p> <p>public key is already setup at both servers</p> <p>Can you let me know where I am wrong?</p> <pre><code>ChannelSftp channelsftp = null; Session session = null ; Map&lt;String,String&gt; envMap = getEnvMap(); OutputStream outFile = null ; BufferedInputStream in = null ; File file = new File(fileName); try { String host = "server.net"; String user = "test"; String key = "id_dsa"; JSch jsch = new JSch(); try { jsch.addIdentity(new File(key).getAbsolutePath()); session = jsch.getSession(user, host,22); Properties properties = new Properties(); properties.put("StrictHostKeyChecking", "no"); properties.put("PreferredAuthentications", "publickey"); session.setConfig(properties); System.out.println("before making Connection:"+session); session.connect(); System.out.println("Connection successful"); Channel channel = session.openChannel("sftp"); channel.connect(); channelsftp = (ChannelSftp)channel; }catch(Exception e) { e.printStackTrace(); throw e; } } </code></pre> <p>I am getting "Auth fail' at session.connect() </p>
java
[1]
5,497,245
5,497,246
Making on onClick to change text in javascript
<p>I want to make a format like the following:</p> <p>Phrase<br> [Button]</p> <p>When the button is clicked, the 'phrase' changes and the button remains. I am able to make it so text appears, however I can not make it so the button stays. Does anyone have an idea of how this may be done? Thanks.</p>
javascript
[3]
1,035,720
1,035,721
Android album art caching
<p>Does anyone know how to store the album art of a music album into a cache? I already have my album arts fetched from my content resolver. But I would like to store them inside a cache (probably, a hash map) so that it will not need to fetch the images from the content resolver again but from the cache.</p>
android
[4]
5,049,869
5,049,870
JQuery RSS Feedzilla Searching
<p>I'm in the process of building an RSS Feed Search for my company so we can add in parameters to search on. I'm using the Feedzilla API located here: <a href="http://code.google.com/p/feedzilla-api/wiki/RestApi" rel="nofollow">http://code.google.com/p/feedzilla-api/wiki/RestApi</a> . Right now, what I have, is a search box for the keyword and when the submit button is pressed, a new windows opens and searches on that keyword through Filezilla and returns the list on the page. </p> <p>I need a way to get that list and be able to select a few that I want on an RSS widget that will be displayed on the website page.</p> <p>I've got the searching done but I'm confused at how to get that info to the website. Is it possible to return that list in an html table on the same page and then submit those articles to a database. Then on the website side, I can call those articles from the database? That's the process I'm looking at right now, but open to other ideas.</p> <p>Thanks!</p>
jquery
[5]
2,204,297
2,204,298
How to compile c++ program with pngwriter
<p>I'm trying to make a png file using <a href="http://pngwriter.sourceforge.net/" rel="nofollow">"pngwriter"</a>. I'm using Ubuntu as my OS. I've put these following files in /home/ediamin/png/ folder 1.png.h, 2.pngconf.h, 3.pngwriter.h, 4.test.cpp, 5.zconf.h, 6.zlib.h</p> <p>my test.cpp contains this codes</p> <pre><code>#include&lt;iostream&gt; #include "pngwriter.h" using namespace std; int main() { int i; int y; pngwriter png(300,300,0,"test.png"); for(i = 1; i &lt; 300;i++) { y = 150+100*sin((double)i*9/300.0); png.plot(i,y, 0.0, 0.0, 1.0); } png.close(); return 0; } </code></pre> <p>Now I'm trying to compile with this command,</p> <pre><code>g++ -o test test.cpp -DNO_FREETYPE </code></pre> <p>and it gives me following errors,</p> <pre><code>/tmp/ccLr9Szo.o: In function `main': test.cpp:(.text+0x30): undefined reference to `pngwriter::pngwriter(int, int, double, char const*)' test.cpp:(.text+0x72): undefined reference to `pngwriter::filledcircle(int, int, int, double, double, double)' test.cpp:(.text+0x7e): undefined reference to `pngwriter::close()' test.cpp:(.text+0x8f): undefined reference to `pngwriter::~pngwriter()' test.cpp:(.text+0xa4): undefined reference to `pngwriter::~pngwriter()' collect2: ld returned 1 exit status </code></pre> <p>What should I do? Please note that, I don't want to install any library file, that's why I put the header files in the same folder.</p>
c++
[6]
5,031,711
5,031,712
how to get category name if my category got custom slug
<p>so my category got slug 'aeroplanes' and I need to get category names from it, but I can't get it with </p> <pre><code>$category = get_the_category($post-&gt;ID); echo $category[0]-&gt;cat_name; </code></pre> <p>cause it takes all posts from default category with category slug 'category'. How can I do that if I got category slug 'aerpolanes'?</p>
php
[2]
200,860
200,861
how to see current version of iphone SDK in MAC system?
<p>anyone can help?</p>
iphone
[8]
321,391
321,392
Unexpected identifier error, javascript
<p>I'm getting an unexpected identifier at <code>float farenheitFloat = parseFloat(farenheit)</code></p> <p>Can't for the life of me figure out why. Any help?</p> <p>A little background...<code>validateFarenheit(farenheit)</code> is working.</p> <pre><code>function convertFarenheit() { var farenheit = document.getElementById('farenheit').value; if (validateFarenheit(farenheit)) { float farenheitFloat = parseFloat(farenheit); //float celsius = (farenheitFloat - 32) * (5/9); //float celsiusFormatted = parseFloat(Math.round(celsius * 100) / 100).toFixed(2); //alert(celsiusFormatted); } return; } </code></pre>
javascript
[3]
4,455,260
4,455,261
C++ overloading and picking right function
<p>C++ Overloading of methods question</p> <p>I have 1 parent class call Vehicle</p> <p>I have 2 child class call Motorcycle and Car</p> <p>I have this value call getNoOfWheels();</p> <p>Parent class got that method, motorcycle and car also got.</p> <p>Lets say i prompt user for input</p> <pre><code>string vehicleType; cout &lt;&lt; "What is your vehicle type" &lt;&lt; endl; cin &gt;&gt; vehicleType; </code></pre> <p>base on user input, how do i make the program pick the right function base on vehicleType , i know i can use if VehicleType== , but thats defeat the purpose of overloading.</p> <p>was given suggestion on using virtual method earlier on. in such case</p> <pre><code>virtual int noOfVerticles() const { return 0; } </code></pre> <p>For shape.h</p> <p>I have same function for Car and motorcycle, but how do i make the noOfVerticles pick the right function from the child class base on vehicleType</p> <p>I tried something like this..</p> <pre><code>Vehicle cVehicle; Car &amp;rCar = &amp;cVehicle; if(inVehicle=="Car") { cout &lt;&lt; rCar.noOfWheels() &lt;&lt; endl; } </code></pre> <p>I get an error that say..</p> <pre><code>invalid initizliation of non-const refenrece of type "Car&amp;" from an rvaleu of type Vehicle* </code></pre> <p>and ...</p> <p>this is my virtual function at Car.cpp</p> <pre><code>public: virtual int noOfWheels() const { return 4; } </code></pre> <p><strong>Thanks.!</strong></p>
c++
[6]
3,293,149
3,293,150
Loop over ALL the values
<p>This might be an odd question, but how does one nicely loop over ALL values of a type. In particular the standard integral types such as <code>unsigned short</code>. A normal <code>for</code> loop construct presents a difficulty: what condition to use to exit the loop - because all values are valid.</p> <p>Of course, there are several ways to get the job done. Exit on the last value then handle that after the loop. Use a bigger int to count. The question is, is there a more elegant way?</p>
c++
[6]
2,446,675
2,446,676
Select from upper level folder
<p>So, I've created a website and I have lots of pages in the public_html folder. Those page load the images and script from folders who are direct child of public_html folder.</p> <p>Now I need to move all those files into a folder (let's name it sample-folder).</p> <p>My question: Is there any way to let the pages inside "sample-folder" access the images and scripts from other folders inside the "public_html" <strong>without</strong> having to edit all the pages and add a <code>../</code>images/image.png before each link?</p> <p>I don't know, some htacces rewrite rule? Some php config.ini edit?</p> <p><strong>Structure:</strong></p> <pre><code>public_html images scripts sample-folder test.php </code></pre>
php
[2]
4,150,032
4,150,033
Use Javascript to make Image visible when page opens
<p>I'm looking for Javascript that will fire when page opens and sets Image1 visibility to true.</p> <p>Thanks</p>
javascript
[3]
4,207,088
4,207,089
defining bunch of static methods in c++
<p>Which is appropriate:</p> <pre><code>class xyz { static int xyzOp1() { } static int xyzOp2() { } }; </code></pre> <p>OR</p> <pre><code>namespace xyz { static int xyzOp1() {} static int xyzOp2() {} }; </code></pre> <p>Is there something specific which we can get when we define using class tag in comparision with namespace tag?</p> <p>Also is there any different in memory management, which we need to worry?</p>
c++
[6]
3,981,429
3,981,430
Security application
<p>i am developing a password storage software. To enter into the application we have to login with valid details.</p> <p>Now when i press home key, the application should log of automatically and then start all over again from security perspective. It should logout everytime the home key is pressed. How do i do it?</p>
android
[4]
690,881
690,882
Allowing users to upload ANYTHING
<p>I'm building a file sharing site, and I'm thinking, I want my users to be able to upload and share anything.</p> <p>Sounds dangerous, I know. But, is there a method to allow this to be possible? For example, forcing the download when the user requests the link with a mime type? Rather than "running" something on the page.</p> <p>Any ideas how to allow any file type without the security issue.</p> <p>Thanks</p>
php
[2]
1,284,190
1,284,191
Link JQuery click methodto Button click event
<p>On my web page I have a button, and some JQuery code. The problem is that when I click the button, the JQuery code is not executed. Clicking the button still does a postback, and seems to ignore the JQuery code. Here is my button:</p> <pre><code>&lt;button id="btnCancel" class="button" runat="server" &gt;&lt;span&gt;Cancel&lt;/span&gt;&lt;/button&gt; </code></pre> <p>Here is my JQuery Code:</p> <pre><code> $(document).ready(function () { $('#btnCancel').click(function () { alert('hello'); }); }); </code></pre> <p>what I would like to achieve is that when the button is clicked, a message must be displayed showing "Hello". Am I missing something here?</p>
asp.net
[9]
4,382,071
4,382,072
Tababar application in iphone
<p>hi i am making an tabbar application in which i have 4 tabbars. tabbars are working perfectly, my problem is that the title is overlapping over other tab bar. Title are a bit long like Instructional Videos. how can i fix it. </p>
iphone
[8]
1,083,153
1,083,154
Persistant notification
<p>Hi I was wondering if anyone knows of a jquery plugin to create a behavior similar to the notification header that appears on Stack Overflow. I understand how to hide and show elements, I dont know how to make its toggle status be persistent throughout the site. I guess basically what I am asking is how to add cookies in the script so the notification does not continue to show if someone closes it and then goes to another page.</p>
jquery
[5]
1,907,353
1,907,354
How to get webpage HTML
<p>I'm trying to load a webpage html in my Android app with the following code:</p> <pre><code> HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet("http://www.stackoverflow.com/"); HttpResponse response = client.execute(request); String html = ""; InputStream in = response.getEntity().getContent(); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder str = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { str.append(line); } in.close(); html = str.toString(); </code></pre> <p>but I'm getting error: <code>Unhandled exception type ClientProtocolException</code> and <code>Unhandled exception type IOError</code> on third line; and <code>Unhandled exception type IOError</code> on 6th, 10th and 13th line</p> <p>I have also tried adding try/catch:</p> <pre><code> try { HttpResponse response = client.execute(request); } catch (ClientProtocolException e) { } catch (IOException e) { } </code></pre> <p>but there's error on line <code>InputStream in = response.getEntity().getContent();</code> saying <code>response cannot be resolved</code></p> <p>(I have Internet access allowed in Manifest)</p> <p>Where's the problem? Thanks a lot</p>
android
[4]
4,951,883
4,951,884
JavaScript alertbox
<p>Is there anyway of displaying a selectbox in an alert box of javascript. when user clicks an add button then alertbox must be displayed in which a selectbox (dropdown) must be shown with add button</p>
javascript
[3]
313,167
313,168
Various problems in JSHint
<p>In JSHint I get the follwing message about my array declaration:</p> <pre><code>jesuschrist["eng_male"] = [//tons of arrays here]; </code></pre> <blockquote> <p>['baby_jesus'] is better written in dot notation.</p> </blockquote> <p>Does it mean I should write it as <code>baby.jesus</code>?</p> <hr> <p>Also, I gives me a problem when declaring the object:</p> <pre><code>jesuschrist = new Object(); </code></pre> <p>JSHint says this:</p> <blockquote> <p>Use the object literal notation {}.</p> </blockquote>
javascript
[3]
3,016,097
3,016,098
Javascript: toggle loading InnerHTML
<pre><code>&lt;script&gt; function toggle_table() { visibility = document.getElementById("table").style.visibility; document.getElementById("table").style.visibility = (visibility == 'visible') ? 'hidden' : 'visible'; document.getElementById("toggle_table").innerHTML = (visibility == 'visible') ? 'Open' : 'Close'; } &lt;/script&gt; &lt;form method='POST'&gt; &lt;a id='toggle_table' href='#' onClick='toggle_table()'&gt;Open&lt;/a&gt; WIJZIGEN PROCES &lt;table id='table' style='visibility: hidden'&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>This works great. Though I don't want to just make it invisible, I want to not render the innerHTML (so it won't take it's space when invisible). Similar to this <a href="http://stackoverflow.com/questions/9694346/toggle-innerhtml">question</a>, though I cannot make use of JQuery (requirements). Is this in a rather simple way with plain JavaScript, without the need of putting the whole HTML-content in Javascript?</p>
javascript
[3]
4,372,563
4,372,564
How get list of days in a week that exist in some date range (Javascript)
<p>Hello I need to define existing days in some date range. I don't wont to make loop from start to end dates and use like here <a href="http://www.w3schools.com/jsref/jsref_getday.asp" rel="nofollow">http://www.w3schools.com/jsref/jsref_getday.asp</a> Is it possible to calculate it some how ?</p>
javascript
[3]
3,274,329
3,274,330
play mp3 from network
<p>I have tried below three solutions but none of them worked. I am sure I am missing some key point but not clear what. (FYI, I am trying out below solutions on iPhone device, not on simulator.) </p> <pre><code>- (IBAction)actionAVPlayer:(id)sender { AVPlayer* player = [[AVPlayer alloc] initWithURL:[NSURL URLWithString:urlTextField.text]]; [player play]; } - (IBAction)actionMemoryBuffer1:(id)sender { NSError *error; NSData *_objectData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlTextField.text]]; AVAudioPlayer* audioPlayer = [[AVAudioPlayer alloc] initWithData:_objectData error:&amp;error]; audioPlayer.numberOfLoops = -1; audioPlayer.delegate = self; audioPlayer.volume = 1.0f; [audioPlayer prepareToPlay]; if (audioPlayer == nil) NSLog(@"%@", [error description]); else [audioPlayer play]; } - (IBAction)actionMemoryBuffer2:(id)sender { NSURLRequest* request = [ NSURLRequest requestWithURL: [NSURL URLWithString:urlTextField.text] ]; NSError *requestError; NSURLResponse *urlResponse = nil; NSData *_objectData = [ NSURLConnection sendSynchronousRequest:request returningResponse: &amp;urlResponse error: &amp;requestError]; NSError *error; AVAudioPlayer* audioPlayer = [[AVAudioPlayer alloc] initWithData:_objectData error:&amp;error]; audioPlayer.numberOfLoops = -1; audioPlayer.delegate = self; audioPlayer.volume = 1.0f; [audioPlayer prepareToPlay]; if (audioPlayer == nil) NSLog(@"%@", [error description]); else [audioPlayer play]; } </code></pre> <p>Any help is much appreciated.</p>
iphone
[8]
770,052
770,053
Looking for experienced PHP programmers in/near NYC
<p>I hope I am not breaking protocol by this posting. </p> <p>I need PHP programmers to help with projects. Full time is best, and nearby (LI/NYC) is heavily preferred though I would not rule out long distance for the right people.</p> <p>thanks</p>
php
[2]
374,501
374,502
Load a html page into a div for jqueryui dialog and editing the contents
<p>I have a Html page i'm loading into a jquery ui dialog, I need to insert a session id into the static loaded html for the page onload processing. My first thought was to use .Data() and add in the var that way but I don't think it's possible on a .Load(page.html) call?</p> <p>So I have tried to do this a lot of different ways but here is the gyst: </p> <pre><code>&lt;div id="cs0" title ="Add/Edit Licence periods"&gt;&lt;/div&gt; $('#cs0').hide(); //load the page into the the div $('#cs0').load("/Periods.html"); //edit inner html of one of the divs in the loaded page $('#cs0').innerHTML.getElementById("MyDiv").innerHTML = sessionid; $('#il0').click(function () { $('#cs0').dialog({ autoOpen: true, maxWidth: 1000, maxHeight: 800, width: 700, height: 300, modal: true, }); }); </code></pre> <p>I have also tried using data, but can't get this to work :( any thoughts?</p>
jquery
[5]
254,185
254,186
Text for links android
<p>Hello I would like to have a link to a website but with a different text on the link like a html anchor tag <code>&lt;a href="google.com"&gt;Alternative text&lt;/a&gt;</code>.</p> <p>Can anyone show any example on this? I have tried Linkify without success.</p>
android
[4]
5,213,897
5,213,898
how to identify the extension/type of the file using C#?
<p>i have a workflow where user is allowed to upload any file and then that file will be read. </p> <p>Now my question is if user have image file xyz.jpg and he renamed it to xyz only (extension removed) in this can we still get the type/extension of the file using/reading files data/metadata.</p> <p>Thanks all</p>
c#
[0]
5,488,719
5,488,720
how to use html templates in C++ to convert html file to ps in C++
<p>how to use html templates in C++ to convert html file to ps in C++ </p>
c++
[6]
5,411,041
5,411,042
Measuring TTFB and TTLB with HTTP in C#
<p>I am looking for ways to measure the TTFB (Time to First Byte) and TTLB (Time to Last Byte) while making a http web request to a specific web page.</p> <p>How can I do the measurement in C#.</p> <p>I am writing a monitoring tool to measure the TTFB and TTLB for accessing a web page. </p>
c#
[0]
4,530,380
4,530,381
php print different color in rows
<p>I try to print out all user email from table, but i want odd number print in red even number print in blue. how to do this in while loop?</p> <pre><code>$connect=mysql_connect("localhost", "root", ""); $database=mysql_select_db("phplogin", $connect); $SQL=mysql_query("SELECT * FROM users"); $num=mysql_num_rows($SQL); $start=0; while($start&lt;$num){ $result_id=mysql_result($SQL, $start, "id"); $result_email=mysql_result($SQL, $start, "email"); echo "&lt;b style='color:red'&gt;" . $result_id . $result_email . "&lt;/b&gt;&lt;br/&gt;"; echo "&lt;b style='color:blue'&gt;" . $result_id . $result_email . "&lt;/b&gt;&lt;br/&gt;"; $start++; } </code></pre>
php
[2]
4,084,319
4,084,320
Pancake Sorting Through List
<p>I am to pancake sort a list and return the minimum number of calls to flipStack. Primarily, I am confused as to why my program doesn't end when the base case is reached (the list is sorted). Shouldn't the best number (minimum number of flips) just be returned right there?</p> <p>Secondly, I need to add a pruning filter that will get rid of bad flipStack calls resulting in the most minimum number of flips. I think it might have something to do with starting with the largest number but I am confused on how to implement this.</p> <pre><code>def minFlipsToSort(A): return minFlipsToSortHelper(A, 0, [0]) def minFlipsToSortHelper(A, i, best): # base case if sorted(A) == A: return best[0] else: for j in range(i, len(A)): # pruning filter before all this flipStack(A, i) best[0] +=1 minFlipsToSortHelper(A, i+1, best) </code></pre>
python
[7]
393,210
393,211
iPhone - How do I change default status bar when opening apps?
<p>I have used Winterboard to apply a theme. I have put <code>Translucent_Base@2x.png</code> in <code>UIImages</code> folder and works fine, but when I open apps such as Settings or Phone, the status bar turns to default silver. How can I make it so that it is same as <code>Translucent_Base@2x.png</code> all the time?</p>
iphone
[8]
2,384,574
2,384,575
How to step frames in a movie recorded by iPhone
<p>Is there a way to have my iPhone program step frame by frame through a movie recorded by the iPhone? What I want to do is have the user record a quicktime movie, then be able to step through the movie frame by frame.</p> <p>Alternately, I suppose if there was a way to extract every single frame from the movie to a jpg, then I could easily step through the pictures. Anyone know of a way to do this???</p> <p>I suppose the third option (which might not get past Apple's store) is to capture the movie the way the old jailbroken apps did, which is somehow capture the pictures directly from the camera view????</p> <p>Any help appreciated. Thanks in advance!!!!</p>
iphone
[8]
3,827,653
3,827,654
Python SimpleHTTPServer with PHP
<p>I used <strong>python -m SimpleHTTPServer</strong>, but the PHP files don't execute instead they just been downloaded.</p> <p>I heard about <a href="http://pythonpaste.org/wphp/">WPHP</a> in an old <a href="http://stackoverflow.com/questions/9900706/simple-python-server-similar-to-simplehttpserver-but-with-php-support">post</a>. But I don't know how to use it. How I can work with it ?</p>
php
[2]
5,335,360
5,335,361
php 5.2.12 Maximum execution time when using include()
<p>Anyone got a problem with php 5.2.12 getting a lot of " Maximum execution time" error when trying to include() files?</p> <p>I can't seem to find the bug in php.net, but it's consistently giving us that error on numerous scripts.</p> <p>Anyone can recommend solutions?</p> <p>The same script runs on a few other servers with php 5.2 without any problems. So just to let you guys know it isn't a script problem.</p>
php
[2]
2,309,123
2,309,124
Implicit conversion for pointer to data member vs. non-member
<p>Most discussion I've seen about member pointers focus on conversions permitted on the type to which the member belongs. My question is about conversions on the type of the member.</p> <pre><code>struct Base{}; struct Derived : public Base{}; struct Foo{ Derived m_Derived; }; </code></pre> <p>Given these declarations, the following code produces an error (MSVC 2008):</p> <pre><code>// error C2440: 'initializing' : cannot convert from 'Derived Foo::* ' to 'Base Foo::* ' Base Foo::*p = &amp;Foo::m_Derived; </code></pre> <p>Conversion from Derived* to Base* is normally allowed - why the difference here?</p>
c++
[6]
5,308,748
5,308,749
i am developing stock management system in java but i am new in java
<p>I am developing stock management system in java and I am new in java.I started coding but stucked.i would like to make a login form and there will be username JTextfield and password JPasswordfield, login button, cancel and register button.login button for login if user name and password is correct,if not will not authenticated. cancel button to cancel login and erase user name and password in the textbox. and register button for registering new user.</p> <p>I need to code connect Database also and I am using MS SQL 2005. can anyone please help me?</p>
java
[1]
1,135,611
1,135,612
How can I create site bar?
<p>How can the administrator for the menu bar segment to create the name of the source menu bar text and url menu bar gets in the Reserve database keeps main part of the menu bar about menu bar text and url for the database to read and display?</p>
php
[2]
5,453,107
5,453,108
Adding and removing handlers that have additional parameters?
<p>When you are adding and <strong>removing</strong> event handlers and you want to have additional parameters, how do you go about doing this? The below code is like something i would want but obviously does not work.</p> <p>How would you go about this? - it's troublesome that i cant use delegates or lambdas as i need to also remove the handler.</p> <pre><code> private static void IsDefaultChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { if ((bool)args.NewValue) { Window.Current.CoreWindow.KeyUp += CoreWindowOnKeyUp(dependencyObject); } else { Window.Current.CoreWindow.KeyUp -= CoreWindowOnKeyUp(dependencyObject); } } private static void CoreWindowOnKeyUp(CoreWindow sender, KeyEventArgs args, DependencyObject dependencyObject) { ((ICommand)dependencyObject.GetValue(Button.CommandProperty)).Execute(null); } </code></pre>
c#
[0]
406,570
406,571
php loading problems
<p>I am using php and mysql to grab and display details depending on the user request. The problem that I am having is while the results are loading none of the other files are accessible to anyone. For an example when someone is using results.php none of the other users are able to access listall.php until the results.php is loaded completely.</p> <p>Can someone please tell me how to make possible that any user can access any part of the site.</p>
php
[2]
1,538,209
1,538,210
Need an algorithm to manipulate array structure in javascript
<p>In javascript, here is my start array:</p> <pre><code>[{ name: 'aaa', value: 1 }, { name: 'bbb', value: 0 }, { name: 'bbb', value: 1 }] </code></pre> <p>I want to transform it into this array as result:</p> <pre><code>[{ name: 'aaa', value: 1 }, { name: 'bbb', value: [0, 1] }] </code></pre> <p>I need a good and simple algorithm to do this</p>
javascript
[3]
2,981,622
2,981,623
Does SetVaryByCustom work in User Controls?
<p>It seems to me that </p> <pre><code>Response.Cache.SetVaryByCustom("mykey"); </code></pre> <p>is not working from within ASCX User Controls. It works from the Page. The ASCX works only when VaryByCustom is specified in the outputcache directive. </p> <p>I'm using ASP.NET 3.5. </p> <p>Any help?</p>
asp.net
[9]
315,490
315,491
Single character input with wake state
<p>Back in college I wrote a game where the computer would sleep for 1 second, wake up and check to see if anything needed to be processed. Of course, if the user entered a single character command, it would respond immediately.</p> <p>Is there a way to do that with JavaScript?</p>
javascript
[3]
5,714,417
5,714,418
Specifically, what does % do in C#?
<p>I have never came across anything that requires me to use it, and when I google what it does nothing comes up.</p> <p>So, can someone please explain in detail, what does it do?</p>
c#
[0]
5,775,316
5,775,317
How to exclude a layout from touch events in Android?
<p>In my application I have a requirement of hiding a layout when the user clicks on any part of rest of the screen.But when I click on the part of layout,it is hiding the layout.I want to exclude this part from touch events.</p> <p>How can I do this?</p>
android
[4]
542,388
542,389
Pass set of functions as arguments to another function in Python
<p>I would like to implement my own basic Runge-Kutta 4 integrator in Python. The format should be something like this:</p> <pre><code>---- EXAMPLE set of equations ---- f1 = lambda x: x**2 f2 = lambda y: y**2 . . . fn = lambda n: n**2 f = [f1, f2, f3, ... , fn] result = integrate(f, other arguments [e.g. stepsize etc.]) ---- result should be of format ---- result = [result1 result2 result3 ... resultn] </code></pre> <p>So basically I want to be able to define, for example, a set of three equations of motion, and be able to pass these to a function and access them to manipulate these equations inside of that function. How is that possible?</p> <p>Ideally, I want to achive something similar to Matlabs ode45 function, which can be called for example as follows:</p> <pre><code>% ---- file 1 ---- % function xp=F(t,x) xp=zeros(2,1); xp(1)=x(2); xp(2)=-t*x(1)+exp(t)*x(2)+3*sin(2*t); % ---- file 2 ---- % [t,x]=ode45(’file 1’,[t0,tf],[x10,x20]); % where t0 tf initial and final values of t % x10 x20 initial values of x </code></pre> <p>Note 1:<br> I have already looked at the source for dopri5 in SciPy but it is implemented in C and far too advanced for my purposes.</p> <p>Note 2:<br> Let me know if what I've written above is not clear at all, which </p>
python
[7]
5,789,524
5,789,525
Calling a Method on a method
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3724112/php-method-chaining">PHP method chaining?</a> </p> </blockquote> <p>So I can remember seeing in some code examples somewhere calling of a method on a method like:</p> <pre><code>$classname-&gt;method1()-&gt;method2(); </code></pre> <p>Can you please explain to me what we call this, and give an example scenario of its usage? Also if you have a link to a tutorial or article on this would be helpful.</p> <p>I'm new to Object Oriented PHP. And before you kill me for what might be a dumb question, understand that i don't know what to search for on Google, please help... </p>
php
[2]
4,722,679
4,722,680
Customized Toast or something else?
<p>Sorry for my bad english. I need help.</p> <p><a href="http://habrastorage.org/storage2/605/02c/601/60502c60140c90bcd61829a1cdee9af8.png" rel="nofollow">image with view component</a></p> <p>What is the element with "Drag apps to your ..." text on Adroid emulator? Customized Toast or ... what?</p>
android
[4]
3,606,467
3,606,468
change two images in php
<p>EDIT: I have to images (or two strings) on a page. One on the left and the other on the right side. I want them to randomly switch their position when refreshing the site. How can I do this? Thanks.</p>
php
[2]
3,352,533
3,352,534
SQlite database creation?
<pre><code>public static final String TABLE_COMMENTS = "comments"; public static final String COLUMN_ID = "_id"; public static final String COLUMN_COMMENT = "comment"; // Database creation sql statement private static final String DATABASE_CREATE = "create table " + TABLE_COMMENTS + "(" + COLUMN_ID + " integer primary key autoincrement, " + COLUMN_COMMENT + " text not null);"; </code></pre> <p>can any one pls explain what above line doing .Am new to android.Is TABLE_COMMENT a column in table that we are creating?Why we have used "("?</p>
android
[4]
1,286,918
1,286,919
Error when use javascript mouseover from an array?
<pre><code>&lt;a href=""&gt;&lt;/a&gt; &lt;textarea&gt;&lt;/textarea&gt; &lt;object&gt;&lt;/object&gt; &lt;img src="" /&gt; &lt;div id="content"&gt;content&lt;/div&gt; &lt;div class="test"&gt;test&lt;/div&gt; </code></pre> <p>And javascript</p> <pre><code>oj = ['a', '#content', '.test']; oj.forEach(function(val) { val.onmouseover = function() { alert("Mouseouver !!!"); } }); </code></pre> <p>When I mouseover this object, result not alert, how to fix it ?</p>
javascript
[3]
694,625
694,626
create a href to call a function "javascript"
<p>I'm trying to create " a href" tag by using javascript but instead of using it as a web-link, i want to use it to do a certain steps! so what can i do?</p> <pre><code> var a = document.createElement('a'); a.attributes('href', 'function () { nn = 0 }' );// ? a.textContent = " " + pn.length + " "; document.getElementById("pagingN").appendChild(a); num[i] = num[i] + n; </code></pre>
javascript
[3]
1,754,967
1,754,968
How to create an android plugin with views, activities and objects
<p>So... I'm trying to create a plugin for one of my apps. This plugin would require several views, images, an activity and a parser for CharSequences... Ideally, this plugin would be downloadable from the Android Market. </p> <p>I understand how to create a library, but that would need to be included in the application.</p> <p>I understand how to create an app as a service and just call it via intents, but I need direct access to objects and code that is neither parceable nor serializable.</p> <p>What I have been looking at is <a href="http://code.google.com/p/eyes-free/">eyes-free TTS</a>. With their implementation, the developer includes a small TTS_library_stub.jar file in their app, which looks like it defines a lot of the necessary classes/objects.</p> <p>So my question is, how would I go about building something like this and generating this "stub" .jar file, which would be included in my app? I've been trying to work my way through the TTS code, but it's a massive codebase, and I'm having trouble finding what I'm looking for.</p> <p>Any help would be massively appreciated :)</p>
android
[4]
3,861,321
3,861,322
android - How to set the Rating bar is non clickable and touchable in HTC mobile
<p>My application have rating bars. I want to set the Rating bar is non-click able and no-touchable. For this i added the following code in xml file of each rating bar. It is working in samsung galaxy Apollo GT-i5801. But it is not working in the HTC mobile. Why? can anybody help me.</p> <p><strong>xml code</strong></p> <pre><code>android:clickable="false" android:focusableInTouchMode="false" android:focusable="false" </code></pre> <p>thanks</p>
android
[4]
5,665,073
5,665,074
How to get the width of a TextView?
<p>I tried to resize an image inside a textview (using HTML layout and the image callback), but I could not get the correct width of the view. getWidth() always returns 0 for this view. I am calling the function inside onStart() in the application that contains the TextView.</p> <p>Thanks for any hints!</p> <p>RG</p>
android
[4]
86,432
86,433
libzip with Visual Studio 2010
<p>Is there anyway documentation for compiling libzip for Visual Studio 2010? Everything I have seen from the libzip website and Google has returned no results.</p>
c++
[6]
1,788,950
1,788,951
Android: build android application to check app is running at emulator or real device
<p>We need to develop android basic app which will detect the device is real or emulator and behave accordingly. But did not found sample code or process to detect this thing actually. Please suggest me somebody to resolve this issue. Thanks</p>
android
[4]
2,138,638
2,138,639
What is the best way to invoke action in Form1 When Form2 is closed without using ShowDialogue in C# Windows Form Application?
<p>I've a project that contain 2 forms e.g. (Form1 , Form2 ).The user should be able to use any of the 2 forms while both of them are visible(i.e. Can use Form1 While Form2 is Open).At the same time when Form2 is closed there is an action that should be invoked in Form1 related to From2_close. I can't use Form2.ShowDialogue as it trap focus only to Form2 but user should be able to edit some data in Form1 while Form2 is loaded. Hope the question is clear, please help. Thanks </p>
c#
[0]
172,360
172,361
I want to restore my orientation in fragment.
<p>I am using onSaveInstanceState(Bundle outState) and passing a int value in PutInt , but in my onActivitycreated method when i am trying to getInt then it is showing exception saying , Key android:view_state expected Bundle but value was a android.util.SparseArray. The default value was returned.</p> <pre><code>public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mListView = getListView(); getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE); if (savedInstanceState !=null) { mCheckedPosition = savedInstanceState.getInt(STATE_CHECKED_POSITION, -1); } .................. </code></pre> <p>Here i am sending the value . it is fine here. problem is in when i am getting it.</p> <pre><code> @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(STATE_CHECKED_POSITION, mCheckedPosition); Log.d(AppConstants.TAG,"STATE_CHECKED_POSITION"+mCheckedPosition ); } </code></pre>
android
[4]
5,492,661
5,492,662
How to compute number of syllables in a word in javascript?
<p>Is there javascript library for counting number of syllables in a word? How to count?</p> <p>Thanks</p> <p><strong>Edit</strong></p> <p>Thank Sydenam and zozo for useful information and possible answers.</p> <p>I found code by <a href="http://stackoverflow.com/questions/1271918/ruby-count-syllables">Pesto at this forum</a> , but it is in Ruby. One of its concise versions is below: </p> <pre><code>def new_count(word) word.downcase! return 1 if word.length &lt;= 3 word.sub!(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/, '') word.sub!(/^y/, '') word.scan(/[aeiouy]{1,2}/).size end </code></pre> <p>This seems short but complicated. Can you translate this function into javascript? Thank you again.</p>
javascript
[3]
3,181,282
3,181,283
What is your strategy to avoid dynamic typing errors in Python (NoneType has no attribute x)?
<p>Python is one of my favorite languages, but I really have a love/hate relationship with it's dynamicness. Apart from the advantages, it often results in me forgetting to check a type, trying to call an attribute and getting the NoneType (or any other) has no attribute x error. A lot of them are pretty harmless but if not handled correctly they can bring down your entire app/process/etc. Over time I got better predicting where these could pop up and adding explicit type checking, but because I'm only human I miss one occasionally and then some end-user finds it.</p> <p>So I'm interested in your strategy to avoid these. Do you use type-checking decorators? Maybe special object wrappers? Please share...</p>
python
[7]
3,048,979
3,048,980
How to c# function using javascript
<p>I have input HTML button(Not ASP.NET Button) click event in c#</p> <p>Is there any way i can call c# function using javascript</p> <p>Thank you very much....</p>
javascript
[3]
1,503,241
1,503,242
Why should some methods be invoked only from the main application thread?
<p>I read about <a href="http://developer.android.com/reference/android/speech/SpeechRecognizer.html" rel="nofollow">this class</a>:</p> <blockquote> <p>Do not instantiate this class directly, instead, call createSpeechRecognizer(Context). This class's methods must be invoked only from the main application thread.</p> </blockquote> <p>I suppose that the main application thread is the main Activity of an Android application... Why should this class's methods be invoked only from the main application thread?</p>
android
[4]
3,270,315
3,270,316
Thread.sleep() hangs in java in 64 bit blade server
<p>I have scenario where I am scheduling task at fixed duration repetitively.Fixed delay is generated by calling start method of another class that implements runnable interface using Thread.sleep(long ms ) method. But when I test this application in my local pc it is working.But when I run this application in ibm blade server(64 bit) having OS(Windows server 2008 R2) it do not work as desired. It do not come out of sleep method.</p> <p>Kindly suggest the solution?</p> <p>Thank You in Advance.</p>
java
[1]
2,059,485
2,059,486
how to navigate two page back using popviewController?
<p>I'm iphone developer. I got a problem that my first page is login page than home page. I navigate two pages from home page and now I want to navigate back to home but I can't come. if I'm using popToRootViewControllerAnimated then its come to login page but I need to come to home page. please some one help me.</p>
iphone
[8]