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,985,307 | 2,985,308 | ArrayList not recognizing subclass variables | <p>I am having a problem with seeing subclass attributes in an ArrayList.</p>
<p>Here's some snippets of the main parts of my code that matter here.</p>
<pre><code>private ArrayList<Person> people = new ArrayList<Person>;
abstract class Person {
String fName;
String lName;
}
public class Employee extend... | java | [1] |
667,865 | 667,866 | Dynamic Content into mail() $message | <p>I'm just trying to put together a simple HTML email confirming an order to my database.</p>
<p>My $message looks a little like:</p>
<pre><code>$message = "
<html>
<head>
<title>Whatever</title>
</head>
<body>
etc etc
</body>
</html>
";
</code></pre>
<p>What i want ... | php | [2] |
748,400 | 748,401 | Can someone help me decipher this function? | <p>I am trying to match numbers within an array with a range of numbers, i have been told to use pre_match. Unfortunately I am not good at regular expressions. Any suggestions? </p>
<pre><code><?php
$range = range(89000000,89499999);
foreach($range as $number)
{
if (preg_match("/89304043/", $number))
{... | php | [2] |
4,822,522 | 4,822,523 | can we check url validity with jquery? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2723140/validating-url-with-jquery-without-the-validate-plugin">Validating url with jQuery without the validate-plugin?</a> </p>
</blockquote>
<p>is there any jquery method to check a url is valid? </p>
<p>or c... | jquery | [5] |
76,284 | 76,285 | Parse HTML in GET with javascript to file | <p>I have a function which calls a script with this information in the GET:</p>
<pre><code>color = color_class(statistics[0]);
class = get_class(statistics[0]);
class = '<font style="color:'+color+';">'+class+'</font>';
switch(stage){
case 1: call_file('tut_class.php?choice='+class,'main'); break;
}
<... | javascript | [3] |
1,225,029 | 1,225,030 | Strange undefined reference !!! undefined reference to `std::__default_alloc_template<true, 0>::deallocate(void*, unsigned int)' | <p>When I am compiling my program</p>
<p>I am getting this error </p>
<pre><code>undefined reference to `std::__default_alloc_template<true, 0>::deallocate(void*, unsigned int)'
</code></pre>
<p>It feels that it is not albe to find reference in the standard libraries or something.
Is it some kind of lib confli... | c++ | [6] |
4,185,302 | 4,185,303 | how to reorder a list of objects? | <p>Firstly, this is going to sound like homework, but it ain't. Just a problem I'm trying to solve at work.</p>
<p>I have a list of objects, the objects have a sequence number which indicates their order in the list in the UI. Example:</p>
<pre><code>public class Task {
Long id;
String name;
Long seq;
}
</cod... | java | [1] |
3,126,740 | 3,126,741 | using jquery to remove links, but not images | <p>I have a that has a bunch of list items, each with an image wrapped in a hyperlink. I'm trying to write some jQuery that will remove the links, but not the images. Is this possible?</p>
| jquery | [5] |
1,882,430 | 1,882,431 | Some help on php | <p>php
I have my database called school. I have a php code to retrieve my data in an html table but it comes disorganised. The code is supposed to get data posted in different tables which are joined by one table in the middle(named student). They are just four tables namely: student(which is the main table),religion ,... | php | [2] |
1,913,551 | 1,913,552 | C++ Template Iterator error | <p>I am going over some code i wrote in 2006 as an undergrad. It's a simple genetic algorithm library written in C++ using templates. It use to work in 2006 when i coded it with visual studio, but now when i am trying to run it in xcode i get compile errors.</p>
<p>This function is giving me errors:</p>
<pre><code>fr... | c++ | [6] |
3,699,773 | 3,699,774 | Virtual table is exactly created for which class in Diamond Inheritance? | <p>Consider the below code snippet:</p>
<pre><code>class A
{
};
class B:public virtual A
{
};
class C:public virtual A
{
};
class D:public B,public C
{
};
int main()
{
cout<<sizeof(A)<<" "<<sizeof(B)<<" "<<sizeof(C)<<" "<<sizeof(D));
return 0;
}
</code></pre>
<p>I... | c++ | [6] |
2,426,882 | 2,426,883 | signing using RSA public key algorithm | <p>I am planning to use php for generating serial number for my software which is written using MSVC++. The method i am optiong is hashing the information and sign it using Private key. In MSVC++ i am able to verify a hash signed by RSA public key algorithm using native API's. Is it possible to sign a hash using RSA pu... | php | [2] |
4,743,326 | 4,743,327 | How to properly set UIRequiredDeviceCapabilities? | <p>I have had an app rejected by Apple stating that I need to implement <code>UIRequiredDeviceCapabilities</code> in my info.plist due to my app requiring a camera flash. I understand the issue but I am not sure how to properly set this key. Do I create <code>UIRequiredDeviceCapabilities</code> as a dictionary or array... | iphone | [8] |
2,349,974 | 2,349,975 | Why doesn't my PHP foreach work? | <pre><code>$start = true;
$new = "";
foreach($array as $val)
{
if($start = true && $val != " ")
{
$start = false;
$new .= strtoupper($val);
}
elseif($val == " ")
{
$new .= " ";
$start = true;
}
else
{
$new .= strtolower($val);
}
$st... | php | [2] |
2,566,509 | 2,566,510 | Is there a shorter/more efficient way of writing this expression? | <p>I have a <code>nav</code> with some child <code>a</code>-elements. I added a click function to those elements, and want to know, which one was clicked. As there can be a <code>span</code> inside (but don't have to) the <code>a</code>-tag as well I used this code to get the index:</p>
<h3>HTML</h3>
<pre><code><n... | jquery | [5] |
3,177,699 | 3,177,700 | time zone converter including daylight saving time | <p>hi How to calculate the time zone value based on country name including daylight saving time. Please help me.
Thanks in advance</p>
| javascript | [3] |
2,858,332 | 2,858,333 | ASP.NET Debug - Form Submitted Values and Query String | <p>I have been doing classing ASP and pretty new to ASP.NET. In classic ASP, I am normally response.write all the submitted values, make sure I am able to capture correct values, put those values in the SQL String, then response.write the SQL string before insert to SQL Server.
This helps to troubleshoot when there is... | asp.net | [9] |
5,958,671 | 5,958,672 | How to change the Networks of the Duals Sim? | <p>am having the dual sim phone . In Application i want change the the dual sim networks such as GSM and LTE . i captured the logs and got the activity name of com.android.phone.mMobileNetwork . but when i see in source code it is not avalable.</p>
<p>Please suggest me in proper manner that how to change the networks... | android | [4] |
5,864,597 | 5,864,598 | How to clean Python's environment | <p>I have an app that creates Python code and runs it. During this process there are two method assignments that I'd like to clear as they create an error in the second run: </p>
<pre><code>push = Writer.Push
...
def appPush(self):
push(self)
dumpRow(self)
...
Writer.Push=appPush
</code></pre>
<p>It's ... | python | [7] |
231,485 | 231,486 | why people are defining data type in php? | <p>Hi friends why people are defining data type in php as below,</p>
<pre><code>$id = (int) $_GET['id'];
</code></pre>
| php | [2] |
4,720,540 | 4,720,541 | Can't avoid GCs in simple draw loops | <p>I'm trying to test out some different methods of drawing to a Canvas, without triggering garbage collection. Even the most basic examples cause frequent gcs. Example:</p>
<pre><code>class Panel extends View {
private int mX = 0;
private Paint mPaint = new Paint();
public Panel(Context context) {
... | android | [4] |
3,025,620 | 3,025,621 | PHP - Count files | <p>I'm trying to count all files within a folder. This is the code I'm using:</p>
<pre><code><?php
$dir = new DirectoryIterator("myfolder/mysubdolder");
foreach($dir as $file ){ $x += (isImage($file)) ? 1 : 0;}
?>
</code></pre>
<p>It returns this error:</p>
<blockquote>
<p>Fatal error: Call to undefined f... | php | [2] |
1,315,998 | 1,315,999 | {name : value} notation for arrays in Javascript | <p>I'm trying to do this for a multidimensional array and can't figure out why it doesn't work for a single dimensional array:</p>
<pre><code>function doArray() {
var msg = [];
msg.push({entryID : "test"});
alert(msg[entryID]);
}
</code></pre>
<p>I get undefined when I try to alert it. What's wrong here? ... | javascript | [3] |
2,072,791 | 2,072,792 | Shorthand IF Statement | <p>I'm curious, is there a simpler way to say</p>
<pre><code>if(myVar == myVal || myVar == myOtherVal){ /*...*/ }
</code></pre>
<p>such as:</p>
<pre><code>if(myVar == myVal || myOtherVal){ /* */ }
</code></pre>
<p>I am aware that my proposed code only checkes to see whether <code>myVar</code> equals <code>myVal</co... | javascript | [3] |
3,286,354 | 3,286,355 | What Are Some Prominent Real-World Applications of Java? | <p>I'm a beginning programmer and the I&CS program at our school starts us off learning Java. It seems to me like C and its spin-offs are way more prevalent in the real world. Is this true?
How do expert programmers use Java for their work?</p>
<p>To be more precise, I want to know in what situations would a progr... | java | [1] |
4,833,903 | 4,833,904 | Remove caption tag | <p>Could anyone help with a regular express that could remove:
<code>[caption id="attachment_116" align="alignnone" width="300"]</code></p>
<p>Where the <code>*</code> could be anything:
<code>[caption * ]</code></p>
<p>Cheers - Working in PHP</p>
| php | [2] |
5,143,634 | 5,143,635 | How to assign a line containing double quotes to a string variable in Java? | <p>Sorry if this is a dumb question. Here is my problem. I have a String variable a. I need to assign the following line to a:</p>
<pre><code><td align="center" width="20%" ><a href="/listen/asid/
</code></pre>
<p>But when I use the following syntax:</p>
<pre><code>a="<td align="center" width="20%" >&... | java | [1] |
5,862,287 | 5,862,288 | How to get rid of "duplicated" background of the AlertDialog with android.R.style.Theme_DeviceDefault_Light_Dialog? | <p>My code:</p>
<pre><code>AlertDialog.Builder a = new AlertDialog.Builder(
main.this,
android.R.style.Theme_DeviceDefault_Light_Dialog);
a.setTitle("test");
a.setMessage("example");
a.show();
</code></pre>
<p>And getting this: cs405220.userapi.com/v405220863/955/ls7yj-dvVpE.jpg</p>
<p>Why background is duplicated a... | android | [4] |
3,846,657 | 3,846,658 | Tracing Javascript warning from library | <p>I have a script that uses Raphaël, a Javascript library to work with SVGs. In my code I am doing something wrong because of that I am getting a warning from the library.</p>
<p>That warning comes from some line in the library. It would be great to trace the stack from when that warning occur to know where in my cod... | javascript | [3] |
4,246,595 | 4,246,596 | How to reduce my application size | <p>I have an application 54 MB in size, of which 53 MB is an mp3 file in my res folder.</p>
<p>Due to the large application size , I am not able to run the application in the emulator. Getting error like "com.android.ddmlib.SyncException: No space left on device", "INSTALL_FAILED_CONTAINER_ERROR]", " the user data i... | android | [4] |
3,259,234 | 3,259,235 | javascript anonymous function parameter passing | <p>I have some javascript code (within an object) :</p>
<pre><code>toggle: function() {
var me = this;
var handler = function() { me.progress() };
me.intervalId = setInterval(handler, me.intervalTime);
//...More code
}
</code></pre>
<p>I'm kind of new to javascript, so doing the above as far as I can ... | javascript | [3] |
5,716,132 | 5,716,133 | Hiding and showing groups of elements | <p>I have a page where all items of class 'div_title_item' are initially hidden. Base on some paginator logic I would then like to show some of them.</p>
<pre><code>// initially
$(".div_title_item").hide(); // this works fine
</code></pre>
<p>Now the showing part. I tried below but it didn't work.</p>
<pre><code>// ... | jquery | [5] |
331,035 | 331,036 | Prevent scrolling to top when using jQuery .load | <p>I have three buttons on the site and when you click each one, they use .load to add different things to a DIV. The problem I'm having is whenever you click a button, it sends you back to the top of the page. I've tried using preventDefault() and return false but it didn't work for me, I might have just placed it in ... | jquery | [5] |
3,796,402 | 3,796,403 | how to increase the storage space in Android emulator? (Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE) | <p>I am creating an Android application.</p>
<p>My Application has audio and png files which i have saved in res/drawable folder.</p>
<p>When i run the app , its giving error</p>
<p>Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE</p>
<p>and in the logcat it says -</p>
<p>ERROR/PackageManager(54): Couldn't... | android | [4] |
5,831,715 | 5,831,716 | DialogFragment views created callback? | <p>I have the following problem.
I'm creating and showing the <code>DialogFragment</code> which have WebView.
WebView have <code>onProgressChanged</code> callback.
When the <code>progress = 100 (loading finished)</code> I want to make
<code>Picture picture = webView.createPicture();</code> - snapshot of the view.</p>
... | android | [4] |
3,004,853 | 3,004,854 | understanding BTree capacity | <p>What I've understood aboutt BTrees is :</p>
<blockquote>
<ul>
<li>if root BTree size is 32, the level 1 have 1024 keys capacity</li>
<li>the level 2 can sort 1048576 keys</li>
<li>the real capacity is 512 for level 1 and 524288 on Level 2, because leaves are half filled.</li>
</ul>
</blockquote>
<p>Am'I... | java | [1] |
4,601,281 | 4,601,282 | Convert.ChangeType to System.Type | <p>I have a System.Type stored in a variable. I wish to Change an object's type to this type.</p>
<p>I have the following code, but cannot get the Type to change to the type.</p>
<p>Ideally I'd like: <code>var intTest3 =(MyType)Convert.ChangeType(test, MyType);</code> to return an int, when : <code>MyType is a Sys... | c# | [0] |
2,860,507 | 2,860,508 | Android : how to stream/play any music file on HTML page in android browser | <p>There is one HTML page, streaming a music file and It's working on window but i need to run this html file on android.
also i need to control all the feature of music by javascript function e.g. play,pause,stop, <strong>volume up & down</strong>.</p>
<p>Can someone give me any idea?</p>
<p>Note : i am new to a... | android | [4] |
5,062,149 | 5,062,150 | Use 0755 as base-8 number | <p>Here is my code:</p>
<pre><code>function myChmod($path, $permission, $log)
{
//this is to overcome umask limitations that mkdir adheres to
$result = chmod($path, octdec($permission));
if(!$result) {
$log->log("Error failed to chmod '$path' to '$permission'. Exiting.");
throw new Excep... | php | [2] |
5,186,377 | 5,186,378 | Search a list of strings for any sub-string from another list | <p>Given these 3 lists of data and a list of keywords:</p>
<pre><code>good_data1 = ['hello, world', 'hey, world']
good_data2 = ['hey, man', 'whats up']
bad_data = ['hi, earth', 'sup, planet']
keywords = ['world', 'he']
</code></pre>
<p>I'm trying to write a simple function to check if any of the keywords exist as a s... | python | [7] |
5,759,156 | 5,759,157 | Keeping track of asynchronous calls | <p>I'm working on a Mozilla extension, and have a problem where I make n calls to an asynchronous function, that function is out of my control and it executes a callback on completion. In this callback, I need to take a special action if it's the n'th & final callback. I can't work out how to determine if a callbac... | javascript | [3] |
5,740,676 | 5,740,677 | how to get the value time from TimePicker in Android | <p>I simply wanna get the hour and minute from TimePicker and display it as a string,
for example I make the timepicker 13:30, and I wanna get the hour as 13 and minute as 30 seperately.</p>
<p>Thats all I need.</p>
<p>I tried that .getHour() and getMinute() but these methods get me the current time which i dont nee... | android | [4] |
3,828,007 | 3,828,008 | How to use java.lang.Process class to Provide inputs to another process | <p>Just assume there is a program which takes inputs from the standard input.</p>
<p>for example :</p>
<pre><code>cin>>id;
</code></pre>
<p>What I want to figure-out is execute the process and give some input to it's standard input. Getting the output of the process is not an issue for me. it works properly. Q... | java | [1] |
3,082,197 | 3,082,198 | Transform InputStream to FileItem in Java | <p>How can I do to transform from InputStream to FileItem in Java?</p>
<p>Thanks.</p>
| java | [1] |
1,068,592 | 1,068,593 | How to implement language translator facility in an iphone application? | <p>How to implement language translator facility in an iphone application ?
I have found that for Online mode this works, using GOOGLE API :(for example)</p>
<p><a href="http://ajax.googleapis.com/ajax/services/language/translate?q=nature&v=1.0&langpair=en%7Cja" rel="nofollow">http://ajax.googleapis.com/ajax/... | iphone | [8] |
3,060,756 | 3,060,757 | php replace my tags (as array key) with array value | <p>Sorry, I am confused to create a correct title. This is my problem, I have a TXT file:</p>
<pre><code>{{title}}<br />{{content}}
</code></pre>
<p>And this is the PHP file:
I load file.txt and replace tags {{variable}} with value from $data['variable']</p>
<pre><code>$data = array ( 'title' => 'Hello', 'c... | php | [2] |
3,561,336 | 3,561,337 | Introduction to ASP.Net from PHP | <p>I am very new to ASP.Net and would like to try this technology, mostly because I am impressed with the performances so far.</p>
<p>I come from the PHP world where you can just include some PHP code into your HTML page and that will do the trick as long as the web server is able to give the page to the PHP processor... | asp.net | [9] |
2,818,011 | 2,818,012 | Question about performance and optimization | <p>How inefficient is that:</p>
<pre><code>List<Object> getList(){
return new LinkedList<Object>();
}
void foo(){
for(Object o: getList()){
do something with o;
}
}
</code></pre>
<p>in compare with that:</p>
<pre><code>List<Object> getList(){
return new LinkedList<Object&... | java | [1] |
2,464,253 | 2,464,254 | JOptionPane on WebService | <p>I'm trying to use the JOptionPane.showMessageDialog() method in a webservice, but somehow, the message dialog won't show up at all on the client-side. This is just to know if the program executed a line or not, since I can't really debug normally. Any ideas?</p>
| java | [1] |
5,684,682 | 5,684,683 | What is the best way to keep a console application running in the background? | <p>I am working on a console application that I want to run in the background of machines from the moment they boot to shutdown. Now I know that it would be optimum to create a Windows Service, but in this case I need to be able to intetact with certificate stores and I do not believe that a local service account certi... | c# | [0] |
4,559,363 | 4,559,364 | How to express the difference between two dates in a human-readable format | <p>If I have two dates - <code>$end_date</code> and <code>$start_date</code>, how can I express the difference between the two in a format such as "2 Years : 4 Months : 2 Days"?</p>
<p>I know that I can get the difference between the two dates like so:</p>
<pre><code>$dif=strtotime($end_date)-strtotime($today);
</cod... | php | [2] |
5,373,472 | 5,373,473 | Searching strings IN strings with preg | <p>If someone searches by "ender" and the title of the item is "Henderson", this function should return:</p>
<pre><code>H<span class="mark">ender</span>son
</code></pre>
<p>Somehow it is not working when i call mark_match("Henderson","ender");</p>
<p>Any ideas? This is the function that takes the origina... | php | [2] |
3,317,113 | 3,317,114 | Change CSS class in head tag | <p>Im adding a css class to head tag like:</p>
<pre><code>$("head").append("<style type='text/css'>.classname{color: gold}</style>");
</code></pre>
<p>Now i need to change the color attribute i.e. from gold to green.
Any solutions for that?</p>
<p>Note: I NEED to do this in head tag. something like </p>
... | jquery | [5] |
2,029,457 | 2,029,458 | Separate MySQL Server Login File | <p>My supervisor wants me to have a separate MySQL login configuration file, which will then be read and executed by my pages.</p>
<p>He wants it separate so that it is easily changeable.</p>
<p>How would I go about creating it (with separate lines for each of the parts for authentication, i.e. server, username, pass... | php | [2] |
4,059,853 | 4,059,854 | Difference between interface inheritance and generic constraints | <p>I have the <strong>following code in C#</strong>:</p>
<p>1)</p>
<pre><code>public class MyBinaryTree<TItem> where TItem : IComparable<TItem>
{ ... };
</code></pre>
<p>2)</p>
<pre><code>public class MyBinaryTree<TItem> : IComparable<TItem>
{ ... };
</code></pre>
<p><a href="http://stackov... | c# | [0] |
2,156,958 | 2,156,959 | How to check if LocationManager.NETWORK_PROVIDER is available? | <p>How to check if LocationManager.NETWORK_PROVIDER is available ? I enabled in AndroidManifest.xml but I need to check that in code and if is not available to use GPS_PROVIDER. Can someone help me ?</p>
| android | [4] |
3,822,262 | 3,822,263 | Found text" " where item tag is expected | <p>I added a colors.xml to my resources and wrote the following xml code :</p>
<pre><code> <?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white">#FFFFFF</color>
<color name="yellow">#FFFF00</color>
<color name="fuchsia">#FF00FF</color>
<color n... | android | [4] |
3,967,389 | 3,967,390 | javascript date(leap year) | <p>i have this code where the user inputs the start date and then it will automatically add the end date. the end date is +3 days to the start date. the problem is after the month of february, march26-31 and so outputs wrong end date. it always output wrong end date from 26-31. i think the problem is the leap year but... | javascript | [3] |
2,872,599 | 2,872,600 | How to set up a recurring payment with frooglepay in php | <p>I am a bit confused with this gateway.When I am using method to set recurring I am getting this </p>
<pre>
stdClass Object
(
[ProcessCreditCardResult] => stdClass Object
(
[Result] => 110
[RespMSG] => Duplicate Transaction
[Message] => Duplicate transaction
... | php | [2] |
2,197,419 | 2,197,420 | pg:224 Stroustrup - C++ Programming Language, 3E | <pre><code>struct Date {
int d, m , y;
void init_date(Date& d, int, int, int);
void add_year(int n);
void add_month(Date& d, int n);
void add_day(Date& d, int n);
}
Date my_birthday;
void f()
{
Date today;
today.init(16, 10, 1996);
my_birtday.init(30, 12, 1950);
Date tomorrow = today;
... | c++ | [6] |
3,747,242 | 3,747,243 | Alternatives to RelativeLayout? | <p>I like the idea of using RelativeLayout as an alternative to many LinearLayouts, but it seems to fall short in a couple of areas.</p>
<ol>
<li>Its behavior for child views that have <code>visibility=gone</code> is atrocious. It seems like the natural behavior for gone views would be to treat them as if they had wi... | android | [4] |
3,607,113 | 3,607,114 | non static method ... cannot be referenced from a static context | <p>Here is the error message</p>
<p><code>non static method hero(double,double,double) cannot be reference from a static context</code></p>
<p>Here is the class method. </p>
<pre><code>class MyMath {
double hero(double n1, double n2, double n3)
{
double n4;
double n5;
n4 = (n1 + n2 + n3) / 2;
n5 ... | java | [1] |
4,460,528 | 4,460,529 | Optimization in std::string based on same const literals | <p>We know compilers can reuse identical constant string literal to save memory efficiently. This optimization is optional for compilers.</p>
<p><em><a href="http://stackoverflow.com/q/13515561/952747">Two string literals have the same pointer value?</a></em></p>
<pre><code>const char *s1 = "HELLO";
const char *s2 = ... | c++ | [6] |
1,952,579 | 1,952,580 | Jquery selecting and clicking | <p>I'm actually using an editable Telerik grid with ASP.NET MVC. One of the columns on the grid contains a delete button and I want to click this button using my own button which is placed somewhere else.</p>
<p>Here is how I get a reference to the currently selected grid row:</p>
<pre><code>var selectedGRIDRows = $... | jquery | [5] |
3,838,708 | 3,838,709 | how to change background color of time in fullcalender | <p>I m new to fullcalendar,
In current view my calendar is showing time and notes as event,
i can change color of whole event)time and notes both).
I only want background color of both time and notes different.</p>
<p>plz reply me </p>
| jquery | [5] |
4,849,708 | 4,849,709 | Getting a view of a List based on a property | <p>I need to write a method that returns a view of a List(java.util.List). The returned view should contain only those elements in the input List that returns true when tested with the isSuccessful() method. </p>
<pre><code>List<Entity> getSuccessfulEntities(List<Entity> entities)
{
//Return a List view ... | java | [1] |
737,363 | 737,364 | Reduce C++ source by variable substitution and dead code truncation? | <p>Suppose I have some template classes with Nontype parameters.</p>
<pre><code>template <int hi, int wid>
class SomeThing {
...
}
</code></pre>
<p>I need to create a tool to reduce this source with given value of <code>hi</code> and <code>wid</code>, say, <code>hi=2; wid=3</code>. Sequentially, there might be ... | c++ | [6] |
982,684 | 982,685 | Android multi time button press problem? | <p>i have very annoying scenario</p>
<p>on button click i show toast or start thread.</p>
<p>what problem i am facing right now is</p>
<p>user presses same button many times and there are lots of toasts and threads starts one by one
i have seen some mobile apps after pressing button they disable touch screen </p>
... | android | [4] |
1,631,680 | 1,631,681 | Is there a way to open file by known inode | <p>I get an inode for some logging file like '/tmp/logging'<br/>
and I want to open it via inode, NOT path.<br/>
How to do it?<br/></p>
| python | [7] |
239,202 | 239,203 | what is this in here (function literal) | <p>I have the structure below that I dont understand the output very well.</p>
<pre><code>var asker = {
answer: "Its raining...",
askQuestion: function(answered){
console.log("Opps..." + this.answer);
answered();
}
}
//function literal
var debunker = function(){
answer = "Its cloudy..... | javascript | [3] |
4,146,917 | 4,146,918 | Saving a reference to .innerHTML | <p>This works:</p>
<pre><code>var button = $A("#aba_but_del")[0];
button.innerHTML = Su.Ani.flipPane.p1;
</code></pre>
<p>But this does not work</p>
<pre><code>var button_text = $A("#aba_but_del")[0].innerHTML;
button_text = Su.Ani.flipPane.p1;
</code></pre>
<p>Why?</p>
<p>According to <a href="https://developer.m... | javascript | [3] |
3,489,160 | 3,489,161 | Web Directory Posting Problem | <p>I am making a tool for web directory submission ,which will authomatically post to the hundreds of web directories at one go.But when I post to some phpld directories they work fine ,but some of them are giving errors like:-</p>
<p>1).Smarty Errors</p>
<p>2).Unauthorized
Sorry, you are not allowed to access this... | c# | [0] |
2,117,334 | 2,117,335 | EditText with number keypad by default, but allowing alphabetic characters | <p>I have an EditText box and I want the default keyboard that comes up when it is selected to be the numeric keypad, since <strong>most of the time</strong> users will be entering numbers. However, I do want to allow users to enter alphabetic characters too, if they need to. Using <code>android:inputType="number"</cod... | android | [4] |
5,162,278 | 5,162,279 | How to add an special item on the begining of the ListView | <p>I have some tabs on the top of the screen.Below that theres a ListView.</p>
<p>My problem is that,I want to set an item "Go To Up Folder" on the very beginning of the ListView and that should be look alike a ListView items.</p>
| android | [4] |
5,210,916 | 5,210,917 | EXC_BAD_ACCESS & EXC_BAD_INSTRUCTION errors in grouped table view | <p>I am new to iPhone apps development. I am trying to develop a small app consisting of table views . when i am in a grouped table view and trying to do something(scrolling or entering values in textfields in the table cell) i get the EXC_BAD_ACCESS or EXC_BAD_ACCESS errors..</p>
<p>Pls can anybody suggest me a solut... | iphone | [8] |
1,555,912 | 1,555,913 | How to distinguish between a variable that is not declared and a varrable that is declared but not be assigned any value? | <p>Both scenario, the typeof the variable will be "undefined".
But undeclared variable will raise a exception.</p>
<p>Is there a easy way to handle this?</p>
| javascript | [3] |
4,789,251 | 4,789,252 | How to solve showStatusIcon on inactive InputConnection | <p>When I close my app I get this message on LogCat
<code>showStatusIcon on inactive InputConnection</code></p>
<p>I read somewhere, but I'm not sure, that it means that I didn't release something, something related to the memory usage.
How can I solve this problem?</p>
| android | [4] |
102,005 | 102,006 | How to get private fields from another class? | <p>I have a class called date:</p>
<pre><code>public class Date{
private String monthAndDate;
public Date(String inputMonthAndDate){
monthAndDate = inputMonthAndDate;
}
}
</code></pre>
<p>I have another class called Patient. Is it possible to get the syntax of monthAndDate from class Date and pass... | java | [1] |
2,067,339 | 2,067,340 | how java script initilised variable prints undefined? | <pre><code>01 print(x === undefined); // prints "true"
02 var x = 3;
03
04 //will return a value of undefined
05 var myvar = "my value";
06
07 (function() {
08 alert(myvar);//undefined -- here i don't understand ho it print undefined
09 var myvar = "local value"
10 })();
</code></pre>
| javascript | [3] |
4,567,461 | 4,567,462 | How can I find the sum of two numbers which are in String variables? | <p>In this code fragment i can't sum a and b :</p>
<pre><code>String a= txtnum1.getText();
String b= txtnum2.getText();
JOptionPane.showMessageDialog(null,a+b);
</code></pre>
<p>...because a and b defined by String so this code work like this
if i'll give a=10 b=20
then my output is 10+20=1020</p>
<p>how can i fix... | java | [1] |
5,180,062 | 5,180,063 | site map page in asp.net | <p>I have created a custom sitemap provider that reterives data from databse.I need to dispaly them like it is displayed in <a href="http://www.apple.com/sitemap/" rel="nofollow">http://www.apple.com/sitemap/</a> .
Please help me .</p>
| asp.net | [9] |
5,754,970 | 5,754,971 | how to take value from grid view and stores into text box ,on a template button event? | <p>I have created a form for saving Medium details, columns are, MID,MediumName,CreationDate,Status.I have bind full table in a gridview name gvmedium, i am having a textbox on the form .I want to fill the text box from grid views value of column MediumName on the template button click event.can any one help me?</p>
| asp.net | [9] |
4,121,134 | 4,121,135 | Namespaces in JavaScript: do I need to rewrite all my variable and function references? | <p>I am namespacing some JavaScript code, and I want to know if I have rewritten all my function calls and references to global variables correctly. The current code is this: </p>
<pre><code>var x = 10;
function foo() {
console.log('foo');
bar();
},
function bar() {
console.log('bar', x);
}
foo();
</code... | javascript | [3] |
3,539,603 | 3,539,604 | Search 0KB files in a folder C# | <p>hi
How can I find the files in a folder which are of size 0 KB using c#.</p>
<p>Regards,
Creator </p>
| c# | [0] |
5,576,423 | 5,576,424 | Scroll event of big-size items within Android ListView | <p>I have a ListView containing big-sized items. Each item may occupy more than one screen.
My objective is to calculate the offset (view.getTop()) of the first visible item on the screen. </p>
<p>I use setOnScrollListener to capture the scrolling event. The problem is that the onScroll event is only triggered when t... | android | [4] |
1,853,788 | 1,853,789 | WaitAll with Task not working | <p>I Created several Task in the way below. But it seems <code>WaitAll</code> is not working. It is sending response without wait. Anything goes wrong here?</p>
<pre><code>private void GetItemsPrice(IEnumerable<Item> items, int customerNumber)
{
try
{
var tasks = new List<Task&... | c# | [0] |
1,245,319 | 1,245,320 | Uncaught ReferenceError: $ is not defined | <p>hello i am trying to link these js codes into my webpage with the code on the php as this:</p>
<pre><code><script src="./js/main.js" type="text/javascript"></script>
</code></pre>
<p>this is the code and its coming with this error Uncaught ReferenceError: $ is not defined </p>
<pre><code> $(functio... | jquery | [5] |
5,033,974 | 5,033,975 | How to turn on android device's hardware button's back light? | <p>I have this android device: <a href="http://www.gsmarena.com/huawei_u8500-3451.php" rel="nofollow">http://www.gsmarena.com/huawei_u8500-3451.php</a></p>
<p>Today suddenly the right 2 button back light went off and never turning on again, the left 2 buttons back light is working just ok.</p>
<p>Any help on this iss... | android | [4] |
2,563,246 | 2,563,247 | Replace part of form element attribute in jQuery | <p>I want to replace a part of the name attribute with a new value. This value is dependent on the original value. The name attribute has a value of: timeslots[timeslot_1][start]</p>
<ol>
<li><p>How do I increment the value 'timeslot_1' to 'timeslot_2' and replace the original value with this one?</p></li>
<li><p>The ... | jquery | [5] |
1,687,544 | 1,687,545 | Appending a html tag to php variable | <p>I am newbie to php, just starting learning it, while working with wordpress.</p>
<p>I want to add html code to a php variable, a anchor tag link actually. First i splitted the text using <code>substr()</code>, and now i want to append a anchor tag at the end of post.</p>
<pre><code>$json['timeline']['date'][$i]['t... | php | [2] |
3,577,442 | 3,577,443 | Binary To Corresponding ASCII String Conversion | <p>Hi i was able to convert a <code>ASCII</code> string to binary using a <code>binarywriter</code> .. as <code>10101011</code> . im required back to convert <code>Binary</code> ---> <code>ASCII</code> string .. any idea how to do it ?</p>
| c# | [0] |
1,592,358 | 1,592,359 | waiting for users response | <p>when form is loaded <code>myMethod()</code> is called and then it executes some statements. at some point when it gets to if statement it should stop and wait for user to press some button and then it will continue executing according to what user did. i used <code>Thread.Sleep()</code> and ManualResetEvent obj's <c... | c# | [0] |
5,741,380 | 5,741,381 | Firefox obj.style.hasOwnProperty | <p>Just trying to figure out how to do basic feature detection in FF...</p>
<pre><code>var obj = $( '<div style="position:relative;top:10px;"></div>' )
, hasTop = ({}).hasOwnProperty.apply( obj[0].style, [ 'top' ] );
// chrome hasTop === true
// FF hasTop === false
// IE hasTop === true
</cod... | javascript | [3] |
4,953,007 | 4,953,008 | Why does this JavaScript cause a page to open in a tab for Chrome | <p>Why would these parameters passed to window.open('SomeWinName') open in a tab:</p>
<pre><code>toolbar=1,
location=1,
directories=1,
addressbar=1,
scrollbars=1,
status=1,
menubar=1,
resizable=1,
outerWidth="+x+",
outerHeight="+
</code></pre>
<p>But if I use these params, window opens in a new window:</p>
<pre><cod... | javascript | [3] |
3,393,887 | 3,393,888 | Copying of an array of objects to another Array without object reference in javascript(Deep copy) | <p>I have a scenario where i need to copy the array of Objects(Main array) to another Temp array which should not have object reference basically if i make any modification to Main array it should not reflect in the Temp array so that i will preserve the copy independently.</p>
<p>I have used one of the code snippet ... | javascript | [3] |
39,349 | 39,350 | nextUntil() is not working in this case | <pre><code><table>
<tr class="codesgroupheader"><td>Header1</td></tr>
<tr><td>1</td></tr>
<tr class="codesgroupheader"><td>Header2</td></tr>
<tr><td>2</td></tr>
<tr class="codesgroupheader"><td>He... | jquery | [5] |
427,537 | 427,538 | how to change a variable value in a python file from a python script | <p>I currently have a python file with a bunch of global variables with values. I want to change these values permanently from a separate python script. I've tried setattr and such but it doesnt seem to work. Is there a way to do this?</p>
| python | [7] |
5,178,748 | 5,178,749 | Writing a counter to a file | <p>Is there a direct way to write a Counter declared as <code>c=Counter()</code> to the file. Currently I am using one pair at a time, writing them to the file. Is the a pythonic way to do it. </p>
| python | [7] |
192,564 | 192,565 | jQuery selector, get elements with no class type A and no ancestors have class type A | <p>I need a custom selector which grabs all LI's who do not have the class hiddenField and who have no ancestors with the class hiddenField</p>
<p>E.G </p>
<pre><code>var lis= $f.find('li:not(.hiddenField)').filter('andAncestorsHaveNoClassHiddenField)
</code></pre>
<p>Bit stretched for me :)</p>
| jquery | [5] |
777,982 | 777,983 | Response.Redirect, Access source page data from target page | <p>I have two ASP.NET Web Pages (Page1.aspx and Page2.aspx), Page1.aspx contains few TextBox controls and a Button Control.</p>
<p>On Click Event of Button Control i redirect user to Page2.aspx using <strong>Response.Redirect</strong> method.</p>
<p>How do i access source page data (TextBox values in Page1.aspx) from... | asp.net | [9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.