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,303,217
2,303,218
how to show progress bar moving from one activity to another activity in android
<p>I want to show progress bar to going from one activity to another activity until another activity is loaded can anybody give example</p> <p>Thanks</p>
android
[4]
4,039,627
4,039,628
Prevent ToggleButton from switching state
<p>I have a ToggleButton, when you click it, I don't want the state to change. I will handle state changes myself when after I receive feedback from whatever the button toggled. How might I prevent the state change on click?</p>
android
[4]
1,753,859
1,753,860
Quickaction bar on android google map marker
<p>You guys probably heard of the quick action bar which is really great for user interaction. But I can't find the way to show the quick action bar when user tap on the marker on android's google maps. Anyone can help?</p>
android
[4]
3,340,145
3,340,146
Android activities can execute when not in foreground
<p>Android activities can execute when not in foreground. In one page am having chronometer means can i run that with out pause..No means wt i do to run with out pause.. give me any idea.. thank you,</p>
android
[4]
217,553
217,554
Transfer data from Form2 to Form1 is throwing System.Nullreferenceexception
<p>I have two forms form1 and form2 and I want to transfer the value from form2 to form1. Form1 has a textbox where I want the value from Form2 Form2 has a button on its click the value gets from textbox on form2 to the textbox on form1 </p> <p>Here is my code :</p> <p><strong>Form2.cs</strong></p> <pre><code>private Form1 HandleToForm2; public Form2(Form1 frmHandle2) { HandleToForm2 = frmHandle2; InitializeComponent(); } private void update_Click(object sender, EventArgs e) { HandleToForm2.WriteToTextBox2(textBox2.Text); this.Hide(); } </code></pre> <p><strong>Form1.cs</strong></p> <pre><code>public void WriteToTextBox2(string inputText1) { this.textBox8.Text = inputText1; } </code></pre> <p>Dont know why its throwing NullReference Exception "Object not set to an instance of an object</p> <pre><code> HandleToForm2.WriteToTextBox2(textBox2.Text); //this line throws this exception </code></pre> <p>Thanks in advance :-)</p>
c#
[0]
1,042,058
1,042,059
iphone iads animation
<p>Hi all I am working on the iAds. I want to animate the ad banner when the ad changes. Is there any way to make them animate automatically? or is it that we should do it manually each time the ad changes.?</p>
iphone
[8]
628,769
628,770
How to identify buttons click event which is on the custom cell?
<p>I have custom cell which contains number of rows in it.i want to write it's Action(click event) so how should i identify which buttons clicked and how can i write it's click event for it.Please give me some guidelines for that.i have not implemented yet.</p>
iphone
[8]
3,061,999
3,062,000
How to print the value of const void*
<pre><code>#include &lt;iostream&gt; using namespace std; void fn(const void *l) { // How to print the value of l. The below line is giving error cout &lt;&lt; "***" &lt;&lt; *l; } int main() { cout &lt;&lt; "Hello World!"; int d = 5; fn((char *) &amp;d); return 0; } </code></pre> <p>Error:</p> <p>In function 'void fn(const void*)': Line 8: error: 'const void*' is not a pointer-to-object type compilation terminated due to -Wfatal-errors.</p> <p>Tried Casting as seen below. It didnt not help. Please provide suggestions.</p> <pre><code>#include &lt;iostream&gt; using namespace std; void fn(const void *l) { // How to print the value of l. The below line is giving error int *pInt = static_cast&lt;char*&gt;(l); cout &lt;&lt; *pInt; } int main() { cout &lt;&lt; "Hello World!"; int d = 5; fn((char *) &amp;d); return 0; } </code></pre> <p>In function 'void fn(const void*)': Line 9: error: static_cast from type 'const void*' to type 'char*' casts away constness compilation terminated due to -Wfatal-errors</p>
c++
[6]
2,961,211
2,961,212
accordian + and - symbol help
<pre><code>&lt;script type='text/javascript'&gt; $(document).ready(function() { $('div.Syb&gt; div').hide(); $('div.Syb&gt; h4').click(function() { var span = $(this).children('span:first').attr('class'); // span.text(span.text()=='+'?'-':'+'); span = (span == 'plus')?'minus':'plus'; $(this).children('span:first').attr('class',span); $(this).next('div').slideToggle('fast') .siblings('div:visible').attr('css','plus').slideUp('fast'); // $(this).siblings('div.Syb&gt;h4 &gt;span:first').attr('css','plus'); }); }); &lt;/script&gt; </code></pre> <p>when ever the div gets closed in need to put + symbol back...which i am not able to do ..any help on this?</p> <pre><code>&lt;div class="Syb"&gt; &lt;h4&gt;&lt;span class='plus'&gt;&lt;/span&gt;Title 1&lt;/h4&gt; &lt;div&gt;Lorem...&lt;/div&gt; &lt;h4&gt;&lt;span class='plus'&gt;&lt;/span&gt;Title 2&lt;/h4&gt; &lt;div&gt;Ipsum...&lt;/div&gt; &lt;h4&gt;&lt;span class='plus'&gt;&lt;/span&gt;Title 3&lt;/h4&gt; &lt;div&gt;Dolor...&lt;/div&gt; &lt;/div&gt; </code></pre> <p>is my html</p>
jquery
[5]
175,475
175,476
Static Dictionary needs to be threadsafe - Suggestions?
<p>I currently have a static dictionary in my class. Although I have implemented locks on this dictionary yet I get the following error.</p> <pre><code>An InvalidOperationException has occurred. It reports a "collection was modified" error </code></pre> <p>The reason for this is that at times one method is reading the dictionary using foreach while another thread is removing or adding items to it. I read that adding </p> <pre><code>lock ( ( (IDictionary&lt;string,string&gt;)dict_object).SyncRoot ) </code></pre> <p>on all the operations where reading/writing/removing is taking place will resolve the issue however I keep on getting the message</p> <pre><code>does not contain a definition of SyncRoot are you missing a using directive </code></pre> <p>any suggestions on how I could resolve this issue ? Any other way on how I could make my static dictionary threadsafe ? I am using .Net 4.0</p>
c#
[0]
4,367,656
4,367,657
Google Extension contextMenus' method is not calling second time
<p>contextMenus has created first time it is calling takeScreenshot() &amp; it will open cropper.xhtml. but 2nd time it is not calling takeScreenshot(). While removing form code it's working fine. Please help me.</p> <pre><code>chrome.contextMenus.create({ "title" : "Add Snippet", "type" : "normal", "contexts" : ["all"], "onclick" : takeScreenshot()}); function takeScreenshot() { return function(info, tab) { chrome.tabs.getSelected(null, function(tab) { var formeEl=document.createElement("FORM"); formeEl.method="POST"; formeEl.action="http://localhost:8080/url"; document.body.appendChild(formeEl); formeEl.submit(); window.open('http://localhost:8080/Cropper.xhtml'); }); }; }; </code></pre>
javascript
[3]
5,454,401
5,454,402
Upload file from client machine to server - prepopulate file picker path?
<p>I'd like to upload a file from a client machine to my server. The user would have to specify the file to upload as I understand it, using a form that looks like:</p> <pre><code>&lt;input type="file" name="datafile" size="40"&gt; </code></pre> <p>This pops up a native file picker, which is great. The problem I'm having is that it's a real pain (for most users) to go looking around their machine for the file I'm interested in. Is there a way I can initialize the file picker with a path to make it more convenient for the user? Like I know some users will be on a windows machine, so I could prepopulate the picker by already sending them to the My Documents folder for example.</p> <p>I don't see how this is possible, just wondering if something like that exists,</p> <p>Thank you</p>
javascript
[3]
1,488,995
1,488,996
How can I authenticate users without forcing them to register?
<p>I want to make a website that I thought up, but I don't want to have the users register. Instead, I want some sort of unique id that can be retrieved using PHP. This unique ID could be to be with the network they are using, or their computer. </p> <p>One idea I was thinking of was getting the users HWID and using that. Would that be possible?</p> <p>Can someone give me the advantages and disadvantages of doing this, and also give me some examples of what I could use?</p>
php
[2]
2,481,381
2,481,382
show a window every few seconds in home screen in Android
<p>I`m new to android.</p> <p>I want to write an alarm system in android.</p> <p>I want to show a window (or dialog) every few seconds (or hours) in home screen and i want to hide it after a few second.</p> <p>how can i do it?</p>
android
[4]
4,726,387
4,726,388
Caching in dll for asp.net site?
<p>I have a .NET DLL on my site. I'd like to use Cache() like you can on ASP.net websites, but it's just a class library project.</p> <p>I'm guessing I'm missing a reference but I don't know what it is.</p>
asp.net
[9]
2,049,426
2,049,427
Java return copy to hide future changes
<p>In Java, say you have a class that wraps an <code>ArrayList</code> (or any collection) of objects. </p> <p>How would you return one of those objects such that the caller will not see any future changes to the object made in the ArrayList? </p> <p>i.e. you want to return a deep copy of the object, but you don't know if it is cloneable.</p>
java
[1]
1,646,387
1,646,388
$Tim = time() - 60000; if($tit->Time >= $Tim){ echo"t: "; }
<p>I want it to echo NEW beside a thread title if it was made less then or hour ago. Once it's been an hour i want it to echo nothing.</p> <p>This has worked before but will not work now, anyone know why this is not doing what i said above?</p> <pre><code>$Tim = time() - 3600; if($tit-&gt;Time &gt;= $Tim){ echo"NEW "; } </code></pre>
php
[2]
73,143
73,144
pass data and link attribute to new div
<p>This is part 2 to my previous question.. Here is the markup:</p> <p>html</p> <pre><code>&lt;a data-message="my message" href="www.site.com"&gt;click here&lt;/a&gt; &lt;div class="new-window"&gt; &lt;p&gt;(my message)&lt;/p&gt; &lt;a href="LINK-GOES-HERE"&gt;proceed&lt;/a&gt; &lt;/div&gt; </code></pre> <p>js</p> <pre><code>$('a[data-message]').click(function(){ $('.new-window').fadeIn(300); $('.new-window p').text($(this).data('message')); return false; }); </code></pre> <p>Since there are a few links on the page, and I want a custom div window (as opposed to a standard alert) to show with a message and url passed to new-window. Is there a way to pass the selected link's URL to the new window?</p> <p>Thanks</p>
jquery
[5]
5,015,031
5,015,032
Forced password change after x days stuck in a loop
<p>I am implementing a forced password change after 90 days for a web application - at the top of an application header file which is called on every page I check the age of the password and if it is over 90 days force the user to a password change page. This all works fine.</p> <p>The problem is the password change page also calls the header page which does the check so it gets the same look and feel as the rest of the site but, of course, it then sticks in a never ending loop of check and redirect - what is the best way to prevent this? I don't want to have to have the password change page with no formatting, nor as a pop up and I ideally don't want to use a different template header without the password check as I will forget to update the second one when I make changes.</p> <p>How else can I approach this? I want to make sure that the user cannot do anything other than change their password once they pass the 90 day mark.</p> <p>Thanks Jason</p>
php
[2]
1,702,566
1,702,567
List Scroll issue 2.1 vs 2.2
<p>i have a listview L2 in a Linear layout L1, Now i think if the height of layout L1 containing the listview is less than the height of the Listview L2, and L1.height fits in the display i.e. L1.height &lt; display screen height then my list would scroll, But my list srolls only in 2.1 avd and not in 2.2 avd! I am perplexed at this behaviour, anybody any idea, what could be causing this?</p> <p>Thanks</p>
android
[4]
1,015,117
1,015,118
How to make a generic list equal another generic list
<p>This is my set up,</p> <pre><code>class CostPeriodDto : IPeriodCalculation { public decimal? a { get; set; } public decimal? b { get; set; } public decimal? c { get; set; } public decimal? d { get; set; } } interface IPeriodCalculation { decimal? a { get; set; } decimal? b { get; set; } } class myDto { public List&lt;CostPeriodDto&gt; costPeriodList{ get; set; } public List&lt;IPeriodCalculation&gt; periodCalcList { get { return this.costPeriodList; // compile error } } } </code></pre> <p>What would be the best way of doing this?</p>
c#
[0]
2,284,747
2,284,748
Exploring a ASP.NET website's code
<p>I have been set a new project at work and have been given the code beforehand to give it a good look. Since time is limited, can anyone please give me the best way to get a good feel of the project. What are the things I should be looking for within the code?</p> <p>Thanks.</p>
asp.net
[9]
1,550,322
1,550,323
jquery pass dynamic variable name
<pre><code>function liveUpdate(fld,value,id) { $.ajax({ type: 'POST', url: 'myurl.html', data: { fld:value, 'id': id }, success: function(data){//console.log(data); } }); } </code></pre> <p>i want fld to be posted as fld's value not the variable name fld? i've tried to wrap around with eval but no luck</p> <p>any ideas?</p> <p>thanks</p>
jquery
[5]
5,428,393
5,428,394
Android default click sound (audio file)
<p>I would like to play default Android click sound in my application, even on non-Android systems. Where can I obtain this audio file on my device (Samsung Galaxy Tab2 7.0), or where can I download this audio file from the web?</p>
android
[4]
1,756,427
1,756,428
How to handle the 'back button' on android when I have a progress dialog pops up
<p>When my android activity pops up a progress dialog, what is the right way to handle when user clicks the back button?</p> <p>Thank you.</p>
android
[4]
3,183,069
3,183,070
Java- && Evaluation
<p>Can anybody help me on following issue:</p> <p>I have code like:</p> <pre><code>if(cond1 &amp;&amp; cond2 &amp;&amp; .. &amp;&amp; cond10) </code></pre> <p>Here, cond1 are expensive operations whose output is Boolean.</p> <p>Now my question is what JAVAC will do, when cond2 output is false. Specifically, is it goes evaluate cond3 's output or stops evaluation ?</p> <p>More illustratively,</p> <pre><code>if(cond1 &amp;&amp; cond2 &amp;&amp; .. &amp;&amp; cond10) //do this </code></pre> <p>and</p> <pre><code>if(cond1){ if(cond2){ . . . if(cond10){ //do this } </code></pre> <p>are same in java (in case of execution way) ?</p>
java
[1]
1,707,398
1,707,399
Delpoying a web service as an app for android?
<p>Is it possible to access a webservice through an Android app? So basically a user would be purchasing access to the site by paying for the app? Then deploy rich content to the user through the browser? If so, is it then possible to authenticate who has access to the site from the webserver without the need for signin or signup?</p>
android
[4]
4,578,739
4,578,740
WPAD queries calling webservice from ASP.NET
<p>We have an ASP.NET website which calls a webservice. If impersonation is not on for the ASP.NET website the call to the webservice is slow - using WireShark we see that it is making WPAD queries.</p> <p>If impersonation is on and it's impersonating an admin user the call to the webservice is fast - using WireShark we that it is NOT making WPAD queries.</p> <p>Has anyone seen this before? How do we prevent the NetworkService, which by default is what the ASP.NET website uses, does not make WPAD queries. </p> <p>Why does impersonating as an admin user not cause WPAD queries?</p> <p>This is the entry we see in WireShark:</p> <p>NBNS Name Query NB WPAD&lt;00></p>
asp.net
[9]
545,884
545,885
Javascript for..in vs for loop performance
<p>I was clustering around 40000 points using kmean algorithm. In the first version of the program I wrote the euclidean distance function like this</p> <pre><code>var euclideanDistance = function( p1, p2 ) { // p1.length === p2.length == 3 var sum = 0; for( var i in p1 ){ sum += Math.pow( p1[i] - p2[i], 2 ); } return Math.sqrt( sum ); }; </code></pre> <p>The overall program was quite slow taking on average 7sec to execute. After some profiling I rewrote the above function this</p> <pre><code>var euclideanDistance = function( p1, p2 ) { // p1.length === p2.length == 3 var sum = 0; for( var i = 0; i &lt; p1.length; i++ ) { sum += Math.pow( p1[i] - p2[i], 2 ); } return Math.sqrt( sum ); }; </code></pre> <p>Now the programs on average take around 400ms. That a huge time difference just becasue of the way I wrote the for loop. I normally don't use <code>for..in</code> loop for arrays but for some I did in case. </p> <p>Can someone explain why there is this huge difference in performance between these 2 styles?</p>
javascript
[3]
2,292,552
2,292,553
C# generated code to be displayed in WebBrowser
<p>I have a <strong>Windows Form</strong> program that will generate HTML code dynamically and a WebBrowser will display the generated code.</p> <p>Is it the only way, to save a temp HTML file, then display it in thw WebBrowser? Is there a way that I don't need to save and display instantly in the WebBrowser?</p>
c#
[0]
2,646,266
2,646,267
file_get_contents() doesn't work because url includes &amp; and %20
<p>I use file_get_contents() to read remote files. It works fine with normal charactered urls, but however, a client has some files which are like</p> <pre><code>http://www.site.org/?m=sp_view_doc&amp;file=publicpolicy/shared%20documents/therapeutic%20discovery%20project%20credit%20general%20guide.pdf </code></pre> <p>and it shows this in source code</p> <pre><code>http://www.site.org/?m=sp_view_doc&amp;amp;file=publicpolicy/shared%20documents/therapeutic%20discovery%20project%20credit%20general%20guide.pdf </code></pre> <p>I have tried urldecode(), but not worked. How can I avoid this problem ?</p>
php
[2]
3,450,552
3,450,553
BASIC Javascript slider/rollovers NO JQUERY
<p>I am trying to learn <code>JavaScript</code>. </p> <p>So I can build my own sliders, rollovers, really awesome <code>JavaScript</code> web stuff :) - without the use of plugins and such. </p> <p>I was hoping someone could head me in the directions of building these on my own - tutorials <code>Jsfiddle</code>, etc. any suggestions?</p>
javascript
[3]
3,433,910
3,433,911
java console input
<p>The data type of the any input through console (as i do using BufferedReader class) is String.After that we type cast it to requered data type(as Inter.parseInt() for integer).But in C we can take input of any primitive data type whereas in java all input types are neccerily String.why it is so????</p>
java
[1]
3,716,547
3,716,548
Get font name from Google Fonts URL with regular expression
<p>Please tell me how to <code>preg_match</code> font names from the Google Fonts URL.</p> <p>For example, I want to extract the font name from:</p> <pre><code>http://fonts.googleapis.com/css?family=Oswald:400,300 http://fonts.googleapis.com/css?family=Roboto+Slab </code></pre> <p>in order to get the font names <code>Oswald</code> and <code>Roboto Slab</code>.</p>
php
[2]
4,715,386
4,715,387
i want the cooment in sert in the upper not in the lowest
<p>hi guys now i searched for comments system one of my friends suggest to me this Advanced PHP Comments System With jQuery and i download from his tutorial like Jooria-Comments-0.02.zip [5.17 KB] <a href="http://www.jooria" rel="nofollow">http://www.jooria</a>. com/downloads/442/Jooria-Comments-0.02.zip</p> <p>its really nice but the only disadvantage is it add the insertedd comment in the bottom of the old comments</p> <p>i want it add the new one in the top on old comments</p>
php
[2]
2,188,405
2,188,406
Android custom keyboard background
<p>How can set the background for the android custom keyboard,i want to set a image as the background for entire keyboard for the android device not for a single keyboard me tried with the attributes like android:keysBackground and android:background but it is not working while doing with the android:keysBackground attribute the image is present as the background for every keys, but i need to a single background for the keyboard like wallpaper plzzzzz help </p>
android
[4]
2,738,178
2,738,179
Memory allocation in Java Strings
<p>If</p> <pre><code>String x = "abc"; String y = "abc"; </code></pre> <p>What is the memory allocation for x and y ?</p>
java
[1]
1,360,437
1,360,438
Initialize a NSDate object with a specific time
<p>I have time in string format for example 2:00.I want to initialize it to NSDate with present date. I tried doing</p> <pre><code> NSDateComponents *comps = [[NSDateComponents alloc] init]; [comps setHour:2]; </code></pre> <p>I am not able to compare this with a date object.Please help</p>
iphone
[8]
3,680,559
3,680,560
asp.net dynamic data NEW custom page ERROR NOT FOUND
<p>iv added a new folder inside my 'customPages' folder 'Check' i've then added a new webform page inside the 'check' folder called 'show'</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="show.aspx.cs" Inherits="DynamicData_CustomPages_Check_show" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; bla bla la &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>when I try to navigate it from another page it wont work ERROR: 28889/CRC/Check/show.aspx</p> <pre><code>The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /CRC/Check/show.aspx </code></pre> <p>any idea as to why?</p> <hr> <p>EDIT:iv even set it as my start page my right clicking, but it still cant find the page?</p>
asp.net
[9]
2,235,575
2,235,576
How to implement the Progressdialog here?
<p>I am saving the imae from drawing canvas. It takes some seconds to geting save to the sdcard. So, During the process of save i want to show the dialog that the Image getting save...</p> <p>So how to implement the progress dialog for that ?</p> <p>The code for Image save is as like below:</p> <pre><code> case R.id.saveBtn: Toast.makeText(getApplicationContext(), "Save", Toast.LENGTH_SHORT).show(); final Activity currentActivity = this; Handler saveHandler = new Handler(){ @Override public void handleMessage(Message msg) { final AlertDialog alertDialog = new AlertDialog.Builder(currentActivity).create(); alertDialog.setTitle("Drawing App"); alertDialog.setMessage("Your drawing had been saved :)"); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { return; } }); alertDialog.show(); } } ; new ExportBitmapToFile(this,saveHandler, drawingSurface.getBitmap()).execute(); break; </code></pre>
android
[4]
2,591,776
2,591,777
How to get document of specific group in sharepoint using C#
<p>Last 3 days i have tried to get ListItem of specific Group in Sharepoint. Bt till now i could not find solution. Can any one give solution? </p>
c#
[0]
168,013
168,014
Execute file in resourses folder without copying it to disk
<p>I have an executable file in the resources folder. I am able to run that file by writing it to the disk then locating the file and use the Process.Start method to run the executable. Here is an example of how I do this:</p> <p><img src="http://i.stack.imgur.com/tdQV7.jpg" alt="enter image description here"></p> <p>How can I execute the file without writing it to the disk. Is there a way I can execute the file from memory? Or maybe execute it directly from the resources folder? </p>
c#
[0]
5,515,991
5,515,992
Android Serialization for saving the data...
<p>i have three classes and want to store all the data of three classes... these classes are composed in main class ... so can any one tell that whether i have implement the Serilzable interface on class or all three classes which are composed....</p>
android
[4]
3,193,874
3,193,875
How to use a dictionary with python requests. - Outdated book. wunderground weather api
<p>I purchase the make projects book for the raspberry pi and one of the scripts is using wundergrund api and then printing the results of stuff such as temp ect.</p> <p>The code has changed and I have tried tweaking the variables but always get an key error :/</p> <p>Here is a <a href="http://pastebin.com/NzQL0UXK" rel="nofollow">sample api</a></p> <p>In the book he provides the code in python but it is using the old api code.. See Pictures</p> <p><a href="http://imgur.com/n4kpsxo,DtYoQhJ" rel="nofollow">http://imgur.com/n4kpsxo,DtYoQhJ</a></p>
python
[7]
5,916,761
5,916,762
Webview: Cannot display local image on phone but displays on emulator
<p>I have went through all the posts on displaying local images on android phone. I can see the local image on emulator but on phone - "Webpage not available". However I can load other webpages on phone with webView.loadUrl("http://www.google.com/");</p> <p>I have set internet permissions</p> <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt; </code></pre> <p>The image is in raw folder and using display.html file to read it</p> <pre><code>WebView webView = (WebView) findViewById(R.id.webview); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setPluginsEnabled(true); webView.loadUrl("file:///android_res/raw/display.html"); </code></pre> <p>// display.html in raw folder</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;/head&gt; &lt;body&gt; &lt;img src="file:///android_res/raw/image.jpg" width="50px" alt="Hello"&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
android
[4]
671,150
671,151
setInterval queuing up while browser in separate tab
<p>How can i stop Javascript from queuing up animations from a setInterval while the page is not the primary tab in view? I've tried clearing the interval on blur of the document but no luck.</p>
javascript
[3]
3,094,856
3,094,857
Dynamically add annotation to an existing class
<p>I have the following class</p> <pre><code>public class Person { ... } </code></pre> <p>I would like to create another class that would look like this.</p> <pre><code>@SomeAnnotation public class Person { ... } </code></pre> <p>Via a simple method like so.</p> <pre><code>public static Class addAnnotation(Class originalType, Class&lt;? extends Annotation&gt; annotation) { // what goes here? } </code></pre> <p>Is there an easy way to do this via ASM for example? What dependencies would I need. I have tried to Google this however the examples I have found are either incomplete or are doing something else. Other frameworks such as javassist would be just as good.</p>
java
[1]
1,622,622
1,622,623
Wait for a network chage in a service, in order to download updates
<p>I have a service which periodically downloads some updates from a web site. Default period is long, about 10 mins and I do that with an AlarmManager which starts this service.</p> <p>Network can be on or off, <strong>in case it's off service should download news as soon as network returns on</strong>, because interval is long and, in the worst case, you could have to wait 20 min till next update.</p> <p>I made a network state broadcast receiver, and, with little code I made a NetworkListener interface:</p> <pre><code>public interface NetworkStateListener { public void onNetworkOn(); public void onNetworkDown(); } </code></pre> <p>So my service has these 2 methods and <strong>can know when network goes on or off</strong>.</p> <p>My idea is the following: in the onStart() method I spawn a new thread: if network is off thread waits, otherwise downloads. When onNetworkOn() is called I call a notify():</p> <pre><code>private boolean threadWaiting; //a flag so that I don't spawn multiple threads public int onStartCommand(Intent intent, int flags, int startId) { if(!threadWaiting){//if already a thread waiting do nothing and exit Thread t = new Thread(new Runnable(){ @Override public void run() { synchronized(binder){ while(!isNetworkOn()) try { threadWaiting = true; binder.wait(); }catch(InterruptedException ex){ ex.printStackTrace(); } } // blocks until network connection is available threadWaiting = false; //... operations ... </code></pre> <p>And this is onNetworkOn() method:</p> <pre><code>public void onNetworkOn() { synchronized(binder){ binder.notify(); } </code></pre> <p>is this the right way to proceed?</p>
android
[4]
4,680,577
4,680,578
Calculate with literals that are out of range
<p>I would like to calculate (<code>+</code>,<code>-</code>,<code>*</code>,<code>/</code>) with large integers, say 50-digits long. How can I deal with this, when <code>int</code>, <code>double</code> or <code>long</code> comes too short?</p>
java
[1]
3,517,844
3,517,845
Why doesn't StringBuilder have a trim() method?
<p>Why doesn't StringBuilder have a <code>trim()</code> method? How can we trim a <code>StringBuilder</code> value without using <code>StringBuilder.toString().trim()</code>?</p> <p>Actually i am in a loop where i have to compare this StringBuilder string with many other values so if i call StringBuilder.toString().trim() each time, it will create a new instance and i don't want to create a new String object each time</p>
java
[1]
1,721,403
1,721,404
how to use method 1 variale in method 2
<p>I am new to python and new to programming. I have question how can I use variables from method1 in method too. </p> <p>Example</p> <pre><code> class abc(self): def method1 (self,v1): v1 = a+b return v1 # want to use this value in method 2 def method2(self) v2 * v1 = v3 </code></pre> <p>Thanks</p>
python
[7]
1,421,712
1,421,713
How to make everything lowercase automatically in Javascript as they type it in
<p>How do I make all of the characters of a text box lowercase as the user types them into a text field in Javascript?</p> <pre><code>&lt;input type="text" name="thishastobelowercase"&gt; </code></pre> <p>Thanks for any help.</p>
javascript
[3]
1,520,179
1,520,180
Is there an uniform way to detect the installed java on linux?
<p>Is there a way to detect the installed java on various different Linux distributions? With Windows you could use the JAVA_HOME or the registry for that, but Linux? Can it be also detected if this is JDK, JRE, 32 or 64 bit?</p> <p>REPHRASE: If I need 64-bit JDK on Linux, how do I programatically check that it is present and inform the user that he has some other java instead?</p>
java
[1]
526,430
526,431
Hide select field on external click
<p>I am wondering how should I hide a drop down list by clicking on anywhere in page, I want same function like select field (<code>&lt;select&gt;&lt;/select&gt;</code>) do, if we open any select field and then click anywhere in page it pop back.</p> <p>Let me know if my question is not clear.</p> <p>Thanks.</p>
jquery
[5]
3,469,128
3,469,129
Making a Certain Color on a BufferedImage Become Transparent
<p>A very similar question that has been answered: <a href="http://stackoverflow.com/questions/665406/how-to-make-a-color-transparent-in-a-bufferedimage-and-save-as-png">How to make a color transparent in a BufferedImage and save as PNG</a></p> <p>Unfortunately I couldn't formulate an answer for myself out of that source.</p> <p><strong>Q:</strong> I draw a BufferedImage to my Canvas and would simply like to create a method that turns every pixel with the a certain color (in this case: [214, 127, 255] / 0xD67FFF) into a transparent one. The BufferedImage is of type ARGB. </p> <p><em>I do not want to save the BufferedImage as a file, simply display it on my canvas.</em></p> <p>Thanks in advance.</p>
java
[1]
242,129
242,130
Limiting onTouch ACTION_MOVE to one View
<p>I'm implementing an app that uses part of the screen as a touchpad for the user to manipulate a mechanical device. I want to limit the touchpad behavior to only that <code>View</code>. </p> <p>But if the user puts his finger down <strong>inside</strong> that <code>View</code> and moves it <strong>outside</strong> the <code>View</code> in my <code>onTouch()</code> <code>Handler</code> I continue to get <code>ACTION_MOVE</code> events when the user is dragging outside the <code>View</code>.</p> <p>And the <code>View</code> ID passed-in to <code>onTouch()</code> is still that of the original <code>View</code> even though the events are coming from outside that <code>View's</code> bounds!</p> <p>Why does it do this and how can I constrain events to only within the bounds of that one <code>View</code>?</p> <p>Thanks in advance.</p>
android
[4]
3,547,777
3,547,778
how to read data in array?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4927843/how-to-extract-data-out-of-a-specific-php-array">How to extract data out of a specific PHP array</a> </p> </blockquote> <p>I have an array that I am trying to fetch all elements from a specific key in. The key is <code>shard3</code>. The result should be <code>'user'=&gt;'root','password'=&gt;'3', 'db'=&gt;'test', 'port'=&gt;3307</code> </p> <pre><code> private $shard_list = array ( 'shard1' =&gt; array( 'host'=&gt;'127.0.0.1', 'user'=&gt;'root', 'password'=&gt;'1', 'db'=&gt;'test', 'port'=&gt;3306 ), 'shard2' =&gt; array( 'host'=&gt;'127.0.0.2', 'user'=&gt;'root', 'password'=&gt;'2', 'db'=&gt;'test', 'port'=&gt;3307 ), 'shard3' =&gt; array( 'host'=&gt;'127.0.0.3', 'user'=&gt;'root', 'password'=&gt;'3', 'db'=&gt;'test', 'port'=&gt;3307 ), 'shard4' =&gt; array( 'host'=&gt;'127.0.0.4', 'user'=&gt;'root', 'password'=&gt;'4', 'db'=&gt;'test', 'port'=&gt;3307 ) </code></pre> <p>I want to read all elements in <code>shard3</code>. What is the way to read all elements?</p>
php
[2]
1,179,756
1,179,757
How can i provide Zoomin-Zoomout,Paging functionality in to UIScrollView?
<p>I have an array of Image URl's from that array i have displayed my Images in Scrollview because i want to take the advantage of Paging and zooming so what should i do to achieve this task?suppose my array contains 10 URL then by each time scrolling i should get different image and i could also performing Zooming-In and Zooming-Out any of the 10 Images so please give me some guidelines to achieve my task.Thanks in Advance.</p>
iphone
[8]
4,060,729
4,060,730
How to create application for supporting all android mobile phones (screen and os version)?
<p>need help for multiple screen support in android,I have done for 3.2 inch screen completely.and i have added some hard coded values for layouts and items in it.What size should be the size of images in drawable ldpi,mdpi,hdpi?I want to support all screens(only for mobiles), Please help me..</p> <p>thanks</p>
android
[4]
1,019,936
1,019,937
Problem when converting char* to string
<p>When I convert char* to an string it gives an bad memory allocation error in 'new.cpp' . I used following method to convert char* called 'strData' and 'strOrg' to string.</p> <pre><code> const char* strData = dt.data(); int length2 = dt.length(); string s1(strData); </code></pre> <p>First time it work without any problem. But in the second convertion it gives above error. When I swap the two conversion in the order, it give the error always in the second conversion regardless of the char* I am converting. Whole code is shown in the following.</p> <pre><code> mysqlpp::Query query = conn.query("SELECT data,origin from image where id =2"); mysqlpp::UseQueryResult res = query.use(); mysqlpp::Row eee= res.fetch_row(); mysqlpp::Row::reference dt = eee.at(0); mysqlpp::Row::reference org = eee.at(1); const char* strData = dt.data(); int length2 = dt.length(); string s1(strData); istringstream is1(s1); char * imgData = new char; is1.read(reinterpret_cast&lt;char *&gt; (imgData), length2); delete [] strData; const char* strOrg = org.data(); int length3 = org.length(); string s2(strOrg); istringstream is2(s2); char * imgOrg = new char; is2.read(reinterpret_cast&lt;char *&gt; (imgOrg), length3); delete [] strOrg; </code></pre> <p>This where the error comes from</p> <pre><code> void *__CRTDECL operator new(size_t size) _THROW1(_STD bad_alloc) { void *p; while ((p = malloc(size)) == 0) if (_callnewh(size) == 0) { // report no memory static const std::bad_alloc nomem; _RAISE(nomem); } return (p); } </code></pre> <p>Please help me to solve this problem. It is urgent</p>
c++
[6]
4,579,870
4,579,871
Why do I have to omit parentheses when passing a function as an argument?
<p>I am trying to wrap my head around as to why the following code results in a stack overflow when the parentheses are included, but do not when they omitted. </p> <p>I am calling the function itself as an argument to setTimeout and it works without parantheses, but of course fails when I add them. It was my intuition to add the () after the function. Just hope somebody can clear this up for me. When are parans optional and not?</p> <p>CASE 1:</p> <pre><code>var a = 1; function foo() { a++; document.write(a); setTimeout(foo(), 2000) }​ // RangeError: Maximum call stack size exceeded </code></pre> <p>CASE 2:</p> <pre><code>var a = 1; function foo() { a++; document.write(a); setTimeout(foo, 2000) }​ // parens are omitted on foo function and it works. </code></pre>
javascript
[3]
4,691,655
4,691,656
Getting index error in the code in python
<pre><code>def fact(n): fac = 1 while (n&gt;1): fac = fac*n n -= 1 return fac z = 0 t = int(raw_input()) nz = [] for i in range(0,t): c = 0 n = int(raw_input()) z = fact(n) z = list(str(z)) for j in range(len(z)-1,1,-1): if z[j] != '0': break else: c +=1 nz[i].append(c) for k in range(0,t): print nz[k] </code></pre> <p>Hello I am getting </p> <blockquote> <p>Indexerror : index out of range at " nz[i].append(c)</p> </blockquote> <p>This program should calculate trailing zeros in the factorial of N. Can you also please help me optimize my code, so it can run also for large values of N?</p>
python
[7]
4,532,446
4,532,447
C# timer synchronized with Datetime.Now
<p>In C# how to create a timer that synchronize with tick of system DateTime. custom timer should tick whenever the seconds change for DateTime.Now</p>
c#
[0]
1,015,670
1,015,671
add controls to placeholder control using javascript
<p>i tried to add my element creates using javascript to asp:placeholder control but it is not getting added. pls suggest a possible solution for this. thanks in advance. this is my code:</p> <pre><code> function UpdateLabel(e,newValue) { var characterCode if(e &amp;&amp; e.which){ // NN4 specific code e = e characterCode = e.which } else { e = event characterCode = e.keyCode // IE specific code } if(characterCode==188) { alert(characterCode); var array = newValue.split(","); if(array.length==1) { } else if ((array[array.length-2]!="")) { alert(array[array.length-2]); var controlRef = document.createElement('a'); controlRef.href = '#'; controlRef.innerHTML = array[array.length-2]; controlRef.style.visibility = 'visible'; controlRef.onclick = function () { alert(array[array.length-2]); }; document.body.appendChild(controlRef); var oEL = document.getElementById('&lt;%=PlaceHolder1.ClientID %&gt;'); oEL=document.createAttribute(controlRef); oEL.appendChild(controlRef); alert("oEL:"+oEL); } </code></pre> <p>i tried using insertBefore() also. but that does nt work</p>
javascript
[3]
1,657,821
1,657,822
What's the pythonic way of generating a range of chars?
<p>In other languages, I would use a construct like this:</p> <pre><code>a..z </code></pre> <p>I couldn't come up with a better solution than this:</p> <pre><code>[chr(x) for x in range(ord("a"), ord("z") + 1)] </code></pre> <p>Is there a shorter, more readable way of building such a list ?</p>
python
[7]
4,518,291
4,518,292
how to check if function is being called?
<p>i have a function: </p> <pre><code>function getPricing(ProductID,VariantID) { //alert('VariantID=' + VariantID); if(ProductID == undefined || VariantID == undefined) { return; } var ChosenSize = ""; //var ChosenSizeList = document.getElementById('Size'); var ChosenSizeList = document.getElementById('AddToCartForm_' + ProductID + '_' + VariantID).Size; if(ChosenSizeList != undefined) { ChosenSize = ChosenSizeList.options[ChosenSizeList.selectedIndex].text; } var ChosenColor = ""; //var ChosenColorList = document.getElementById('Color'); var ChosenColorList = document.getElementById('AddToCartForm_' + ProductID + '_' + VariantID).Color if(ChosenColorList != undefined) { ChosenColor = ChosenColorList.options[ChosenColorList.selectedIndex].text; } var url = "ajaxPricing.aspx?ProductID=" + ProductID + "&amp;VariantID=" + VariantID + "&amp;size=" + escape(ChosenSize) + "&amp;color=" + escape(ChosenColor); //alert("Ajax Url=" + url); makeHttpRequest(url,undefined,'pricing'); } </code></pre> <p>But how do i check that its being called? I want to display an alert box.</p> <p>Any ideas?</p>
javascript
[3]
2,272,387
2,272,388
How to remove cookies under 1 domain in CookieContainer
<p>In <code>System.Net.CookieContainer</code></p> <p>if I want to remove all cookies under a domain name, how?</p>
c#
[0]
950,298
950,299
how can I playing an array of data in BD
<p>how can I create a method to play all the data from an array, and to create a while or for to include all records from this array on BD. Since each recodr is consists two columns in the database table. And i had 1000 records. How do I put this array insert to play giving the BD? thank you</p>
java
[1]
721,954
721,955
Binding functions for pages loaded via ajax
<p>I'm a little familiar with <code>jquery.on()</code> function to bind to events, similar to this:</p> <pre><code>$(document).on("mouseover", ".myclass", function() { $(this).customerFunction(); //or something like .tooltip() return this; }); </code></pre> <p>However, how do I bind this <code>customerFunction()</code> to whenever <code>.myclass</code> exists in the HTML, rather than just upon an event? I know I can do <code>$(".myclass").customerFunction();</code> for standard page loads, but it doesn't work if the page is loaded via ajax.</p> <p>Cheers,</p>
jquery
[5]
2,715,474
2,715,475
PHP and Apache configuration in uploading data to database
<p>I encountered problem in my configuration of my php because not all data was uploaded to database eventhougn my files is not large it was only KB. my server is apache. I already edit this:</p> <pre><code>•max_input_time •memory_limit •max_execution_time •post_max_size </code></pre> <p>but still not all data was save to my database.. I tried everything and yet, nothing was change. still not all was save to my database Thank you </p>
php
[2]
914,424
914,425
Timer and DefaultHttpClient
<p>I want to receive json string every minute from https server. Emulator works nice, but on device my widget stops to update info (ignores new json strings) after about 30 minutes. First 30 minutes widget works perfectly.</p> <p>Timer:</p> <pre><code>public void run() { client = new RestClient("https://example.com/check_messages_new.php"); if (userName != null) { client.AddParam("user", userName); client.AddParam("output", "json"); try { client.Execute(RequestMethod.GET); } catch (Exception e) { connect = false; e.printStackTrace(); } } </code></pre> <p>RestClient.Execute():</p> <pre><code> response = new String[3]; response[0] = "0"; Log.d(LOG_TAG, "response[0] set to 0"); HttpParams httpParameters = new BasicHttpParams(); // Set the timeout in milliseconds until a connection is established. int timeoutConnection = 5000; HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection); // Set the default socket timeout (SO_TIMEOUT) // in milliseconds which is the timeout for waiting for data. int timeoutSocket = 25000; HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket); HttpClient client = new DefaultHttpClient(httpParameters); //HttpConnectionParams.setConnectionTimeout(client.getParams(), 25000); HttpResponse httpResponse; try { httpResponse = client.execute(request); responseCode = httpResponse.getStatusLine().getStatusCode(); message = httpResponse.getStatusLine().getReasonPhrase(); HttpEntity entity = httpResponse.getEntity(); if (entity != null) { InputStream instream = entity.getContent(); response = convertStream(instream); // Closing the input stream will trigger connection release instream.close(); } } catch (ClientProtocolException e) { response[0] = "0"; client.getConnectionManager().shutdown(); e.printStackTrace(); } catch (IOException e) { response[0] = "0"; client.getConnectionManager().shutdown(); e.printStackTrace(); } } </code></pre> <p>Thanks for help</p>
android
[4]
3,362,267
3,362,268
Javascript: Detect Changes to JS/DOM on the client side
<p>Is it possible to detect if someone has altered the DOM/JS code on your webpage in the browser?</p> <p>I'm thinking in terms of an online game written in JS, all the game code would be downloaded to the user's machine, which they can then edit to their will by using common script debugging/inspector tools. Are there any methods for detecting if the DOM/JS code has changed?</p>
javascript
[3]
977,748
977,749
Anyway to bring up suggestion box when typing python code
<p>I'm learning wxpython right now and one thing that helps me ALOT is when I'm typing in the text editor I sometimes press the tab key to give me a hint on what I'm looking for...This is great when it works but I notice sometimes it doesn't work and I get lost looking for a syntax I can't remember...</p> <p>Question is how can I get the suggestion box to pop back up again, Or what am I doing that causes it to stop coming up...</p> <p>if it matters I backtracked to 2.7 to learn wx, Windows 7</p> <p>Edit: More specifically... when I type: wx.(Here is normally when I would press tab)</p>
python
[7]
1,442,019
1,442,020
Start Tomcat in windows using java code
<p>I want to start tomcat using java program .</p> <p>I had started in linux using the below code</p> <pre><code>String command = "c:\program files\tomcat\bin\startup.sh"; Process child = Runtime.getRuntime().exec(command); </code></pre> <p>It works fine.</p> <p>I used the following code in windows </p> <pre><code>String command = "c:/program files/tomcat/bin/startup.bat"; Process child = Runtime.getRuntime().exec(command); </code></pre> <p>Its not working .</p> <p>Do i want to configure any other property for windows.</p> <p>Thanks In Advance.</p>
java
[1]
3,103,484
3,103,485
ANSI C++: Differences between delete and delete[]
<p>I was looking a snipset of code:</p> <pre><code> int* ip; ip = new int[100]; delete ip; </code></pre> <p>The example above states that:</p> <blockquote> <p>This code will work with many compilers, but it should instead read:</p> </blockquote> <pre><code> int* ip; ip = new int[100]; delete [] ip; </code></pre> <p>Is this indeed the case?</p> <p>I use the compiler "Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 11.00.7022 for 80x86" and does not complain (first example) while compiling. At runtime the pointer is set to <code>NULL</code>. </p> <p>Do other compilers behave differently? Can a compiler not complain and issues can appear at runtime?</p>
c++
[6]
4,269,794
4,269,795
Display results to another php page from a select statement using a function
<p>I had a hard time solving this: Need help pls..</p> <p>Here's my original code:</p> <hr> <p><strong>function.php</strong></p> <pre><code>public function getTestScriptSummary($projectID){ $sql = "SELECT * FROM tbl_test_script_header WHERE fld_projectID='$projectID'"; $query = $this-&gt;DBH-&gt;prepare($sql); $query-&gt;execute(); while($row = $query-&gt;fetch(PDO::FETCH_ASSOC)){ $testResults .= " &lt;tr&gt; &lt;td style=\"padding:3px;\"&gt;".$row['fld_dateEnded']."&lt;/td&gt; &lt;td style=\"padding:3px;\"&gt;".$row['fld_testerName']."&lt;/td&gt; &lt;td style=\"padding:3px;\"&gt;".$row['fld_scriptID']."&lt;/td&gt; &lt;td style=\"padding:3px;\"&gt;".$row['fld_testPhase']."&lt;/td&gt; &lt;td style=\"padding:3px;\"&gt;".$row['fld_status']."&lt;/td&gt; &lt;/tr&gt;"; } return $testResults; } </code></pre> <p><strong>view.php</strong></p> <pre><code> echo $User-&gt;getTestScriptSummary($_POST['projectName']); </code></pre> <hr> <p>With this code, I got the right answers. But I dont want to display the table (the value in the testResults i mean) here in my function. Instead i want it to display in the view.php. How will i do that? </p>
php
[2]
3,294,578
3,294,579
Why are software like Adobe Photoshop, Adobe Premiere, Autocad, 3ds max, maya, and many others not made from Java?
<p>These software are being used in many platforms so why don't they use Java to develop these software? Why do they make different source code for each platform? </p>
java
[1]
5,148,581
5,148,582
User-agent change in asterisk
<p>I am using the asterisk as a server and I want to change the user-agent in asterisk through the android code. So can anybody help me if know? Thanks in advance.</p>
android
[4]
4,294,252
4,294,253
in Java the arguments are passed by value?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/40480/is-java-pass-by-reference">Is Java pass by reference?</a> </p> </blockquote> <p>Hi guys,</p> <p>I have a question about the arguments passing in Java, I read it from a book <em>"In Java the arguments are always passed by value"</em>, what does this mean? </p> <p>I have no experience of C++ and C, so it is a little bit hard for me to understand it. Can anyone explain me? </p>
java
[1]
3,131,516
3,131,517
Android: How can i display dates on x- axis in AchartEngine linegraph?
<p>I am implementing an app in which i am facing a problem in displaying dates on x-axis? I am getting x and y vaues from webservice. I am getting dates and price values? Can any one you give an example to implement this?</p>
android
[4]
6,015,602
6,015,603
JavaScript Accessing object Properties outside the module
<p>I am newbie to javascript.My question is fairly simple.Question is as follows.</p> <ol> <li>I am having two javascript files one.js and two.js</li> <li><p>In two.js there is function object constructor named CommonOneUi.code for it is shown below.</p> <pre><code>function CommonOneUi(){ this.getSongsButton = getSongsButton;// object method written in two.js } </code></pre></li> <li><p>I am exporting it by writing</p></li> </ol> <blockquote> <p>module.export=CommonOneUi.</p> </blockquote> <ol> <li>I can instantiate the CommomOneUi in one.js file but I am not getting access to getSongsButton property.</li> </ol> <p>How do I access getSongsButton property?</p> <p>Thanks.</p>
javascript
[3]
5,325,333
5,325,334
Animate vertical slide not working
<p><a href="http://iamprincess.com.hk/test/final2.html" rel="nofollow">http://iamprincess.com.hk/test/final2.html</a></p> <p>The horizon slide(left to right) is working, but there's a problem on the vertical slide (top to bottom), it won't slide, what's the problem?</p> <p>Thanks a lot for helping.</p>
jquery
[5]
2,295,091
2,295,092
Accessing music files into my application programatically
<p>How can i access music files in the device into my application programatically?</p> <p>Help me..</p>
android
[4]
674,444
674,445
What are some good resources on developing a site that supports browsers with and without javascript?
<p>I'm building a site that needs to work with browsers that support JavaScript and browsers that don't (or that have it disable). What are some good resources that explain good approaches in doing this? Any specific technologies or frameworks that handle this well?</p>
javascript
[3]
4,882,025
4,882,026
How does delete[] "know" the size of the operand array?
<p><pre>Foo* set = new Foo[100]; // ... delete [] set;</pre>You don't pass the array's boundaries to delete[]. But where is that information stored? Is it standardised?</p>
c++
[6]
2,516,786
2,516,787
String Table RGB values
<p>I am using a string table in my project and I want to store RGB values in it. how do I convert rgb value from LoadString char to something that can be used for COLORREF for CreateSolidBrush.</p>
c++
[6]
237,525
237,526
php: how to read only txt files in a directory
<p>i have a folder called XXX it contains .jpg .gif .txt .... etc</p> <p>i want only to read .txt files how to do that ?</p> <p>Thanks </p>
php
[2]
4,505,715
4,505,716
Is it possible to send parameters by using Header function?
<p>I load Flash file using PHP.<br> <strong>test.php :</strong></p> <pre><code>$widget = WidgetFactory::getInstanceByHash($_GET['hash']); $file = $widget-&gt;getUrl(); $_GET['param1'] = "97df5ea7342b7e55b7ef3d402b585d1a"; header("Content-Type: application/x-shockwave-flash"); readfile($file); </code></pre> <p>The url of <strong>$file</strong> is for example : <em>"http://adresse/component1.swf?param1=XXX"</em><br> If I type <em>"http://adresse/test.php?hash=XXXXXXXXXXXXX"</em> in my browser, I can see the flash file WITHOUT the parameter <strong>param1</strong>.<br> I tried to add : $_GET['param1'] = "97df5ea7342b7e55b7ef3d402b585d1a";<br> But it doesn't works.</p> <p>So, I want to know if it is possible to add parameters by using header function...</p>
php
[2]
973,722
973,723
What's the version of ADT for Android 4.2?
<p>My question is : is the ADT related to a specific android version? i mean when we say for exp android 4.2 is that mean that we are using ( the plugin) ADT 21.0.1?? or Android version and ADT version are not realated?</p>
android
[4]
4,455,452
4,455,453
ClearInterval() and SetInterval()
<p>So in my javascript code, there is a part where if the user clicks on the checkbox I need to change the time delay used by <code>setInterval()</code>. At the moment, I used the <code>onchange</code> handler on the checkbox. Whenever the checkbox is changed, I call <code>clearInterval()</code> and <code>setInterval()</code>. I have the interval id as a global variable. Now if the user changes the checkbox before i have made my call to <code>clearInterval()</code> I expected there to be some issues, but nothing happened. Is there a better way to do this or is this way considered standard? Is there a way to check if there is an <code>interval</code> in existence?</p> <p>PS. I'm very new to Javascript, started it about 5 hours ago.</p>
javascript
[3]
62,288
62,289
my php code don't work result
<p>I have an issue in my php script when I enter a correct username it echo "user found" and when </p> <p>I enter wrong user name it echo also "user found".</p> <p>Here is my code please check and let me know, if !$result variable supposed to work but didn't. Why?.</p> <pre><code>&lt;?php echo "enter the username \n"; $username = trim(fgets(STDIN)); echo "enter the password\n"; $password = trim(fgets(STDIN)); //connecting to database $db = mysql_connect("localhost","sqldata","sqldata") or die(mysql_error()); //selecting our database $db_select = mysql_select_db("accounts", $db) or die(mysql_error()); $result= mysql_query("select * from login where username = '$username' "); if (!$result) { echo "error no user"; } else { echo "user found"; } mysql_close($db) ?&gt; </code></pre>
php
[2]
5,949,608
5,949,609
Why is it not ok to catch Exception instead of the more specific URLError?
<pre><code>try: response = urllib2.urlopen(req) except Exception, e: logger.exception(e) </code></pre> <p>Is there any convincing argument against catching <code>Exception</code> instead of <code>urllib2.URLError</code> in this code snippet ? </p>
python
[7]
1,637,764
1,637,765
PHP value doesn't equal to what it echoes
<p>I got a value in <code>$array[1]</code> and I want to know what it is, so I can compare it in other parts of my code.</p> <p>So I echo out $array[1] and I get "vrij &amp;nbsp &amp;nbsp " or "vrij "</p> <pre><code>$value = $array[1]; echo $value ; // outputs "vrij " if($value = $array[1]){ echo "TRUE 1"; } if($value = "vrij "){ echo "TRUE 2"; } </code></pre> <p>The problem is, it only echo's TRUE 1. I copy pasted the echo exactly but it doesn't return TRUE 2</p>
php
[2]
1,056,398
1,056,399
the meaning goto _L1
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2036984/recompile-decompiled-java-jd-jad-source-that-contains-goto-instructions">Recompile decompiled Java (JD / JAD) source that contains goto instructions</a> </p> </blockquote> <p>what's the meaning of goto _L1 when i decompile class java </p>
java
[1]
2,534,289
2,534,290
Change image by current time
<p>I have two images. I want to display one image if its day and another if it night. This should be done using javascript. For example display one image from 8:00 to 00:00 and another from 00:00 to 8:00. Is that possible using javascript?</p>
javascript
[3]
2,232,568
2,232,569
Getting Device Type and Android SDK from Crash Reports
<p>The marketplace crash reports do not provide enough information about what version of android is being used for me to replicate the errors. How can I request that more information be provided on crash reports.</p>
android
[4]
329,246
329,247
How to store intervals and lookup interval by value?
<p>I have a list which have three objects suppose name it as data.</p> <ol> <li>data[0] has 0-6</li> <li>data[1] has 6-13</li> <li>data[2] has 13-23</li> </ol> <p>I have a method and it has two arguments one is <code>starttime</code> and another is <code>endtime</code>. My requirement is if the input values are in between the first object then this method will return the first object. If the input values are in between the first two objects then the method should return the first two objects. How can I do this. Can any one tell me?</p>
java
[1]
2,227,025
2,227,026
iPhone:Effects for recorded video?
<p>I have a program to allow user to record the video. I have to provide options like Black&amp;White, Crystal etc. like how "Viddy" iPhone application does for setting more Effects to the recorded video. How can i achieve it programmatically?</p> <p>Please guide me.</p> <p>Thank you!</p>
iphone
[8]
1,012,818
1,012,819
What is the search keyword for 'two enum members ORed together' usage?
<p>what kind of usage? i don't know it's custom name. what can i write on google to search below kind of codes...</p> <pre><code>service.TraceFlags = TraceFlags.EwsRequest | TraceFlags.EwsResponse; </code></pre>
c#
[0]
1,240,105
1,240,106
what is purpose of bit shifting?
<p>In C++, sometimes, I see code like this:</p> <pre><code>unsigned char A = 0xB9; unsigned char B = 0x91; unsigned char C = A &lt;&lt; 3; // shift bits in A three bits to the left. unsigned char D = B &gt;&gt; 2; // shift bits in B two bits to the right. </code></pre> <p>I know that it's bit-shifting, but I don't know what is its purpose and when we should use it? Can anyone explain?</p>
c++
[6]