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 |
|---|---|---|---|---|---|
1,419,957 | 1,419,958 | Python - open a command which open another shell | <p>I am writing a Python code which calls a command line (e.g. python itself) and the command will open its own shell. How can Python take control of this shell?</p>
<pre><code>import subprocess
subprocess.call(['./testprg'])
# testprg will open its own shell
# so the code below will not work
subprocess.call(['i 2']... | python | [7] |
5,753,217 | 5,753,218 | Specifying rowfilter criteria to be evaluated in DataTable event handlers | <p>We have a mini business application framework of our own to meet our custom needs. We are using datatables in our business classes for storing collections (e.g. detail data). Our framework identifies any datatable type properties declared in a business object and attaches a few event handlers to provide services lik... | c# | [0] |
5,565,786 | 5,565,787 | Matt Ryall’s jQuery live filter - only return results that start with the string? | <p>Can Matt Ryall’s jQuery live filter be modified to only show results that begin with the search text? </p>
<p><a href="http://mattryall.net/blog/2008/07/jquery-filter-demo" rel="nofollow">http://mattryall.net/blog/2008/07/jquery-filter-demo</a>
Thanks</p>
| jquery | [5] |
704,718 | 704,719 | alias conflict namespace c# | <p>Looking for an explanation. </p>
<p>I have the same name space in two different assemblies. Say </p>
<pre><code>NsA.xxx.NsB
</code></pre>
<p>Now I created an alias to resolve the issue and called it xxx.<br>
I left "global" as the alias namespace for the other assembly. </p>
<p>The trouble is that "xxx" as a... | c# | [0] |
757,705 | 757,706 | How to insert an item at the beginning of an ObservableCollection? | <p>How can I do that? I need a list (of type <code>ObservableCollection</code>) where the latest item is first.</p>
| c# | [0] |
4,482,701 | 4,482,702 | C# - Prevention of automatic timezone conversion of datetime values while getting data from database through WCF | <p>I am working on a C# client server application with the server in a different geographical region than the client ie. across time zones. The application makes use of WCF as the middle tier between the UI and Server.
Our requirement is to fetch data from the database and display it in the UI.
The problem is that the ... | c# | [0] |
2,426,619 | 2,426,620 | How can I refer to class variable in a function without referring to its class in Python? | <p>I have a following class:</p>
<pre><code>class Foo:
CONSTANT = 1
def some_fn(self):
a = Foo.CONSTANT
# do something
</code></pre>
<p>How can I refer to <code>Foo.CONSTANT</code> without referring to <code>Foo</code>, or refer to <code>Foo</code> in a generic way? (I don't want to change al... | python | [7] |
519,952 | 519,953 | how instance of class is creating recursively and thus causing stackoverflow error | <p>Consider following 2 programs giving same error<br>
First calss:</p>
<pre><code>public class Testing {
Testing t=new Testing();
public static void main(String args[]){
testing t1=new testing();
}
}
</code></pre>
<p>Second class:</p>
<pre><code>class foo{
void baz(){
... | java | [1] |
5,622,813 | 5,622,814 | Is there a Newline constant defined in Java like Environment.Newline in C#? | <p>In C# there is the static property <a href="http://msdn.microsoft.com/en-us/library/system.environment.newline.aspx" rel="nofollow">Environment.Newline</a> that changed depending on the running platform.</p>
<p>Is there anything similar in Java?</p>
| java | [1] |
638,121 | 638,122 | passing element reference through dynamically created html | <p>Lets say that I have a element reference obtained ala...</p>
<pre><code>var x=document.getElementById("ID123");
</code></pre>
<p>Now I want to include some function of x on a dynamically created html element ala...</p>
<pre><code>myWin.document.write("<input type='button' data-doit=????? value='Do It' onc... | javascript | [3] |
3,877,288 | 3,877,289 | How to change the frame of AlertView in iPhone App...? | <p>I want to Add TextBox on AlertView. But When i'm adding, it overlaps little with buttons on it...So i want to increase the height and width of alertview...Could Anybody tell any idea??</p>
| iphone | [8] |
3,675,566 | 3,675,567 | Attach a pan gesture recognizer an image | <p>Could someone guide in what I need to do? I need to attach a pan gesture recognizer to an image which rotate clockwise and anticlockwise as we move.</p>
<p>Thanks</p>
| iphone | [8] |
1,078,516 | 1,078,517 | How to show bg color in fadeIn effect and remove style properties using jQuery | <p>i want to change background color on hover function but i want to show in slow motion. Also i am adding some CSS Property on hover and want to remove and hover out. But my function does not work according to my requirment.</p>
<pre><code>$(function (){
$('.box').hover(function (){
$('body').css({'... | jquery | [5] |
2,269,601 | 2,269,602 | Persisting data between crashes | <p>We're going to be building an application that manages multiple types of queues. I'm looking into the best ways to not lose data if the application crashes for any reason. I've done some googling using the term "persisting" which leads me to JPA over and over. I have some experience with JPA. I'm no expert on th... | java | [1] |
1,077,744 | 1,077,745 | JavaScript use constructor parameters in methods, which way is valid? | <p>I have js object like this:</p>
<pre><code>var Dog = function(dogName) {
this.bark = function() {
console.log(dogName + " is barking");
}
}
</code></pre>
<p>and </p>
<pre><code>var Dog = function(dogName) {
this.dogName = dogName;
this.bark = function() {
console.log(this.dogName + " is barking");... | javascript | [3] |
3,411,855 | 3,411,856 | message error: Cannot access mscorlib.dll | <p>I am using snippetcompiler. I once added references to .NET 3.5 and the remove them but since I got this error each time I run a cs file:</p>
<p>cannot copy v2...\mscorlib.dll to c:\windows\system32</p>
<p>How to correct this if someone knows ?</p>
| c# | [0] |
3,439,467 | 3,439,468 | Best ASP.NET Websites for Sample Code / Code Projects | <p>I am new to .NET development. </p>
<p>Would you please let me know few best ASP.NET Websites for Sample Code / Code Projects?</p>
<p>Thank you & Regards.</p>
<p>Shravya.</p>
| asp.net | [9] |
5,258,076 | 5,258,077 | How often should I use try and catch in C#? | <p>When writing a C# application whose #1 priority is to <b>never crash</b>, how often should I used a try-catch block?</p>
<p>Can I encapsulate all the statements in a method in try-catch blocks?</p>
<pre><code>public void SomeMethod()
{
try
{
// entire contents of the function
// library cal... | c# | [0] |
3,755,680 | 3,755,681 | How To Handle An InvalidOperationException In A foreach Loop Containing yield return? | <p>I have the following code in which I am trying to take each element returned by an ICollectionView and translate it into a different object.</p>
<pre><code> public IEnumerator GetEnumerator()
{
foreach (TOriginal original in _collectionView)
{
if (!Equals(original, null))
... | c# | [0] |
4,950,172 | 4,950,173 | Implementation of **kwargs construct in python | <p>I implemented a class in python which currently inherits from dict, but really, I don't want it to. The main reason for inheriting is so that I can use the **kwargs construct for copying the contents into an argument list.</p>
<p>I presume python does some sort of iteration over the dictionary, but I can't find any... | python | [7] |
178,648 | 178,649 | php difference between function exit and return false | <p>I have seen at the end of the function sometimes written "return false" also "exit". What is the main difference between these two and in which kind of situations are these two required?</p>
| php | [2] |
2,641,192 | 2,641,193 | Need help designing application with UIPageControl and UIScrollView | <p>I have looked at the PageControl example from Apple and have an architectural requirement difference. In the example the scroll view and page control objects are at the app delegate level. This means the scroll view and page control appears on every view of the application.</p>
<p>However, I have a "settings" vie... | iphone | [8] |
2,305,165 | 2,305,166 | Drupal and CodeIgniter | <p>im still in learning process on learning Drupal and CodeIgniter but i was thinking if it is possible to create a web application using Drupal as a CMS and CI as a framework?</p>
| php | [2] |
3,899,317 | 3,899,318 | Not able to uploade website on server | <p>I am try to uploading website.I don't know how configure database(web.config file) on uploading time.I am using Somee.com , anyone familiar with somee.com Or know how to configure database the please help me.</p>
<p><strong>webconfig file code</strong></p>
<pre><code><configuration>
<connectionStrings>... | asp.net | [9] |
3,896,162 | 3,896,163 | Appending Jquery HTML? | <p>I am trying to append the text of a link inside a <code><li></code> to a <code><ul></code> The problem is getting it to scan through and find duplicates and not add a new <li>. </p>
<p>Here is the code:</p>
<pre><code>$('.popular-list li a').live("click",function() //this will apply to all anchor tags
... | jquery | [5] |
2,562,170 | 2,562,171 | Android 2D Game Architecture | <p>I am creating a 2d puzzle game on android and want to get the community's input on a design decision. The basic design is this. There is a SurfaceView one which the 2d graphics are drawn in a background thread. Then I also have a RelativeLayout that overlays the surface view. The layout .xml looks like this:</p>
<p... | android | [4] |
1,921,328 | 1,921,329 | Probem with access an element with '::' in id | <p>In following fiddle : <a href="http://jsfiddle.net/Q9sHz/5/" rel="nofollow">http://jsfiddle.net/Q9sHz/5/</a></p>
<p>I have an <li> with id "test1::newtest"</p>
<p>When I press button - enable 'Li Point1' the <li> element Li Point1 remains un draggable but if I remove the :: from the id as in fiddle : <a href="http... | jquery | [5] |
3,602,263 | 3,602,264 | Show only a part of string in a TextView | <p>I am trying to accomplish a currency converter app for android and I'm using Google Currency Converter to do it by sending an URL with this form :</p>
<pre><code>http://www.google.com/ig/calculator?q="amount""from currency code"=?"to currency code"
</code></pre>
<p>Example :-</p>
<pre><code>http://www.google.com/... | android | [4] |
2,244,387 | 2,244,388 | How to make background (Black portion) of showed Image transparent and draw on canvas in android? | <p>I am working on photo puzzle . So u all can understand what I have to do. I have problem on specific area discussed below ::
I have a canvas. Mask an image with this bitmap shown below. The White portion is changed/replaced by image say mBitmap and black portion remain black. I need to make the black portion transpa... | android | [4] |
1,568,491 | 1,568,492 | Manually throw an exception | <p>How would I manually throw an <code>IndexOutOfBoundsException</code> in Java and optionally print a message?</p>
| java | [1] |
3,834,021 | 3,834,022 | Clear an input field after submission using JavaScript | <p>I am a JavaScript newbie. I have an input text field that I wish to clear after pressing the form submit button. How would I do that?</p>
| javascript | [3] |
4,534,500 | 4,534,501 | Android Button Reference? | <p>So I'm having some issues with a method I'm going to be using to change a button's color based on a number received from the game engine (so if it returned 0 it would be red, 1 would change it to blue, 2 would change it to yellow) but I keep getting errors when trying to reference the button.</p>
<p>I'm referencing... | android | [4] |
5,122,386 | 5,122,387 | FaceDetection onLine API in Android | <p>Can any one tell me which is the best way for onLine FaceDetection in Android. Is there any API for the same? If yes, then how we can implement that? Please suggest me for the right solution.</p>
<p>Thanks in advance.</p>
| android | [4] |
4,547,245 | 4,547,246 | What does this mean? $length = null === $length ? strlen($data) : (int)$length ; | <p>I'm aware of ternary operator, more or less.
But I'm unable to read this line.</p>
<pre><code>$length = null === $length ? strlen($data) : (int)$length ;
</code></pre>
<p>What does $length = null === $length means?</p>
<p>Thanks a lot,
MEM</p>
| php | [2] |
3,561,684 | 3,561,685 | Sliding div not moving smoothly | <p>I have a slider which im trying to slide by using mouse move but it doesn't move naturally it jumps in stages but i do not know why.</p>
<p>I have a jsfiddle here:
<a href="http://jsfiddle.net/97Mnf/3/" rel="nofollow">http://jsfiddle.net/97Mnf/3/</a> you will see the slider doesn't move with the mouse properly.</p>... | javascript | [3] |
4,700,166 | 4,700,167 | List Table Creation in Java | <p>I'm trying to create a list as below in Java. Maybe I'm naive to OOP and Java, therefore I'm not able to resolve it.</p>
<p>I need to create a below table</p>
<pre><code>Character Count Price
A 1 2
B 1 12
C 1 1.25
D 1 0.15
A 4 7
C 6 ... | java | [1] |
5,164,209 | 5,164,210 | Refresh JavaScript section only? | <p>I have a section of JavaScript that displays the current temperature, but it does not update as the temperature changes. Is there a way to have that section of JavaScript update on a timer?</p>
<p>EDIT: Sorry, here's the code (not created by me).</p>
<pre><code><script type="text/javascript" src="http://ajax.go... | javascript | [3] |
642,212 | 642,213 | The TargetControlID is not valid / adding a control to a form in the asp.net code | <p>I am trying to add a control that I define in C# to my asp code, by doing this in my code:</p>
<pre><code><% this.Controls.Add(blah.GetControl()); %>
</code></pre>
<p>but I get the error: The TargetControlID of 'a8f08c40d0fab104ca20b1460ee1cbdd1e121' is not valid. The value cannot be null or empty.</p>
<p>T... | asp.net | [9] |
2,894,620 | 2,894,621 | Is arr.length=0 better than arr=[] in javascript while reseting | <p>I'm improving the performance of a HTML5 Game,while I reset some arrays,in order to reduce the garbage collection,I tend to use array.length=0(Yet I'm not sure if it's working in real world)<br>
I did some tests to find out the speed of these 2 types of reset array here<br>
<a href="http://tinkerbin.com/hqQvp5fQ" r... | javascript | [3] |
1,946,812 | 1,946,813 | Java - Key-Value Decision Making | <p>What would be the best way to store the following Business Rules in a File so that they can be applied on the input values which would be keys?</p>
<pre><code>Key-INDIA; Value-Delhi.
Key-Australia; Value-Canberra.
Key-Germany, Value-Berlin.
</code></pre>
<p>One Solution :- Xml</p>
<pre><code><Countries>
&... | java | [1] |
4,113,787 | 4,113,788 | modify function and If statement | <p>I have a inputbox that displays a default text "Input Network ID Here...". I need to take <code>$inputUri</code> and check it against function <code>checkUrl($string)</code> to see if its still there. If the text hasn't been cleared then display the <code>addError</code> message </p>
<pre><code>public function chec... | php | [2] |
3,162,351 | 3,162,352 | Blocking access to my app's database | <p>I need to block user access to my app's data stored in the SD card... like the images etc as they are crucial to my app's proper functioning and if deleted by mistake, will cause the application to function way different from what is expected of it. Is there any way to do so programmatically, like when I create this... | android | [4] |
4,107,018 | 4,107,019 | beginner java - how to check if integer is in a given range? | <p>Hoping for something more elegant than</p>
<pre><code>if (i>0 && i<100)
</code></pre>
| java | [1] |
2,570,583 | 2,570,584 | Deactivate/activate link with jQuery? | <p>I'm looking for a simple solution to deactivate/activte button links. I could use addClass/removeClass to change the color to gray when deactivated, but there is still possible to click on the link. Is there a way to handle this?</p>
| jquery | [5] |
2,278,504 | 2,278,505 | removing last 3 characters on a file (file extension) | <p>my file name are being stored in a variable <strong>$file_name</strong>... how can i remove the extension and just have the name only? is there something other than strcmp that i can use... that doesn't seem to do it</p>
| php | [2] |
2,291,144 | 2,291,145 | Total a natural number with real number by php? | <p>How can increase a number according to percent with PHP?</p>
<p>For example: <code>100 + 20% = 120</code> or <code>1367 + 33% = 1818.11</code></p>
<p>If output was this: <strong>1818.11</strong> i want only this: <strong>1818</strong> or this <strong>12.32 = 12</strong> or <strong>546.98 = 546</strong></p>
<p>How... | php | [2] |
1,731,198 | 1,731,199 | Compile an exe file inside c++ | <p>I want to create a c++ program in which</p>
<ol>
<li><p>I can read an external file (that can be exe,dll,apk...etc...etc). That is read the file convert them into bytes and store them in an array</p></li>
<li><p>Next,I want to compile the bytes inside the array
Now this is the tricky part i want to compile the byte... | c++ | [6] |
780,880 | 780,881 | javascript validate uk date | <p>I am trying to validate a date in the format dd/mm/yyyy using a function I have found online, but I get this error : 'input is null'</p>
<p>Can anybody tell me where my syntax is wrong?</p>
<pre><code>if (validateDate($("#<%=StartDate.ClientID%>")) == false) {
alert("not date");
}... | javascript | [3] |
1,931,630 | 1,931,631 | is java an open source programming language? | <p>i know about python, ruby, perl etc.. but is java a really open source programming language?
because i searched on google too but didnt get proper answer. so asking here</p>
| java | [1] |
3,340,009 | 3,340,010 | transpose number to USD | <p>I have</p>
<pre><code>onclick="document.getElementById('field1').value =
(Math.round((parseFloat(document.getElementById('field2').value,2)*100))/100 +
Math.round((parseFloat(document.getElementById('field3').value,2)*100))/100).toFixed(2);"
</code></pre>
<p>Field 2 and 3 are text input (numeric values). How ca... | javascript | [3] |
4,708,159 | 4,708,160 | python line separated values in a text when converted to list, adds "\n" to the elements in the list | <p>I was astonished that a thing this simple has been troubling me. Below is the code</p>
<pre><code>list = []
f = open("log.txt", "rb") # log.txt file has line separated values,
for i in f.readlines():
for value in i.split(" "):
list.append(value)
print list
</code></pre>
<p>The output is </p>
<pre... | python | [7] |
1,913,971 | 1,913,972 | How best to convert a byte[] array to a string buffer | <p>I have a number of byte[] array variables I need to convert to string buffers.</p>
<p>is there a method for this type of conversion ? </p>
<p>Thanks </p>
<p>Thank you all for your responses..However I didn't make myself clear....
I'm using some byte[] arrays pre-defined as public static "under" the class declarat... | java | [1] |
5,467,289 | 5,467,290 | Error using double quotes in a string in javascript | <p>I need to put this string in a variable:</p>
<pre><code>chart cid="20"
</code></pre>
<p>but when I escape: <code>\"</code> this way:</p>
<pre><code>AddSettings = AddSettings + "chart cid=\"0\"";
</code></pre>
<p>I still get a javascript error and the sentence shows up in the browser insted of get into the <code>... | javascript | [3] |
1,169,299 | 1,169,300 | How to find status bar of a browser is appearing or not through jquery | <p>I am trying to create a small site. For that i designed some layout. Every thing is fine except the height. I am giving the main div height as the height of the document with <code>$(document).height()</code>. Because of the status bar, i have to reduce the 2pixels from the resultant height. In IE9 looking good. But... | jquery | [5] |
1,483,119 | 1,483,120 | How to Pre validate Image size in fileupload | <p>I have a fileupload control. I want, when a user browse a image through this control of size more than 50 kb , an error message should display. How to do this?
I have one customvalidator as below...</p>
<pre><code><asp:FileUpload ID="Fileupload1" runat="server"/>
<asp:CustomValidator ID="CustomValidator1"... | asp.net | [9] |
1,728,195 | 1,728,196 | providing animation to an image in android | <p>I am working on an android application which involves saving images in database.Now i am struck in a problem.I have to animate the image on android emulator.Can anyone help me ..</p>
<p>Thanks in advance
Tushar Sahni</p>
| android | [4] |
5,720,324 | 5,720,325 | Clipboard Task error | <p>Here is the error I am getting:</p>
<blockquote>
<p>An exception of type 'System.Threading.ThreadStateException' occurred
in System.Windows.Forms.dll but was not handled in user code</p>
<p>Additional information: Current thread must be set to single thread
apartment (STA) mode before OLE calls can be ma... | c# | [0] |
2,737,108 | 2,737,109 | Multiple constructors with one parameter | <p>So, at school we got an assignment to make a car in OOP, until now its been pretty easy and straight forward. But now I need to create four constructors, one with no parameters, two with one parameter and one with two parameters.</p>
<p>As far as I know the way overloading works is that it checks the amount of para... | c# | [0] |
3,498,618 | 3,498,619 | Don't convert newline when reading a file | <p>I'm reading a text file:</p>
<pre><code>f = open('data.txt')
data = f.read()
</code></pre>
<p>However newline in <code>data</code> variable is normalized to LF ('\n') while the file contains CRLF ('\r\n').</p>
<p>How can I instruct Python to read the file as is?</p>
| python | [7] |
2,717,583 | 2,717,584 | Seeking open source or LGPL repalcement for var_dump() | <p>Before I code my own ... I have tried all the code in the PHP manual and not of it is very good. I have Gogoled for hours, but tend to find only GPL code, which can't be included in a commercial product (I'm just a guy trying to make a few bucks on the side, not working for a mega-corporation which could develop or ... | php | [2] |
5,616,687 | 5,616,688 | how to bring up an alarm sound chooser | <p>I have found out how to bring up a ringtone chooser with...</p>
<pre><code>Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
startActivityForResult( intent, 999);
</code></pre>
<p>...but can not find the equivalent for choosing the <strong>alarm</strong> sound. Is it a similar method?</p>
| android | [4] |
3,039,787 | 3,039,788 | Set select list to current date and next day with leading zeros | <p>I've got a problem passing off date information to another site because they still require two digit dates even for the first nine days of the month. I've gotten 90% of the way using the code from the SO page for <a href="http://stackoverflow.com/questions/8164508/set-select-list-to-current-date-using-jquery">set se... | jquery | [5] |
6,011,930 | 6,011,931 | Javascript alert message contains URL | <p>I am using the following javascript function:</p>
<pre><code><!-- Notifying message at the beginning of openning the website -->
<script language="javascript" type="text/javascript">
alert('Sorry!');
</script>
<!--End -->
</code></pre>
<p>I want to add the URL after "(So... | javascript | [3] |
1,053,386 | 1,053,387 | iPhone: How do I create a simple Done button? | <p>Newbie alert! I have a simple calculator with 4 text input fields. When I tap into a field the number pad appears and I enter numbers. No problems so far. Now, when testing this using the simulator I press return on the keyboard and using TextFieldShouldReturn my fields perform their calculations perfectly and t... | iphone | [8] |
2,928,380 | 2,928,381 | PHP Rename problem! | <p>I have a problem using php rename function. If I use the following syntax it works fine.</p>
<pre><code><?php
rename("pages/file.php", "pages/xfile.php");
?>
</code></pre>
<p>but instead if I use this:</p>
<pre><code><?php
$val = '"pages/file.php"';
$rval = '"pages/xfile.php"';
rename($val, $rval);
?>... | php | [2] |
3,316,579 | 3,316,580 | Accessors: setter does not work | <p>I am playing with Javascript accessor properties (I am restarting from zero to study javascript), trying to create getter and setter for a simple object, here the code:</p>
<pre><code>var dummy = {
name: 'empty',
description: 'static description',
get nameAccessor(){return 'name value is: '... | javascript | [3] |
4,372,213 | 4,372,214 | How to dismiss progressdialog if mp3 is already playing in android | <p>My question is how do you dismiss the ProgressDialog if mp3 is already playing?</p>
<p>Please check what I have tried so far:</p>
<pre><code>mediaPlayer.setDataSource(timelessFuture);
mediaPlayer.prepare();
// gets the song length in milliseconds from URL
mediaFileLengthInMilliseconds = mediaPlayer.getDuration()... | android | [4] |
4,226,764 | 4,226,765 | How can I clean stuff up on program exit? | <p>I have a command line program that wants to pickle things when I send it a ctrl-C via the terminal. I have a some questions and concerns: </p>
<ol>
<li><p>How do I perform this handling? Do I check for a KeyboardInterrupt? Is there a way to implement an exit function? </p></li>
<li><p>What if the program is halted ... | python | [7] |
1,207,925 | 1,207,926 | Unable to filter a listview with 2 lines | <p>I am trying to provide a searchable listview. Each listitem has a name & address text box but I only want to filter on the name. My current code does nothing, i.e no filtering occurs at all. Is there a way of setting the column to filter by?</p>
<pre><code> //class variables
private SimpleCursorAdapter mA... | android | [4] |
102,346 | 102,347 | C# method lines program | <p>I need method of lines, so that when you have method call <code>Rows (4)</code>, a method prints four blank lines.</p>
<p>This is my code but it wont work, tell me what is wrong?</p>
<pre><code>namespace something
{
class Program
{
static void Main(string[] args)
{
Console.Write("give number... | c# | [0] |
2,509,244 | 2,509,245 | Java read utf-8 encoded file, character by character | <p>I have a file saved as utf-8 (saved by my application in fact). How do you read it character by character?</p>
<pre><code>File file = new File(folder+name);
FileInputStream fis = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fis);
DataInputStream dis = new DataInputStream(bis);
</code... | java | [1] |
2,479,961 | 2,479,962 | Implementing non member functions | <p>I am working on an assignment and have hit a wall on a particular area. I can't figure out how I am supposed to implement the non member functions from the header into the .cpp file. Here is the header:</p>
<pre><code>class complx
{
double real, imag;
public:
complx( double real = 0., double imag = 0.); /... | c++ | [6] |
3,060,959 | 3,060,960 | place text over capture image in Android? | <p>I am working on an fun application in android. In which I need to capture an image and just after that before saving I need to add some text over the captured image.
Is it possible to edit captured image at run time in android please suggest me.
Thaanxx in advance..!</p>
| android | [4] |
1,965,953 | 1,965,954 | line of error appears when passing a message in php | <p>i been working in the login code .. it works fine except this message that appears when openenig the login page !!</p>
<pre><code>Notice: Undefined index: msg in C:\xampp\htdocs\thesite\login.php on line 103
</code></pre>
<p>it has appeard when i typed this in loginExcution.php</p>
<pre><code> else {
... | php | [2] |
3,549,210 | 3,549,211 | Background distorted | <p>I'm using android:background="@drawable/home_background"
but on switching the screen to landscape , the image gets distorted and stretched too much . The picture is a .jpg</p>
| android | [4] |
898,784 | 898,785 | auto implement in c# | <p>i need info about what auto implement in c# is?and how can i use it?thanks</p>
| c# | [0] |
1,812,965 | 1,812,966 | Trigger hover effect over another element when hovering an element | <p>I am having issues with this: I want to force a hover function over the image when infact hovering over the h3 element</p>
<p>html:</p>
<pre><code><p><a><img class="size-full wp-image-1236 alignleft" alt="phone-icon-red" src="..." width="50" height="50" /></a></p>
<h3>Contact Us... | jquery | [5] |
517,340 | 517,341 | Joining elements of a list | <p>I have a list of tuples like:</p>
<pre><code>data = [('a1', 'a2'), ('b1', 'b2')]
</code></pre>
<p>And I want to generate a string like this: <code>"('a1', 'a2'), ('b1'. 'b2')"</code></p>
<p>If i do something like: <code>','.join(data)</code>, I get an error: </p>
<pre><code>TypeError: sequence item 0: expected s... | python | [7] |
272,361 | 272,362 | C++ compiler structures such as Virtual method Table etc | <p>I am aware of the C++ Virtual Table which allows dynamic dispatch for doing things at runtime (although if I am honest I am not completely sure of the full list of things it achieves).</p>
<p>I am wondering what other "low level" aspects of C++ are there, which one doesnt usually come across when learning the C++ l... | c++ | [6] |
3,249,695 | 3,249,696 | C++ - Namespace vs. Static Functions | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1434937/namespace-functions-versus-static-methods-on-a-class">Namespace + functions versus static methods on a class</a> </p>
</blockquote>
<p>I want to group similar functions togther. I can do it one of two w... | c++ | [6] |
2,492,786 | 2,492,787 | How does variable assignment work in JavaScript? | <p>So I was playing around the other day just to see exactly how mass assignment works in JavaScript.</p>
<p>First I tried this example in the console:</p>
<pre><code>a = b = {};
a.foo = 'bar';
alert(b.foo);
</code></pre>
<p>The result was "bar" being displayed in an alert. That is fair enough, <code>a</code> and <c... | javascript | [3] |
5,420,441 | 5,420,442 | how to dynamically generate page numbers and only load the corresponding page in the grid? | <p>I need to load data in the gridview dynamically. That is when the user clicks the page number 2 then those records only has to be displayed.. I made a stored proc to return only those records whose page number is sent.. It will also return me the number of records too.. Now i want to create a placeholder which will ... | asp.net | [9] |
2,275,550 | 2,275,551 | Multibyte Character - Patter matching | <p>I am reading Shift-JIS encoded XML file and store it in ByteBuffer, then convert it into a string and try to find start of a string and end of of a string by Pattern & Matcher. From these 2 positions I try to write buffer to a file. It works when there is no multibyte chars. If there is a multibyte char, I miss ... | java | [1] |
3,004,301 | 3,004,302 | Burger game - function not running | <p>I am trying to create a game in Python called the 'Burger Game' and I really need some help with this. </p>
<p>So basically, the problem is when I run my program, my <code>def displayIntro():</code> should print but it doesn't run, and when I click enter it printS 'Incorrect Command Try Again' and then it prints <c... | python | [7] |
1,188,287 | 1,188,288 | C# is there a problem with division? | <p>This is a piece of my code, it is called every second, after about 10 seconds the values start to become weird (see below):</p>
<pre><code>double a;
double b;
for (int i = 0; i < currAC.Length; i++ )
{
a = currAC[i];
b = aveACValues[i];
divisor = (a/b);
Console.WriteLine("a = " ... | c# | [0] |
235,276 | 235,277 | Redirecting in a PHP page to another PHP page | <p>I have a register.php, login.php, and main.php. How do i redirect user after after registration submit to login page and then login page submit to main page.</p>
| php | [2] |
967,305 | 967,306 | XML tags closing before value being inserted | <p>The following code:</p>
<pre><code>// Read Attendees Data (For Organisation)
$attendServ = new AttendeeService();
$attendData = $attendServ->getAllActiveAttendeeByOrg($organisation_id);
$attendee = new DOMDocument('1.0');
$attendee->formatOutput = true;
$root = $attendee->createElement('attendee');
$root... | php | [2] |
4,042,871 | 4,042,872 | Web.config replacement, missing section | <p>I've spent a day on this 'simple' problem... </p>
<p>I'm using Web Deployment Projects to deploy my MVC3 webapp. I tell it to replace the appSettings section with one in a config file by entering</p>
<pre><code>appSettings=Config\AppSettings.Production.config;
</code></pre>
<p>That works perfectly. The resulting ... | asp.net | [9] |
2,524,564 | 2,524,565 | Returning values through a Dialog | <p>I currently have a method which should return the result of a dialog. The code I am using is</p>
<pre><code> private int ShowDialog(String FileName)
{
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
// set title
alertDialogBuilder.setTitle("Play File");
// set... | android | [4] |
2,858,809 | 2,858,810 | Prevent empty string on query if viewing root | <p>I use the following for getting the current URL in PHP:</p>
<pre><code>$pageURL = $_SERVER["REQUEST_URI"];
return $pageURL;
</code></pre>
<p>This is used in my links to create e.g <code>/login?continue=/page/i/want</code></p>
<p>However when I'm viewing the home page I will get <code>/login?continue=</code> how ... | php | [2] |
4,809,175 | 4,809,176 | Using reCaptcha in a Wordpress Page | <p>All,
I've got a Page in Wordpress that I'm creating to allow some people to submit some feedback on to me. On my page I've got the following code to include the reCaptcha:</p>
<pre><code><?php
require_once('http://localhost/website/recaptchalib.php');
$publickey = "12345"; // you got this from the signup page
?&... | php | [2] |
5,694,322 | 5,694,323 | Change .htaccess form a Path with PHP | <p>i have a htaccess file:</p>
<pre><code>AuthName "LogIn Interner Berei"
AuthType Basic
AuthUserFile /home/www/web502/html/login/.htpasswd
require valid-user
</code></pre>
<p>and a Session Login System:</p>
<pre><code>if ( $Account->logged )
{
} else {
}
</code></pre>
<p>and how can i make that ... | php | [2] |
3,280,061 | 3,280,062 | anyway to make menu items small...? | <p>i was wondering if there is anyway <code>to decrease the size of menu items displayed</code> from either xml or through coding...?</p>
<p>another question is that can i draw the tabwidget on the bottom of the screen. i mean i want them on the bottom can i do that...?</p>
<p>another question is that is there any <c... | android | [4] |
5,279,356 | 5,279,357 | How to assign access privilege of file(Stored in file table ) to user(Stored in my user table) | <p>I am writing a repository program in java, I have a User table that contains the users of repository and a File Table that contains all the imported files in repository, in MYSQL database.How can I set access privileges of my files to users?In fact how can I determine which user have witch access privilege(read,writ... | java | [1] |
650,443 | 650,444 | javascript don't display the image placeholder if the image is not found | <p>Is there a way to not display the image placeholder if the image was not found? I've got images loaded by automatic feed, and for some items images are there, but for some there are not. So, if the image is not there, I would like to display placeholder.</p>
<p>Thank you,</p>
<p>H</p>
| javascript | [3] |
3,735,923 | 3,735,924 | How to get apache version | <p>everyone i want to get apache version. Actualy i want to use setenv() function in php file . but i m not able to use that its throughing an error undefined call to a function setenv() . it might b because of my apache version.Please suggest</p>
<p>Thanks & Regards</p>
<p>Shri.</p>
| php | [2] |
4,187,966 | 4,187,967 | Media Player <object> - catch mouse events | <p>I'm trying to catch mouse events on my media player within javascript but no success. I also enabled 'SendMouseClickEvents' but still nothing. </p>
<pre><code><object click="das();" id="Player' + j +'" width="160" height="120" ';
s +=' classid="CLSID:6BF52A52-394A-11d3-B153-00C04F7... | javascript | [3] |
4,882,304 | 4,882,305 | Jquery code cleanup | <p>Is there a way to not have to write this 'twice'
See below where the function for #start_date and #end_date is exactly the same. </p>
<pre><code><script type="text/javascript">
jQuery(function($){
$("#start_date").datepicker({
showButtonPanel: true,
minDate: 1,
... | jquery | [5] |
4,598,745 | 4,598,746 | How To: View placeholder for embedded activities | <p>The Activity screen that I'm working on uses a relative layout to include several local controls along with an embedded activity in the middle. Ideally, I'd like to configure the relative layout and contained controls within a layout file rather than having to code it manually. The idea is then to get the placehol... | android | [4] |
1,329,082 | 1,329,083 | Dispatch events to child | <p>I have a ListView containing items with one button each and I want to handle user events in this order:</p>
<ol>
<li>TouchEvent on <em>ListView</em>.</li>
<li>TouchEvent on <em>ListItem</em>.</li>
<li>Click on Button inside <em>ListItem</em>.</li>
</ol>
<p>How can I do this?</p>
| android | [4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.