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
429,642
429,643
How to echo all the folder names in a particular folder using php?
<p>I want to print the folder names in a particular folder. For example Folder 1,2,3 are in a folder named 'New' I want to print the folder names 1 2 3 using php. Is it possible ? is there any function in php to do that ? any kind of solutions or ideas are very much appreciated.</p>
php
[2]
5,374,113
5,374,114
How to place the vertical line inbetween on cell
<p>How to place the vertical line inbetween on cell</p>
iphone
[8]
2,223,583
2,223,584
NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:nil
<p>I have a 4465 characters String which contains Url links along with some junk.Here the problem is i am not able to separate all the URL links By using the following code from Junk :</p> <p>NSDataDetector *linkDetector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:nil]; NSArray *matches = [li...
iphone
[8]
5,125,793
5,125,794
UItextView hide in UIScrollview on tap
<p>I have an UIScrollView (with 40+ pages) with UITextview added as subview on every page. What i want to do is that on single tap, i want to hide the UITextField on all pages? How should I do it? I am trying to do like this in hadle tap method:</p> <p><code>textview.hidden = YES;</code></p> <p>But it is hiding text ...
iphone
[8]
4,982,458
4,982,459
Specify image url for canvas
<p>I have the following code:</p> <pre><code>canvas.drawBitmap (mBitmap, 0, 0,null); </code></pre> <p>how to I make <code>mBitmap</code> as PATH or an image from the SD card? so when I save the canvas, it will save the image from that URL?</p> <p>Thanks a lot for any help! :)</p>
android
[4]
5,426,496
5,426,497
PHP link/page refferer
<p>I don't know how to properly explain this so please bear with me:</p> <ol> <li>When a new clicks on create new post/thread/reply .etc, and they are taken to the create new xzy page, they then fill this out the form.</li> <li>When they fill this out, this are taken to a login/register form.</li> <li>After they have ...
php
[2]
4,235,552
4,235,553
Which of these two snippets uses more memory?
<pre><code>string Name = ""; for(int i; i &lt; 10; i++) { Name = NameList[i] + "what?"; Console.WriteLine(Name); } //Or this one: for(int i; i &lt; 10; i++) { string Name = NameList[i] + "what?"; Console.WriteLine(Name); } </code></pre> <p>Which one would use less memory? Someone asked this in the ...
c#
[0]
353,628
353,629
how to make RequiredFieldValidator control two validate two control
<pre><code> Are you required applicant? &lt;asp:CheckBox ID="CheckBox1" runat="server" Text="Yes" /&gt; &lt;asp:CheckBox ID="CheckBox2" runat="server" Text="No" /&gt; </code></pre> <p>Actually this is code, i do not know why they use two Checkbox instead of Checkboxlist, but they told me do not change it. and make ...
asp.net
[9]
1,686,678
1,686,679
Merge audio file with some other File in android?
<p>I am merging a song with another file this file can be an image or a text file.I referred to number of links to get some help: <a href="http://stackoverflow.com/questions/11375291/android-merge-two-audio-files-into-one-file">Merging audio files</a> <a href="http://stackoverflow.com/questions/11452464/merging-two-o...
android
[4]
3,003,916
3,003,917
parsing the date object in javascript
<pre><code>Date.parseWeird=Date.prototype.parseWeird=function(d) { return new Date(Date.parse(d)); }; var d = /Date(-65424600000)/ </code></pre> <p>How can i parse this date and show in MM/DD/YY format. </p> <pre><code>16/09/1956 </code></pre>
javascript
[3]
4,782,713
4,782,714
How to run an application before any other application in android?
<p>I want to write a program in that if somebody wants to open a application (like Contacts Application) , first my program starts and user enter a password and if password is correct , let contacts program to open.</p> <p>i know it s possible because <a href="https://market.android.com/details?id=com.cc.applock&amp;f...
android
[4]
2,735,979
2,735,980
Generate form dynamically and submit it by jquery
<p>i was searching google just to have way out to generate &amp; submit form by jquery and i found code snippet but few things was not clear to me.</p> <pre><code>function submitValues(url, params) { var form = [ '&lt;form method="POST" action="', url, '"&gt;' ]; for(var key in params) form.push('&lt;input type=...
jquery
[5]
4,320,375
4,320,376
C# way to set a float buffer in memory
<p>I am an usual Java developer but now I'm trying to create some OpenGL stuff in C#.</p> <p>However, in Java I do it like this:</p> <pre><code>private FloatBuffer verticesBuffer; private float[] vertices = new float[]{... some vertices ...}; ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4); vbb.order...
c#
[0]
3,540,764
3,540,765
ASP.net: Why disable AutoEventWireup improve ASP.net perfomance?
<p>I was reading this <a href="http://wiki.asp.net/page.aspx/667/improve-perfomance-in-aspnet/" rel="nofollow">wiki entry</a></p> <p>On point 10, it stated to disable AutoEventWireup for perfomance improvement but didn't give any reason. Isn't AutoEvenWireup is delegating? How does it improve the ASP.net performance b...
asp.net
[9]
1,651,797
1,651,798
android listview Keep scrolled position and selected highlited position
<p>i have listview in one activity when user scroll and click the listview ,go to next activity,my problem is when user hit back button ,user needs to see the listview in same style,ie it should selected and maintain scroll position . it possible to maintain scrolled position ,but when am trying to select an item throu...
android
[4]
886,120
886,121
compare two Lists of objects and return a list which has common objects in two
<p>I have two lists -</p> <pre><code>ArrayList&lt;MyObject&gt; list1 -&gt; [obj1, obj2, obj3, obj4, obj5, obj6] ArrayList&lt;MyObject&gt; list2 -&gt; [obj1, obj6, obj7, obj8] </code></pre> <p>Is there any utility method already existing in java api which can give a list of only common records of two?</p> <p>expect...
java
[1]
1,624,585
1,624,586
How can I embed a website in my app
<p>I am currently creating an app, only now I have got to a point where I would like to be able to embed a website into the actual app itself. The thing is I would like to be able to view the website without leaving the app, so it is embedded into the app somehow. I am realising that this might not be as easy as it sou...
android
[4]
534,408
534,409
Reversing a string without creating extra memory
<p>I have a string which is of about 1mb size. The requirement is to reverse the string without allocating another temp string of size 1 MB. I tried the following code</p> <pre><code>string name = "abcde"; string target = ""; for(int i = name.Length - 1; i &gt;=0; i--) { target += name[i]; name = name.Remove(...
c#
[0]
3,533,012
3,533,013
How to apply a variable filter to this model?
<p><strong>I have this view how do I only iterate this unit model when the $wprice is > 1</strong></p> <pre><code>&lt;?php $model-&gt;getFeaturedVehicles(10, 0, unserialize($vtype), unserialize($makes), $p1range, $p2range, $filters) ?&gt; &lt;div id="adspecials"&gt;&lt;?php while ($unit = $model-&gt;iterate())...
php
[2]
2,707,492
2,707,493
How to search for text in iframe and get its element?
<p>How to search for some text in iframe and upon match get its element or append css class to it.</p> <p>i have tried with :</p> <pre><code>$('#my_iframe').contents().find().text('my text'); </code></pre> <p>but it is not working also i have read some articles with <strong>:contains</strong> but am not sure how to ...
jquery
[5]
5,247,871
5,247,872
Mass mailing queue (possibly with PHP interprocess communication)
<p>I am building a website where users will be able to send newsletters. They will need to track the sending process and also to stop it if required. Since they may have lots of emails the actual sending will be delegated to a script which will run in the background and will be executed by the user. This script will ha...
php
[2]
5,706,535
5,706,536
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]
3,780,078
3,780,079
Why is document.body null in my javascript?
<p>Here is my brief HTML document. Why is Chrome Console noting this error: "Uncaught TypeError: Cannot call method 'appendChild' of null"?</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Javascript Tests&lt;/title&gt; &lt;script type="text/javascript"&gt; var mySpan = document.createElement("s...
javascript
[3]
2,106,342
2,106,343
Adding Intent putextra method taking time
<p>I am adding some large serializable object (say data) to the Intent's putextra() method:</p> <pre><code>Intent intent = new Intent(currentScreen, newScreen.getClass()); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Bundle bundle = new Bundle(); intent.putExtra("DATA", data); intent.putExtras(bundle); currentScree...
android
[4]
2,373,738
2,373,739
Android AudioTrack cannot be INITIALIZED
<p>I have a problem with initializing android AudioTrack. I have Nexus One with android 2.3.3.</p> <p>Here is my code:</p> <p>int _rate = AudioTrack.getNativeOutputSampleRate(AudioManager.STREAM_SYSTEM);</p> <p>int buffersize = AudioRecord.getMinBufferSize(_rate, AudioFormat.CHANNEL_IN_MONO, ...
android
[4]
4,551,183
4,551,184
Average with small types
<p>I want to write a generic averaging algorithm. That is, for any type T that has an operator+ (T) and an operator/(float), I would like to find the average of T's in a container:</p> <p>Something like this works fine for float-ish types:</p> <pre><code>template&lt;typename T&gt; typename T::value_type RunningAverag...
c++
[6]
3,695,119
3,695,120
How to add a class in document.write() method in javascript
<p>I am adding a class in document.write but it is not showing, below is my code. </p> <pre><code>new_window = open("","hoverwindow","width=600,height=300,left=10,top=10"); new_window.document.open(); new_window.document.write("&lt;li&gt;Dowload &lt;a href=www.anylink.com class='help'&gt;&lt;/a&gt;&lt;/li&gt;"); </cod...
javascript
[3]
5,018,647
5,018,648
Determine referenced dll file version in C#
<p>I have a C# solution, which references a dll I created from a different C# solution.</p> <p>It is easy enough to determine my solution's product version with Application.ProductVersion. However, what I really need is a way to determine the file version of the exe and the dll separately, within my program. I want to...
c#
[0]
1,433,319
1,433,320
Show up value of select option in IE
<p>I have a problem with a html select object and its options in IE.</p> <p>My html</p> <pre><code>&lt;select id="Select1" onchange="closeMenu1(this.value)"&gt; &lt;option&gt;&lt;/option&gt; &lt;option&gt;1&lt;/option&g...
javascript
[3]
2,581,474
2,581,475
want to show icon for settings on UIToolbar
<p>Want to show icon for settings UIBarButtonItem on UIToolbar than text button </p> <pre><code>UIBarButtonItem *settingsButton = [[UIBarButtonItem alloc] initWithTitle:@"Settings" style:UIBarButtonItemStyleBordered target:self action:@selector(se...
iphone
[8]
3,263,203
3,263,204
Easyphp Web Setup
<p>I've tried to setup an EasyPHP in local and make it visible from the Web via DynDNS, which I've already successed many times before, but now this just doesn't work, maybe I've forgotten something...</p> <p>*The "server" is a common workstation.</p> <p>Here is what I have done :</p> <p>1) Installed EasyPhp (with a...
php
[2]
3,863,075
3,863,076
Java Text file parsing error
<p>If the file has a blank line as the last line of the file, it blows out after the while statement. Can someone help?</p> <pre><code>while(in.hasNext()) { tempPropID = in.nextInt(); tempPropType = in.next().toUpperCase(); tempPropCost = in.nextDouble(); tempAgentID = in.nextByte(WIDTH); } </code></pre>...
java
[1]
1,853,762
1,853,763
Good Free PHP debugger?
<p>what is the best PHP debugger that is for free.</p>
php
[2]
4,794,345
4,794,346
Select All/None Checkboxes but not affect Raido Buttons?
<p>Rails 2.3.5, just using Prototype in this project so far.</p> <p>I have a form with Check Boxes and Radio buttons. I've been trying several scripts trying to find a way to provide a "Select All" / "Select None" functionality for the checkboxes where the Radio Buttons are not affected. Even scripts where you spe...
jquery
[5]
2,459,090
2,459,091
ReflectionClass of static in PHP?
<p>I'm aware that I cannot have <code>new ReflectionClass(static)</code> in PHP (5.3) as I just tried it. Is there any other way to get around this restriction?</p> <p>Passing in a string is not an option, although somehow getting the string of the class name is acceptable. However, idk if it'd work as I'm working wit...
php
[2]
322,864
322,865
Pointing to wrong UI from posted Runnable after screen orintation changes
<p>This is my little test program. My problem is that from <strong>run()</strong> method I access to fields of wrong (old) Activity, which was destroyed after screen orientation changed. What's the way to handle this situation? And, by the way, I must have my activity been recreated, because in real application I have ...
android
[4]
4,439,963
4,439,964
In PHP settings, should memory_limit > upload_max_filesize?
<p>I'm trying to allow users to upload large files (64MB) and am planning to change:</p> <pre><code> upload_max_filesize to 64MB </code></pre> <p>However, should I also change </p> <pre><code> memory_limit to 64MB or larger? </code></pre> <p>Is memory_limit connected to max_filesize?</p>
php
[2]
6,019,685
6,019,686
Why is '==' not working in PHP?
<p>Both values are '2' but I am not getting a true. Why? </p> <pre><code> echo $getuser. "&lt;br /&gt;"; echo $userurl. "&lt;br /&gt;"; if ($getuser == $userurl) { echo "true &lt;br /&gt;"; } </code></pre> <p>Result</p> <pre><code>2 2 </code></pre>
php
[2]
4,782,177
4,782,178
failed to open stream: HTTP request failed! HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request
<p>I am strugling with this code:</p> <pre><code>$auth = base64_encode('domain\username:password'); $aContext = array( 'http' =&gt; array( 'proxy' =&gt; 'tcp://proxy:80', 'request_fulluri' =&gt; true, 'header' =&gt; "Proxy-Authorization: Basic $auth", ), ); $cxContext = stream_context_c...
php
[2]
798,017
798,018
Nested python list assignment
<p>What I want to do is assign a nested list to another list. For example, from alist to blist.</p> <pre><code>alist = [[0], [1], [2], [3]] blist = alist[:] blist[0].append(1) </code></pre> <p>In this way, <code>id(alist[0])</code> equals <code>id(alist[1])</code>, so alist also changes to <code>[[0,1], [1], [2], [3]...
python
[7]
4,773,811
4,773,812
"There was an error parsing the package" but only when downloading from GitHub
<p>So I've been developing my first few Android applications and I've now got to a stage where I want to test one out on my own phone. I first thought that I would check the APK in to GitHub with my source code, I can then download it onto my phone (the USB cable is currently at work).</p> <p>I tried this and when I a...
android
[4]
5,984,468
5,984,469
hide a header of a column with binding data in asp.net
<p>would it be possible to do it like this?</p> <pre><code>&lt;asp:TemplateField HeaderText="Export" Visible='&lt;%# Bind("isExported") %&gt;'&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>I tried it and I got this problem:</p> <pre><code>The TemplateField control with a two-way databinding to field deviceExport m...
asp.net
[9]
5,668,180
5,668,181
Limit array results and increment through when button is clicked
<p>What I am hoping to do is display the first 5 items (Stage1 - Stage5) from the array when the page is loaded. To the side I will have two images one arrow pointing up and one arrow down. If the down arrow is clicked the array is incremented to display (Stage2 - Stage6). Another click on the down arrow the screen wou...
php
[2]
5,818,803
5,818,804
adding where clause in javascript
<p>var PicLibraryURL = "/SC/SW/_vti_bin/owssvr.dll?Cmd=Display&amp;XMLDATA=TRUE&amp;List=%7B9D30BD4A%2DBA0F%4ED2VM%2DBEBB%2D8CEC5D74A29B%7D";</p> <p>How do I add a where clause to above javascript? I have a flag y/n column "ShowInRotator" in the pic libray and like to only fetch record where "ShowInRotator=Yes" (or tr...
javascript
[3]
3,660,855
3,660,856
Custom jQuery Gallery Settings
<p>Im using jQuery to create button that will show Photos with absolute position. However, i tried to configure the code with this.</p> <pre><code>$('#thumbsets li').each(function (i) { i = i+1; $(this).addClass('ts'+i); }); $('#web_overview details').each(function (i) { i = i+1; $(this).addClass('pan...
jquery
[5]
317,140
317,141
Adding TD Dynamically Using jQuery
<p>I have a method that adds an image to a TD and attaches the click event to the image. I am dynamically building a row and wanted to attach the TD image column to my row. </p> <pre><code>$("&lt;tr&gt;&lt;/tr&gt;").append(addActionColumn($("&lt;td&gt;&lt;/td&gt;"))); </code></pre> <p>And here is my addActionColumn m...
jquery
[5]
1,499,648
1,499,649
What is a convenient way to store and retrieve boolean values in a CSV file
<p>If I store a boolean value using the CSV module it gets converted to the strings 'True' or 'False' by the str() function. However when I load those values, a string of 'False' evaluates to being True because it's a non-empty string.</p> <p>I can work around it by 'manualy' checking the string at read time with an I...
python
[7]
809,170
809,171
Get the name of all attributes in a XML-File
<p>Hey I have an XML file and I would like to navigate to a given node and grab the name of all Attributes to that node. </p> <p>For example: (XML File)</p> <pre><code>&lt;RootName&gt; &lt;SubNode&gt; &lt;Attribute1&gt;Value 1&lt;/Attribute1&gt; &lt;Attribute2&gt;Value 2&lt;/Attribute2&gt; &lt;/SubN...
java
[1]
4,567,679
4,567,680
using pyserial flush method
<p>I've read somewhere that the use of flush is necessary to reduce lag. Is this true? </p> <p>I'm not really sure about using it. Please help me understand what it does exactly. </p> <p>I've checked pyserial docs but it didnt give me much information. All it said was: </p> <blockquote> <p>flush() Flush of file ...
python
[7]
4,846,885
4,846,886
Check to see if string contains quotes, and if it does, place an escape '\' before
<p>I need to parse strings for single and double quotes, and if the string does contain them, I need to add an escape slash before. What would be the most efficient way? Is there a way to use a regex to check this through a function?</p>
javascript
[3]
855,950
855,951
Extend a jQuery plugin
<p>Say I have a jQuery plugin like $.abc = function() {}. Now I want to provide an extra module which uses the same scope as $.abc and extends its functionality. For e.g. in my abc plugin I will check if say a variable mod1 = true; if its true, then I will automatically call thoso functions of mod1.</p> <p>My question...
jquery
[5]
104,217
104,218
Method hiding in C# classes
<p>I'm looking at <code>LinkedList</code> class implementation in C# and I cannot understand how Add method is hidden.</p> <p><code>LinkedList</code> implements <code>ICollection</code> which has an <code>Add</code> method. In the <code>LinkedList</code> class code the <code>Add</code> method is declared as:</p> <pre...
c#
[0]
1,000,986
1,000,987
Need something other than touchup inside
<p>I have a button in my iphone app, when I click the button it calls a linked method, that I have done as: </p> <pre><code>[myButton addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside]; </code></pre> <p>all working well, but i want if user tap the button for say 5 second cont...
iphone
[8]
519,705
519,706
Append data to each class
<p>I am creating an event calendar and right now i want to display data from server to each date and time. My code is working if only one entry exists into data base but not for more than one. Here is my code.</p> <pre><code> $.each($(".hour"), function(){ if($(this).attr("data-date") == data.dDate &amp;&am...
jquery
[5]
5,564,143
5,564,144
How to close all active applications from my Android app?
<p>I have a my Android app, and I would like to close all other active applications from my app. Is there a way to do it in android? </p>
android
[4]
115,633
115,634
python exception handling
<p>In the below python the message RSU is not supported on single node machine** is not getting printed. can anyone help please??</p> <pre><code>#! /usr/bin/env python import sys class SWMException(Exception): def __init__(self, arg): print "inside exception" Exception.__init__(self, arg) class ...
python
[7]
1,057,302
1,057,303
android: how do I use tabhost/tabwidget (genrally tabs) putting different activities on tabcontents
<p>Firstly!, I've used the generated <code>Activity</code> using the tab navigation type. I just used it to automatically generate <code>Tab</code> control on the <code>Activity</code>. Its on the latest <em>ADT</em>.I think :(,, Now my question is how do I use the <code>Fragments</code> from other <code>Activity</cod...
android
[4]
231,518
231,519
When to reset a callbackhandler for a Service
<p>i have two Activities A and B and one Service C. A starts B. </p> <p>A and B: </p> <ul> <li>are binding and unbinding to the Service in <code>onStart()/onStop()</code>. </li> <li>are implementing a <code>Handler</code>-Object that works with Messages. The Handler is needed, so if C is doing Work and the Result is ...
android
[4]
4,025,865
4,025,866
Is the order guaranteed for the return of keySet() of a LinkedHashMap object?
<p>I know LinkedHashMap object has a predictable iteration order for elements in it. Then, does the return of keySet() call on a LinkedHashMap object has the same iteration order as the LinkedHashMap object?</p> <p>Thanks.</p>
java
[1]
5,133,862
5,133,863
anyone using perfectomobile for testing?
<p>I have completed my first android app and am trying to test it on 'perfectomobile' web site which allows download to actual phones. I have selected the HTC Wildfire which is said to haqve Android 2.1 (Eclair) os. I am using Eclipse and have exported the app which is targeted to Android 2.1 update 1. Downloaded ...
android
[4]
5,213,269
5,213,270
asp.net failed to run in dot net 4.0
<p>The website was developed in dot net 3.5 SP1 and running ok within dot net 3.5 SP1. But, after recompiled it into dot net 4.0 and changed the app pool to "integrated", it failed to run. The symptom is that the website was running ok for few minutes. Then, the following message will appear:</p> <blockquote> <p>[Nu...
asp.net
[9]
5,447,305
5,447,306
Rounding up values and putting it in another element
<p>my code below does what its suppose to do with one little problem. i have sat up for hours trying to fix it. could anyone help me out please. </p> <pre><code>var price = new Array(12.121212, 45.334, 2.34, 0); for (var i=0;i&lt;price.length;i++){ roundPrice[i] = Math.round(price[i]*100)/100; } var ...
javascript
[3]
2,116,414
2,116,415
jQuery API Browser using raw XML from jquery site and XSLT. How to generate and embed runnable code?
<p>I have developed a jQuery API browser from the raw XML available from <a href="http://api.jquery.com/api/" rel="nofollow">http://api.jquery.com/api/</a> they also have a Dynamic API browser which is built from this XML i guess <a href="http://api.jquery.com/browser/" rel="nofollow">http://api.jquery.com/browser/</a...
jquery
[5]
2,652,744
2,652,745
how to get the image size using php
<p>hi guys i am using <code>&lt;input type='file' name='filett' size='filett'&gt;</code> and move the file into the temporary location. Just i wants to know how to get the image size using php . i am using <code>$rect = thegetimagesize("img/flag.jpg");</code> but if i echo the variable <code>$rect</code> it shows the e...
php
[2]
5,068,646
5,068,647
In android, How can I force open a URI using a specific browser, without popping up the 'choose browser' list?
<p>I have multiple browsers on my android device. I can use the following code to open a URI using the default android browser:</p> <pre><code> String packageName = "com.android.browser"; String className = "com.android.browser.BrowserActivity"; Intent internetIntent = new Intent(Intent.ACTION_VIEW); ...
android
[4]
2,758,286
2,758,287
How to replace this html using jquery?
<p>I have this html.</p> <pre><code>&lt;div&gt; &lt;input type="password" id="user_password" name="user_password" class="password"&gt; &lt;div class="passwordstrength s_1" style="display: block;"&gt;bad&lt;/div&gt; &lt;input type="password" id="user_password_confirm" name="user_password_confi...
jquery
[5]
4,054,955
4,054,956
Finding the Length of a String within an ArrayList
<p>I am writing a CSVParser program that seperates words at commas. I am currently trying to find and record the longest word that appears in the file. Here is my class.</p> <pre><code>import csv.CSVParser; import java.io.*; import java.util.*; public class RecordFormatter { public static void main (String[] args) {...
java
[1]
5,094,425
5,094,426
Simulate an attack while+array+objects
<pre><code>class Gunner { public $health; public $attack; function __construct($health, $attack) { $this-&gt;health = $health; $this-&gt;attack = $attack; } } $player = array(); $player[] = new Gunner(100, 20); $player[] = new Gunner(100, 20); $player[] = new Gunner(100, 20); $enemy ...
php
[2]
1,029,916
1,029,917
Snake game - Getting collision to work with images
<p>This works when I used a rectangle as the food but now I'm trying to use my own image for the food but can't get it to work correctly. I keep getting the error of "Cannot convert Image to Rectangle" when using <code>IntersectsWith</code> so I'm stuck there and not sure what to do. </p> <p>My error is on this part o...
c#
[0]
4,263,566
4,263,567
how to run .jar file on IIS
<p>I've opened a webserver using IIS on my computer in order to host my multiplayer game. I've build the server in java and wish to run it on my server so users from different computer can play on it for testing. Do I need to run it in a webhost or just run as is from netbeans?</p>
java
[1]
5,689,305
5,689,306
Is it a bad idea to remove the Status Bar in an application?
<p>I am not sure, but I guess:</p> <ul> <li><p>if you make a game, don't have a Status Bar. Looks just not good.</p></li> <li><p>if you have an app, leave the Status Bar where it is. Might be useful.</p></li> </ul> <p>Is there any guideline by Apple when or when not to remove the Status Bar?</p>
iphone
[8]
1,426,825
1,426,826
Differences with jQuery 1.4.2 and 1.7.1?
<p>I build my site on jQuery version 1.4.2 (not realizing about any updates) but now it doesn't seem to work in IE8. When searching for a solution i thought about an update. When i use jQuery 1.7.1. however, some strange things occur. For example this example on jsFiddle</p> <p><a href="http://jsfiddle.net/64d2T/" rel...
jquery
[5]
884,556
884,557
Bar Code Scanner API
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2607858/android-barcode-scanning-options-zxing">Android - Barcode Scanning, Options? Zxing?</a><br> <a href="http://stackoverflow.com/questions/2739550/android-is-there-a-way-to-implement-the-barcode-scanner-into-...
android
[4]
3,038,986
3,038,987
Why is my app not available to Galaxy Nexus users, even though it was in the past?
<p>After a recent update I have gotten a number of users complaining that they are unable to download my application from the market since their device "galaxy nexus" is not compatible in the bar. I have a galaxy nexus myself and have tested the app on the device. These same users were able to use the previous version,...
android
[4]
1,296,286
1,296,287
How to obtain the container class of an Actionsheet?
<p>I am a green hand of iPhone development, and I just get confused about a method UIActionsheet,which is the "showInView". So what is the relation between the view who called the actionsheet and the actionsheet it self.<br> Actually, I wannt to customize the button in an actionsheet, so I create a class for it and o...
iphone
[8]
4,946,435
4,946,436
Getting My *.DLL going in PHP
<p>I have a *.DLL that cuts the data in a picture down to a set file size and height, widths.</p> <p>It contains a function <code>FuncName( PChar, PChar, int, Int, Int)</code> and returns a <code>int</code></p> <p>If there is a better way show me. At the moment I'm thinking somehow install it into Java and accessing ...
php
[2]
1,619,466
1,619,467
c# by reference or by value
<p>Let's say I have a list of objects and that I'm extracting and modifying an item from the list like this:</p> <pre><code>List&lt;MyObject&gt; TheListOfObjects = new List&lt;MyObject&gt;(); MyObject TheObject = new MyObject(); TheListOfObjects = //some json deserialization result TheObject = (from o in TheListOfOb...
c#
[0]
4,142,365
4,142,366
How to force character casing (capitalized) in a ComboBox C#? Is it possible?
<p>I'm using a ComboBox control (windows forms) with auto complete, and I found out that there is no CharacterCasing Property on it. What I'm trying to accomplish is to echo upper case letters on the ComboBox.</p> <hr> <p>comboBox1.DropDownStyle = DropDownStyle.DropDown;</p> <p>//comboBox1.CharacterCasing = Characte...
c#
[0]
3,488,017
3,488,018
How can I delete the contents of a folder with PHP?
<p>I can't seem to get this function to delete all my files and folders in a specific directory can someone help me fix this problem?</p> <p>Here is my code.</p> <pre><code>$apps = 9; $dirname = './members/' . $apps . '/'; function delete_directory($dirname) { if (is_dir($dirname)) $dir_handle = opendir($dir...
php
[2]
5,032,734
5,032,735
Assigning the whole array values to another variable in c#?
<p>I have an array and i want to assign it to another array variable. Here is the code</p> <pre><code>for (int i = 0; i &lt; length; i++) { arr1[i] = Convert.ToByte(Tag_uid.Substring(2 * i, 2), 16); } //Create an array to hold the Command Packet byte[] CommandPacket = new...
c#
[0]
1,886,388
1,886,389
Is there a way to see the uninstall history of an android device?
<p>Just want to know how to track what applications a user has uninstalled from their device in the past.</p>
android
[4]
2,384,503
2,384,504
Javascript document.getSelection
<p>I'm trying to use the document.getSelection to select text I have entered in an text area for a WYSIWYG editor. It only works if you select text outside the text area though. I don't know if there is a way you can make it select text inside the text area?</p> <p>Below is the text area for a WYSIWYG text editor:</p>...
javascript
[3]
813,961
813,962
Can we see the template instantiated code by C++ compiler
<p>is there a way to know the compiler instantiated code for a template function or a class in C++</p> <p>Assume I have the following piece of code</p> <pre><code>template &lt; class T&gt; T add(T a, T b){ return a+b; } </code></pre> <p>now when i call</p> <pre><code>add&lt;int&gt;(10,2); </code></pre>...
c++
[6]
1,254,456
1,254,457
Get the number of milliseconds since some date
<p>How to get the number of milliseconds from October 15th 2011 1:52:34 P.M.</p> <p>I can get the number of milliseconds from the current time.</p> <pre><code>Date date = new Date(); long currentTime = date.getTime(); System.out.println("Current time in long: " + currentTime); </code></pre>
java
[1]
615,666
615,667
getting an error while uploading the file
<p>I am trying to upload a 305968 kb file, I keep getting an error that file is too big, maximum file size exceeded. I did the below changes in web.config file , but I keep getting an error</p> <pre><code> &lt;httpRuntime requestValidationMode="2.0" executionTimeout="7200" maxRequestLength="102400" minFreeThreads="88"...
asp.net
[9]
2,272,793
2,272,794
Python - can't convert to int
<p>My entire code is below (didn't want to miss anything). For some reason I keep getting an error where I can't convert a float to an int?</p> <pre><code>import math def getRange(input): if (1 &lt;= input &lt; 10): return [1,1,9] elif (10 &lt;= input &lt; 190): return [2,10,99] elif (190...
python
[7]
3,886,701
3,886,702
how to: PRODUCT_PACKAGE_OVERLAYS
<p>I heard that PRODUCT_PACKAGE_OVERLAYS can be used to add strings to native Android applications without having to actually edit the strings.xml of that application.</p> <p>I tried following the steps in <a href="http://www.kandroid.org/online-pdk/guide/build_new_device.html" rel="nofollow">this site</a> (I created ...
android
[4]
62,382
62,383
Stripping leading character from an alphanumeric string using php
<p>I've got several strings of the type id1, id2, id125, id1258, etc.</p> <p>What I want to achieve using php is to strip the word "id" from those strings and get only the numbers in <strong>integer format</strong> in php. How can I do this?</p>
php
[2]
2,242,350
2,242,351
NullPointerException when adding an Item to the list
<p>Helo All,</p> <p>I have a problem that I am facing NullPointerException when I want to add an item to the List, as shown below:</p> <pre><code>public List&lt;SearchResponse&gt; sortMPGListViewForNA(List&lt;SearchResponse&gt; response) { List&lt;SearchResponse&gt; list = response; List&lt;Search...
android
[4]
4,856,411
4,856,412
jquery prepend change scroll position
<p>I have a problem when I prepend a new div with 780px height and after doing animation scrolling is change 2 time with 780px down can somebody help me?</p> <pre><code>function slide_up() { var str = document.URL; var list = str.split("Details"); var url = list[0] + "AddDetails"; $.ajax({ type...
jquery
[5]
5,797,231
5,797,232
how to get meta desciption value in wordpress
<p>I want meta description of currently executing page in the header.php file in wordpress.</p> <p>Wordpress function "get_post_meta" is not useful for this. It only returns custom meta tags.</p> <p>can anyone help me out.</p>
php
[2]
3,666,479
3,666,480
Why both hashCode() and equals() exist
<p>why java Object class has two methods hashcode() and equals()? One of them looks redundant and its percolated to the bottom most derived class?</p>
java
[1]
3,275,408
3,275,409
PHP fail to move file from temp folder to specified folder
<pre><code>&lt;?php error_reporting(E_ALL); include "func.php"; connectToDatabase("localhost","root","","test"); $fileName = $_FILES['name']; $fileSize = $_FILES['size']; $fileType = $_FILES['type']; $fileTempName = $_FILES['temp_name']; $uploaderID = $_SESSION['id']; $date = date("d/m-Y"); $uploadDir = "avatarStor/"; ...
php
[2]
5,312,367
5,312,368
Not saving the leading zero from one table to another
<p>An error is thrown on a dropdown list that updates a table field. It claims the SelectedValue is invalid because it does not exist in the list of items. If I go into the table and add the zero to the ID the error is no longer thrown. </p> <p>The dropdown selects a teacherid which is the primary key from the Teache...
asp.net
[9]
5,584,690
5,584,691
Blob constructor not working in safari / opera?
<p>I'm trying to construct a Blob from an array buffer that original comes from a binary string. It works fine in Firefox &amp; Chrome, but I don't know whats wrong with Safari &amp; Opera</p> <p>This is a simplified version of my problem: <a href="http://plnkr.co/edit/sfEEHf?p=preview" rel="nofollow">http://plnkr.co...
javascript
[3]
4,276,612
4,276,613
Join function in Python
<p>I am writing code that reverses a string e.g. GOOD ---> DOOG w/o using the reverse() function. I'm almost there...</p> <pre><code>a = "hello" for i in range(1,len(a)+1): print a[-i], </code></pre> <p>When I complete the code with the join function, it doesn't work as I expect. Any ideas why? Driving me nut...
python
[7]
4,330,575
4,330,576
How to calculate trends from text messages
<p>I'm working on a Hungarian twitter client and I would like to implement a trend system. So I have a database full of texts and dates (unix timestamps) that represent the creation date of the tweet.</p> <p>So how can I create some kind of php script that gives me about 10 "Trending topics"? I don't even know how to ...
php
[2]
4,662,296
4,662,297
Javascript as a general purpose language?
<p>In a weekend geek seminar I attended, several instructors extolled the virtues of Javascript. I've used Javascript to some extent, but their enthusiasm caused me to want to step a little closer.</p> <p>I've learned bits-and-pieces about Rhino &amp; SpiderMonkey. I know about server-side scripting &amp; the restrict...
javascript
[3]
4,386,370
4,386,371
object returns not defined in javascript
<p>Hi i am trying to get my head around some basic stuff in javascript, i want to create the equivalent to a class see below:</p> <pre><code>var myTest = { myTester:"testing", testCode:function(){ return myTester; } }; </code></pre> <p>when i call <code>alert(myTest.testCode());</code> i get error myTester...
javascript
[3]
1,120,393
1,120,394
error while executting the marshalling program?
<blockquote> <p>how to resolve the exception while excuting a marshalling program "The method marshal(Book, > FileWriter) is undefined for the type Pool.Marshaller".</p> </blockquote> <pre><code> import java.io.FileWriter; import java.util.ArrayList; import java.util.List; import com.sun.xml.internal.ws.util....
java
[1]