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
4,768,741
4,768,742
Does Java have a libraries or functionality capable of evaluating arbitrary arithmetic expressions using BODMAS order of evaluation
<p>Can we make calculator program using <a href="http://en.wikipedia.org/wiki/Order_of_operations" rel="nofollow">BODMAS</a> rule by something like this in Java :</p> <pre><code>String valfromtextbox = "2(2*2)+5"; long total = Long.parseLong(valfromtextbox); </code></pre> <p>Can we do something like above or we have...
java
[1]
828,345
828,346
In mono for android on c# Resource.id dose not exist why?
<p>I have this code:</p> <pre><code>using System; using Android.App; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; using Android.Speech.Tts; using System.Collections.Generic; namespace SayItAndroid{ [Activity (Label = "SayItAndroid", MainLauncher = true)] ...
c#
[0]
176,242
176,243
Capture Video in iPhone
<p>I used the following code to record video.</p> <pre><code> UIImagePickerController *m_objpicker;=[[UIImagePickerController alloc] init]; m_objpicker.sourceType = UIImagePickerControllerSourceTypeCamera; m_objpicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie]; // hide ...
iphone
[8]
4,476,717
4,476,718
Please explain this Javascript variable?
<p>Could you guys please explain the difference between the two following variables?</p> <pre><code>var test = {}; var test2 = []; </code></pre> <p>Are they not both declaring an array variable? If not, when to use which?</p>
javascript
[3]
3,146,478
3,146,479
Communication between classes in an android project
<p>I've been struggling to solve a problem for over a week.</p> <p>I have a main activity with 3 child classes which extends View. When a touch event happens at a View class, calling a certain method in other 2 View classes synchronize with the event. But I have no idea how to call the certain method. In other words,...
android
[4]
1,293,351
1,293,352
Done is not working in softKeyboard in Autocomplete TextView in android
<p>I have One AutocompleTextView and I want to make the virtual keyboard disappear when he hits "DONE" at the AutocompleTextView. So far, the buttons "NEXT"/"DONE" do nothing at all.... Unfortunately I found no resources addressing this problem.</p> <p>Any suggestions? thanks in advance</p>
android
[4]
823,031
823,032
PHP include path sub-folder files not included
<p>I have a site where the PHP include path is /usr/share/php Within this path I have a sub-folder containing some utility files, e.g. /usr/share/php/utils. my_session.php is one of these utility files.</p> <p>My application calls </p> <pre><code>require ("my_session.php"); </code></pre> <p>and this works even thoug...
php
[2]
4,751,864
4,751,865
How to print object ID?
<p>`I need to know if two references from completely different parts of the program refers to the same object. I can not compare references programaticaly because they are from the different context (one reference is not visible from another and vice versa).</p> <p>Then I want to print unique identifier for each objec...
c#
[0]
115,785
115,786
jQuery script conflicting
<p>I'm creating a horizontally scrolling website using jQuery and I also want to add this hide and show function. However, after I insert another jQuery script for the hiding function, the easing effect for horizontally scrolling is not working! So that when I click the navigation of the site, it jumps to another secti...
jquery
[5]
5,210,918
5,210,919
PHP file_exists is lying to me (saying file exists but it doesnt)
<p>Doing this:</p> <pre><code>php -r 'unlink("path"); clearstatcache(); echo file_exists("path");' </code></pre> <p>Where path is a full absolute path to a file on my linux machine. Command is returning '<code>1</code>' even though the file is clearly not there. You can run this command a million times, it will alw...
php
[2]
5,505,382
5,505,383
Adding numbers to a string?
<p>I have strings that look like "01", "02". Is there an easy way that I can change the string into a number, add 1 and then change it back to a string so that these strings now look like "02", "03" etc. I'm not really good at C# as I just started and I have not had to get values before. </p>
c#
[0]
1,467,972
1,467,973
marking and selecting items from a listview
<p>I want to get contacts from the phone and display it as a list view by that, I want to select a few and it should added to a database. The thing is I don't want to select one by one, instead of that</p> <p>I want to mark the contact and select as a whole.</p> <p>Is it possible in android? If yes please help me. </...
android
[4]
2,246,370
2,246,371
Adding events to control arrays within a user control
<p>I have a user control with a stack panel on it and the ability to dynamically add checkboxes to that stack panel, what i would like to do is add a RoutedEventHandler for these new Checkboxes but I'm not too sure how its done. The usual way I add these handlers to static controls is:</p> <p>public event RoutedEventH...
c#
[0]
453,830
453,831
Why is it a good programming practise to check whether a value exists before using it?
<p>Suppose using a isset() function, we checked whether an ID did exist or the user did submit an ID, before assigning it to variables or using it some place in the code that follows.</p> <pre><code> &lt;?php if(isset($_GET['Id'])) { $Id=$_GET['Id']; } ?&gt; </code></pre> <p>Now I understa...
php
[2]
4,933,083
4,933,084
How do I filter out only items from a list which is in an even position?
<p>Instead of processing items based on its value, I need to run a function based on the item's position. This is an example of filtering based on the content of the list.</p> <pre><code>only_words = filter(str.isalpha, my_list) </code></pre> <p>I want to create a slice of the list that contains only items in the eve...
python
[7]
2,827,758
2,827,759
Symbol not found: _CFXMLNodeGetInfoPtr
<p>Adding Exception breakpoint and when i set breakpoint on my own to see what is wrong. I see this same error</p> <p><code>2012-02-05 14:12:09.589 imageview[579:1d03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Libr...
iphone
[8]
919,245
919,246
Amateur attempt at auction script
<p>I have the following code that i don't suppose for one moment is complete for the purpose of an auction yet it should work at this stage, nevertheless, as far as i can see. But i doesn't. Just wondered if somebody could point my mistake. The broswer says that the else in the php script is unexpected. Removing it...
php
[2]
606,552
606,553
How can i share data/text with other apps that will accept it?
<p>I have an app that creates a new data entry in a sqlite db with several columns. I would like to have a simple <em>share</em> button on the final activity so they can share the results (or even a simple text field) with apps that accept it (email, mms, twitter, etc..).</p> <p>I did some reading on ContentProviders ...
android
[4]
4,994,378
4,994,379
Accessing GUI components in thread on android
<p>I want to access the component of GUI such as to change the textview from the thread how it can be done???</p>
android
[4]
2,732,476
2,732,477
How to remove a selected file from the input file?
<p>I have seen a flaw with the file input in html. When the user uses the file input to select a file then that is fine, but if the user wants to remove the selected file and want a blank file input, then the user cant do this. Does anyone know how to remove a selected file from the file input?</p> <p>Below is my file...
jquery
[5]
5,541,103
5,541,104
Get number of occurrences of a character in JavaScript
<p>I have a string that devides some data using <code>','</code>. Now I want to count the occurences of <code>','</code> in that string. I tried:</p> <pre><code>var match = string.match('/[,]/i'); </code></pre> <p>But this gives me null If I try to get the length of the match array. Any ideas?</p>
javascript
[3]
1,176,304
1,176,305
How to stop android from redrawing the entire screen whenever something changes?
<p>I've got an app that allows users to build complicated screen layouts from a set of predefined controls. Then those controls talk to each other to generate the final functionality. The problem I'm seeing is that no matter what I do it seems that any redrawing caused by a change in one control is forcing the entire s...
android
[4]
3,623,060
3,623,061
ASPNet Windows Token Role Provider Issue
<p>I am trying to use the default aspnetwindowstoken provider to authorize users in an application that I am using windows impersonation to log users in. If I add a IsInRole to the code behind the page in the page load, I can see the user is in the proper roles, but when I add the authorization to the web.config, I am...
asp.net
[9]
4,374,389
4,374,390
Trouble with / vs ./ vs ../ and absolute and relative paths
<p>I have many PHP files in</p> <pre><code>/ /client/ /user/ /config/ etc... </code></pre> <p>I want all my files to include <code>/user/codestart.php</code>. (Lots of functions etc)</p> <p>Therefore:</p> <ul> <li>All files in <code>/</code> have <code>include("./user/codestart.php");</code></li> <li>All files in ...
php
[2]
1,538,577
1,538,578
russian language not properly coming in android
<p>I have a file with data that contain values in english and russian. But when I try to print russian data in logcat, its not shown in the way its there in the file. Its coming as some special characters. What may be the reason? </p> <p>For the above question, below answer worked....</p> <p>Added new thing to the qu...
android
[4]
4,935,714
4,935,715
Android- Using DexClassLoader to load apk file
<p>I've hit a bit of a wall. Any help would be appreciated. I have an app that I want to use DexClassLoader to load another apk file.</p> <p>Here is my code:</p> <pre><code>DexClassLoader dLoader = new DexClassLoader("/sdcard/download/test.apk","/sdcard/download",null,ClassLoader.getSystemClassLoader().getParent()); ...
android
[4]
1,456,863
1,456,864
jquery resize on mousemove not working
<p>I have this js:</p> <pre><code>var clicking = false; $('.drag-me').mousedown(function(){ clicking = true; $('.status').text('mousedown'); }); $(document).mouseup(function(){ clicking = false; $('.status').text('mouseup'); $('.status').text('click released, no more move event'); }) $('.drag-me...
jquery
[5]
3,580,463
3,580,464
jQuery image swap on nav hover
<p>I'm trying to use jQuery to do an image swap on the navigation when a user hovers over a menu item. It needs to load a different image depending on the height of the element.</p> <p>So far I have this, which works to some extent:</p> <pre><code>$(document).ready(function() { $('a.mainlevel').hover(function() {...
jquery
[5]
1,556,205
1,556,206
Whats the {} tag do in php?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2596837/curly-braces-in-string">curly braces in string</a> </p> </blockquote> <p>Just came across this piece of code and it got me curious...</p> <pre><code>$msg .= "–{$mime_boundary}–n"; </code></pre> <p>T...
php
[2]
5,523,665
5,523,666
Java: Can multicast data get affected by system call
<p>I am receiving some multicast data and trying to record it. It's able to work properly. But today, I made some changes to the code and added a function to create the directory if it does not exist.</p> <p>This call started affecting the sequence of bytes received. I think so because as soon as I commented out the p...
java
[1]
4,573,666
4,573,667
How to move image on touch,Android
<p>i created a iphone app in which, i hv few images. If i tap on an image for example a boy standing, than it moves from point a to point b. I used imageview with array of images, and having 6-8 images in different positions, so when user taps, it looks like boy is moving.</p> <p>The same thing i wanted to implement i...
android
[4]
3,804,013
3,804,014
Notification when app not used for more than certain period
<p>Is there a way to send a notification to the user that app has been downloaded but a certain task from the app is not yet complete even after certain period - say a month. One way is a background service which should come alive every month in this case, check the app state (in sharedprefs) and then send a notificati...
android
[4]
4,584,660
4,584,661
how to create a setup file with launch condition
<p>i don't have basic knowledge of .net</p> <p>but i have assigned a work to create a setup file for a project which must satisfy the condition such the setup file must check the present of the .net and sql while installing if not it should automatically install it</p> <p>so guide by step by step for 1.registry key ...
c#
[0]
1,908,832
1,908,833
How to convert a String to a unique INTEGER in php
<p>how can i convert a string(i.e. email address) to unique integers, to use them as an ID.</p>
php
[2]
4,154,292
4,154,293
Counting the number of times a character occurs in a very large text file
<p>I would like to count the occurrence of all commas in a very large text file (its has comma delimited data). Size is 28mb. I thought of loading up the text file and doing something like this:</p> <pre><code>substr_count($text, ','); </code></pre> <p>Good idea? Will it work?</p> <p>The overall task is to find out ...
php
[2]
3,041,297
3,041,298
How to get the graphics context of an UIView?
<p>For example, I want to draw something directly to an UIView. I need an CGContextRef, but I don't want to make a new one since that would eat up too much memory. Can I obtain the CGContextRef from an UIView?</p>
iphone
[8]
277,258
277,259
Error printing xml nodes using \n
<p>I want to print each element of an xml document on a new line without using <code>&lt;br/&gt;</code>.</p> <p>Here is the code I'm using but it skips the "\n". Please help</p> <pre><code>&lt;?php $xmlstr= '&lt;Address&gt;&lt;to&gt;James&lt;/to&gt;&lt;from&gt;Jani&lt;/from&gt;&lt;heading&gt;Reminder&lt;/heading&gt;&...
php
[2]
2,538,518
2,538,519
Remove first 3 characters from title
<p>I need to remove first 3 characters from title. I used:</p> <pre><code>$(".layered_subtitle").each(function() { var text = $(this).text(); text = text.replace('06.', ''); $(this).text(text); </code></pre> <p>I have dynamicly loaded titles with numbering:</p> <blockquote> <p>01.title</p> <p>02.title</p> ...
jquery
[5]
517,219
517,220
Is there a good general purpose options class for c++?
<p>Each time I write another one of my small c++ toy programs, I come across the need for a small, easy-to-use options/parameter class. Here is what it should be able to do:</p> <ul> <li>accept at least ints, doubles, string parameters</li> <li>easy way to add new options</li> <li>portable, small and fast</li> <li>fre...
c++
[6]
5,751,041
5,751,042
How do I set opacity of form 1 by a slider in form 2?
<p>I have 2 forms and in form 1 there is a slider. How can I get form2's opacity to be set by form1's slider?</p> <p>I have already tried: form2.Opacity = form1.trackbar1.value; but that doesn't seem to work.</p>
c#
[0]
366,711
366,712
Recommended way to Learn PHP
<p>What are some of the best PHP tutorials/sites/resources/books or blogs which I can refer to learn PHP ?</p>
php
[2]
4,287,988
4,287,989
Null Pointer Exception
<p>I am working on some project in java. Here I'm stuck at this problem and not able to figure out where I am going wrong. </p> <p>I have made two classes: <code>Test</code> and <code>Child</code>. </p> <p>When I run the code I am get a NullPointerException.</p> <pre><code>package test; public class Test { ch...
java
[1]
1,639,448
1,639,449
iPhone:How to get real ads showing in iAds banner in iPhone application?
<p>I have integrated iAds in my iOS 4.0 application developed using the following tutorial: <a href="http://www.raywenderlich.com/1371/how-to-integrate-iad-into-your-iphone-app" rel="nofollow">http://www.raywenderlich.com/1371/how-to-integrate-iad-into-your-iphone-app</a></p> <p>Currently it is showing only Test Banne...
iphone
[8]
1,689,033
1,689,034
JavaScript: `var x = (function() {... return something;})();` vs `var x; {... x = something;}`
<p>Are following snippets exactly equal? If no what is the deference?</p> <pre><code>var x = (function() { ... //a return function(){ ... //b }; })(); </code></pre> <p>vs.</p> <pre><code>var x; { ... //a x = function(){ ... //b }; } </code></pre>
javascript
[3]
2,747,792
2,747,793
Download part of HTML page as text (PHP)
<p>So I have an 'export' application that arrives the user at an end page with a textarea with lots of text. Now the workflow is to copy and paste that text from the textarea into a file.</p> <p>The exported code is getting larger, and we want to encourage users to do this more often, so the copy/paste route is no lon...
php
[2]
4,824,737
4,824,738
Where should i store uploaded files in server?
<p>i am learning php as well as doing a project that involves uploading files to the server. My goal is to make it as secure as possible so where do you recommend saving all the uploaded files. The files to be uploaded will all be pdf files. I read somewhere it's better to save uploaded files outside document root and ...
php
[2]
2,396,743
2,396,744
Datalist itemcommand design?
<p>in my application i am using datalist to display the images, i put properties of repeatcolumn=4 and reapeatdirection=horizontal. It is displaying good when there r more than or 4 images if there r only one or two or three images the gap between images r too long. if i have only one image the image displayed in datal...
asp.net
[9]
2,390,613
2,390,614
php email discussion
<p>I have a contact form on my site. The information from the form is saved to the database.</p> <p>When a user signs up an email is sent from the website to validate the users email. That sent email information is saved in the database.</p> <p>If a user sends me an email, that email information is in the email. If I...
php
[2]
2,602,072
2,602,073
Server-side code working with JavaScript using ASP.NET
<p>I am trying to get a server side code working with JavaScript. What am I doing wrong?</p> <pre><code>function openUp(name) { document.getElementById(name).style.display = &lt;%if (Request.ServerVariables["HTTP_USER_AGENT"].Contains("FireFox"))Then %&gt; response.write('table-row'); &lt;%else%&gt; respo...
asp.net
[9]
3,325,837
3,325,838
What is the difference in php5 between $this and &$this
<p>I have some confusion about $this and &amp;$this, please describe this point .</p> <h3>Update:</h3> <p>Thanks for reply. I know about pass by value and pass by reference. Please see the following program.</p> <pre><code>///////////////////////////////////////////////////// class my_class { var $my_var; f...
php
[2]
115,857
115,858
Endless Adapter with custom listview adapter in android
<p>I am using <a href="https://github.com/commonsguy/cwac-endless" rel="nofollow">this link</a> to create custom listview in my app. </p> <p>First I want to display listview with 5 items. As I scroll the list it should parse data and load listview for next 5 items.</p> <p>Listview row contains 5 textviews.</p> <p>Ho...
android
[4]
791,899
791,900
Built in prime checking function
<p>Does C++ have any built in function to check if the number is prime or not. If yes, then in which library?</p> <p>Below is my implementation. But was just looking if there is any built in function. Searching on Google just gives user based implementations.</p> <pre><code>int isprime(int N){ if(N&lt;2 || (!(N&a...
c++
[6]
1,320,130
1,320,131
Webview and Css3
<p>Does Android 2.2 supports all the Css3 tags? On ICS:</p> <pre><code>background: -webkit-linear-gradient(left, #64615E, #B6B0AB, #64615E); background: -moz-linear-gradient(left, #64615E, #B6B0AB, #64615E); background: -o-linear-gradient(left, #64615E, #B6B0AB, #64615E); </code></pre> <p>those are rendered correctly...
android
[4]
2,615,506
2,615,507
What is the purpose of __EVENTVALIDATION __VIEWSTATE in aspx
<pre><code>Content-Disposition: form-data; name="__VIEWSTATE" /wEPDwUKMTQxNzIxMTc0MQ9kFgICAw8WAh4HZW5jdHlwZQUTbXVsdGlwYXJ0L2Zvcm0tZGF0YWRkflsROmXoLo8ar8ukWWYDh1Wr2BCwmhiAAqpX/xwqLq8= Content-Disposition: form-data; name="__EVENTVALIDATION" /wEWBgKJ1KD6AwKH3P+GBQLr/4HeAgKWoZqyCQLinqurDALt3oXMA0YLgb/Mt6KGihl+8ixYoY9A2...
asp.net
[9]
5,526,198
5,526,199
auto increment numbers in c# windows app
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4897658/auto-generating-numbers">auto generating numbers</a> </p> </blockquote> <p>how to increment a numbers in textbox control in c# windows app.samples like s001 and should be increment always when i come to ...
c#
[0]
2,387,526
2,387,527
Intent's intended class can't read extended information from said intent
<p>I am trying to send information from my main activity class to another class in my app package. The information is used to update an AlertDialog automatically. Here is the code I've been working with:</p> <pre><code>//This is in MainActivity.class //Tests to see if SyncDialog will update itself with new intents. pu...
android
[4]
5,758,025
5,758,026
Can I use jquery to alternate the color of these fonts?
<p>I am using this function to change the font-size on the class "tag-link," which is numbered like</p> <p>"tag-link-1" "tag-link-2" etc.</p> <p>So that's why it's using <code>^</code></p> <pre><code> $(function () { $('a[class^="tag-link"]').css('fontSize', '1em'); }); </code></pre> <p>What I would like to...
jquery
[5]
5,359,944
5,359,945
base() and this() constructors best practices
<p>Under what conditions am I supposed to make the :base() and :this() constructor calls following my constructor's parentheses (or even in other places in the code). When are these calls good practices and when are they mandatory ?? </p>
c#
[0]
4,443,801
4,443,802
Empty specific div with the same class of several others on JQuery
<p>I have this problem, I generate a window (a div with the 'window' class) every time a link is clicked, this is the code for that:</p> <pre><code>$(".getWindow").live('click',function(){ $('#desktop').append('&lt;div class="window"&gt;&lt;span class=\"close\"&gt;x&lt;/span&gt;Well '+$(this).attr('well')+'&lt;div...
jquery
[5]
5,649,858
5,649,859
Android Snake example: Can not change tilesize in XML file
<p>In the Android snake example, the layoyut file snake_layout.xml file suggests that you can define the tilesize of a tile. However, whatever tilesize you enter in this xml-file, the real tile size will always be the default value of 12, as programmed in TileView class(line 70 and 80).</p> <p>Is something wrong wit...
android
[4]
2,584,890
2,584,891
How to programmatically add bindings to the current class scope in Python?
<p>Though the question is very specific, I'd also really appreciate general advice and other approaches that would make my question moot. I'm building <strong>a collection</strong> of AI programs, and many of the functions and classes need to deal with a lot of different states and actions that cause transitions betwee...
python
[7]
2,069,321
2,069,322
appendTo() is not a function?
<p>I thought this code should work but it didnt, can someone explain?</p> <pre><code> $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $(this).val().appendTo('div#links'); }); </code></pre> <p>It says <code>$(this).val().appendTo()</code> is not a function.</p>
jquery
[5]
5,582,361
5,582,362
STL name for the "map" functional programming function
<p>I would like to be able to write something like</p> <pre><code>char f(char); vector&lt;char&gt; bar; vector&lt;char&gt; foo = map(f, bar); //Strikingly functional. </code></pre> <p>in the STL.</p> <p>But, as we all know, the STL has the map class as a collection.</p> <p>Rummaging around, the <code>transform</cod...
c++
[6]
4,740,225
4,740,226
jQuery inner html from select option
<p>I am writing a fancy select box with jquery, and have run into a little problem.</p> <p><a href="http://jsfiddle.net/kYhXn/" rel="nofollow">http://jsfiddle.net/kYhXn/</a></p> <pre><code>&lt;select&gt; &lt;option&gt; Shocka &lt;br&gt; Zooloo &lt;/option&gt; &lt;/select&gt;​ alert($('option').html...
jquery
[5]
1,771,850
1,771,851
get data from the strings.xml
<p>How can I get text from the strings.xml file into my .setmessage?</p> <pre><code>show = new AlertDialog.Builder(mContext).setTitle("moria") .setMessage("R.string.erroroik") .setPositiveButton("OK", null).show(); </code></pre>
android
[4]
3,302,958
3,302,959
Matching strings based upon part match
<p>Im pulling in data from a 6 live feeds which is sometimes have slightly different formatting, ie. i might have </p> <ul> <li>'arsenal' and 'arsenal fc'</li> <li>'T Walcot' and 'Theo Walcot' and 'T. Walcot'</li> </ul> <p>What i was wandering was, is there a simple way to check if the strings match each other on the...
php
[2]
4,536,344
4,536,345
How to create object names java
<p>Lets say I need to create lot of class objects for my main class so I was wondering if there was any way to create a loop that creates a new class object many times but each time it changes the name if the class object.</p> <p>Hey I know you might be thinking why would you want to have multiple class objects that a...
java
[1]
5,500,355
5,500,356
Share data between threads and JOptionPane needs thread to run!
<pre><code> public void aMethod(){ new Thread(new Runnable() { public void run() { int decide = JOptionPane.showConfirmDialog(null, confirmName?, JOptionPane.YES_NO_OPTION); } }).start(); System.out.println("Number of d...
java
[1]
829,867
829,868
Accessing object properties by variable
<p>I've seen this asked before, but my particular case appears to be someone odd, and I'm unable to resolve it - any insight would be appreciated.</p> <p>I'm trying to access an object property with a variable value, ie.</p> <pre><code>$foo = new Object(); $foo-&gt;first = 'bar'; $array = array(0 =&gt;'first', 1 =&g...
php
[2]
5,103,973
5,103,974
is 'giving out' a reference to 'this' inside the constructor ok?
<p>my code :</p> <pre><code>Scene::Scene(const std::string &amp;scene_file) : ambient_light(0, 0, 0), background(0, 0, 0){ scene_parser parser(*this); parser.parse(scene_file); } </code></pre> <p>scene_parser is a friend of Scene, and in the parse method it accesses(r/w) the members of Scene. Is this going to cau...
c++
[6]
546,446
546,447
Use heterogeneous arrays to store different child classes?
<p>I have a file that contains a list of names, colors, and some statistics about them. For example:</p> <pre><code>John black 10 15 Adam black 19 18 Jake brown 13 51 56 62 Rich brown 13 09 98 84 </code></pre> <p>I want to be able to store those names, colors, and numbers in their respective objects based on their...
c++
[6]
3,150,588
3,150,589
how to loop all rows in jquery grid
<p>I have this code right now to get the row value from jquery grid..</p> <pre><code>$("#table1").click(function(e) { var row = jQuery(e.target).parent(); value = row.attr("id"); </code></pre> <p>i need to loop all the rows to get the values cany anyone help me out.. that is if I clic...
jquery
[5]
5,122,943
5,122,944
C# loop question
<p>I have two textboxes with a integer value in each textbox. I need to find all even values between the start and stop box using a loop. </p> <p>How would I do this?</p>
c#
[0]
3,202,546
3,202,547
Unit Testing in C#
<p>Junior Web Developer and I have been tasked with creating Unit Test for a project. </p>
c#
[0]
939,226
939,227
How to determine which configuration is read at run time
<p>I have several configuration entries for application. Identical entries are stored in Machine.config/Web.config etc.. How would I determine which one is read at run time..</p>
asp.net
[9]
4,949,697
4,949,698
PHP String into array keyed by word start
<p>Say I have the following string</p> <pre><code>$str = "once in a great while a good-idea turns great"; </code></pre> <p>What would be the best solution to creating an array with the array key being the string count of where the word(s) starts?</p> <pre><code>$str_array['0'] = "once"; $str_array['5'] = "in"; $str_...
php
[2]
5,325,799
5,325,800
Curious: Why is the "throws <SomeSpecific>Exception" syntax required in Java alone?
<p>We all know it is needed.</p> <p>But WHY is it needed in Java alone, when other similar languages that have exception handling capablities don't require us to write "throws Exception"? Is there anyone who knows what was happening when Java language was designed and why they made it that way? Just curious.</p> <p>P...
java
[1]
1,788,194
1,788,195
Reaching all entries of ListView
<p>I'm using ListView to show all records from the database. Each row of the list has an additional checkbox. I want to make a button that when pressed will delete all checked records. However, when I'm iterating through the list and trying to get the reference to the rows with getChildAt(index), I can reach only 3 ini...
android
[4]
781
782
java.util.UUID.fromString not checking length
<p>When I looked into the implementation of <code>java.util.UUID.fromString</code>, I found that it doesn't check for the UUID length. Is there any particular reason for this? It only checks the components separated by "-".</p> <pre><code>String[] components = name.split("-"); if (components.length != 5) ...
java
[1]
3,811,510
3,811,511
Response.write results in CS0116: A namespace does not directly contain members such as fields or methods
<p>System.Web.HttpContext.CurrentContext.Response.Write result in this error, when used in an aspx.cs file</p>
asp.net
[9]
4,219,111
4,219,112
C#, How to Consistantly bring a form to the front?
<p>I have a <code>MainForm</code> Class Instance, I bring up another form like so;</p> <pre><code>InputForm MyInput= new InputForm("Enter a Number"); MyInput.ShowDialog(); </code></pre> <p>I close <code>MyInput</code> form from within itself like this;</p> <pre><code> private void Button_Click(object sender, Eve...
c#
[0]
5,205,123
5,205,124
Why does this not work when split onto 2 lines?
<p>This line:</p> <pre><code>std::auto_ptr&lt;Ogre::Root&gt; lRoot (new Ogre::Root(lConfigFileName, lPluginsFileName, lLogFileName)); </code></pre> <p>works fine. However when I do this it doesn't:</p> <pre><code>std::auto_ptr&lt;Ogre::Root&gt; lRoot; lRoot (new Ogre::Root(lConfigFileName, lPluginsFileName, lLogFile...
c++
[6]
5,013,678
5,013,679
Using array elements to assign “id=” values returns: TypeError: document.getElementById(...) is null
<p>I'm trying to write calculated values to table cells referencing them by their <code>id=</code> tag that are chosen using array elements. All attempts to get this working such as where <code>“ “</code> are coded, and first trying <code>spans[index]= spans[index].toString();</code> and using <code>window.setTimeout(f...
javascript
[3]
2,639,365
2,639,366
Handling LinkClicked event for the richtextbox; the code runs twice inside the event handler
<p>I've a windows form with richtextbox in it.There is a link which when clicked triggers the LinkClicked Event handler which is something like,</p> <pre><code>private void textSampleResults_LinkClicked(object sender, LinkClickedEventArgs e) { CallSomeMethod1; CallSomeMethod2; }...
c#
[0]
4,282,135
4,282,136
Android GraphicsView enbbeded in layout
<p>How to enbbed a GraphicsView into a layout? Or how do I add buttons and textViews to a GraphicsView? Could some one post a simple working example?</p> <p>-Henry</p>
android
[4]
4,228,903
4,228,904
How can I change character Case?
<p>how can I change character case so result be like :</p> <pre><code>"hello" = "Hello" "hello germany" = Hello Germany" </code></pre> <p>regards</p>
c#
[0]
4,665,065
4,665,066
Issue with php syntax on href link
<p>I have this code which i want to use in order to access a page, with the id of the product.</p> <p>The issue is, i don't get the id on the link.. what am i doing wrong here?</p> <pre><code> echo'&lt;a href="pershkrim.php?id="'.$row["id"].'""&gt;"'.$row["id"].'"&lt;/a&gt;'; </code></pre> <p>Thanks.</p>
php
[2]
1,676,206
1,676,207
Can Android App be embedded in Web page like old plain java applet?
<p>I know nothing about android platform and can't find answer to this basic question on internet.</p> <p>Update: OK I cannot embed Android App per se. But can I embed something in Java in Android Webbrowser ?</p>
android
[4]
3,679,897
3,679,898
initialising multiple empty lists
<p>Simple syntactic c# question is this.</p> <p>Given this code:</p> <pre><code>List&lt;string&gt; Columns = new List&lt;string&gt;(); List&lt;string&gt; Parameters = new List&lt;string&gt;(); List&lt;string&gt; Values = new List&lt;string&gt;(); </code></pre> <p>It can be reduced to:</p> <pre><code>List&lt;string&...
c#
[0]
2,896,274
2,896,275
More fluent C# / .NET
<p>A co-worker of mine came up with this and I wonder what others think? Personally, I find it interesting but wonder if it is too big a departure? Code examples below. Extension methods at the bottom.</p> <p>General thoughts please. Other extension methods that could be added?</p> <pre><code>var ddl = Page.FindContr...
c#
[0]
2,932,370
2,932,371
How to call get service in android?
<blockquote> <p>I am new to <strong>android.</strong></p> <p>How to call the get method in android? i am using drupal service module to get json.</p> </blockquote>
android
[4]
3,744,518
3,744,519
Factory function returning const
<p>I have a factory for creating containers based on ugly containers </p> <pre><code>template&lt;class T&gt; std::vector&lt;T&gt; containerFactory(const UglyContainer* uglyContainer) { std::vector&lt;T&gt; container(uglyContainer-&gt;count); Getter getter; for(unsigned int i=0;i&lt;uglyContainer-&gt;cou...
c++
[6]
3,107,009
3,107,010
analyze how many threads in application and what are they doing?
<p>I have some c# application which I have to modify. When I'm modifing some method I need to know if I should make it thread-safe. How can I check if the particular method could be called from different threads? Are there any static-analyzing utilities?</p> <p>I've tried to run my application and discovered in Task M...
c#
[0]
3,474,585
3,474,586
Unable to compute product, quotient, and difference in java
<p>I'm trying to computing a few things in a simple java application for school. A user must into 2 integers and once you input those variables in it will spit out the sum, product, quotient and difference. I am only able to get the program to spit out sum but not product, quotient and difference. any suggestions? here...
java
[1]
1,815,961
1,815,962
Why is instance variable undefined?
<p>I dont understand one thing: </p> <pre><code> var comein = document.getElementById("comein"); var enter = new Expand({ elem : comein }); function Expand (options) { this._elem = options.elem; console.log(this._elem); // i have a div element } Expand.prototype = { check : function () { ...
javascript
[3]
2,681,209
2,681,210
Android - Fixed / Stationary Background between Activities?
<p>In my app, I want to have a single background image that I use for all pages/activities. When I switch activities, say clicking a button to goto another activity, all the elements on the screen, as well as the background, slides off the screen to the left. At the same time, all the new elements from the new activity...
android
[4]
780,551
780,552
Android Programatically Close Out App1 and Start App2 from App1
<p>My app needs to close itself out but before doing so initiate the startup of another app. What is the best way to 1) issue startup request of second app (via broadcast or just startup activity), and 2) what is the best way to close out the first app. Finish comes to mind but I want to close out the whole app and n...
android
[4]
2,281,346
2,281,347
Why doesn't this PHP if statement work?
<p>I have a parameter in the url for birthday <code>?user_birth_day=05</code>, and I have the following codes:</p> <pre><code>&lt;?php echo $_REQUEST['user_birth_day']; ?&gt; // this outputs 5 &lt;?php for ($i = 1; $i &lt;= 31; $i++) : ?&gt; &lt;?php if($_REQUEST['user_birth_day'] === $i){ ec...
php
[2]
4,675,790
4,675,791
javascript max size
<p>I have a local html-site (on CD, memory stick or disk). In this site I perform extensive search operations which need a lot of data, about 10 MB. Storing the data in HTML-code and keeping them invisibly works, but makes loading very slow (presumably because of the parsing time needed by the browser).</p> <p>An alte...
javascript
[3]
180,672
180,673
Elegantly iterating over string replacement
<p>Say I have a string that looks like</p> <pre><code>'one, two, three,' </code></pre> <p>What is a pythonic way of iterating through replacing <strong>','</strong> with <strong>'.'</strong> one at a time? Ideally the return value of the function would look like:</p> <pre><code>['one. two, three,' , 'one, two. three...
python
[7]