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
5,789,396
5,789,397
Sharing password between applications
<p>I have written a application in C# that requires the user to login.</p> <p>The application contains three sub applications and if the user has identified himself in one applicationn they should not have to login to the others. </p> <p>The user can start the sub applications from the main application or seperately....
c#
[0]
2,366,621
2,366,622
Finding the line numbers of all occurences of a string in a text file
<p>I'm trying to write a function that does the following:</p> <p>Given a text file, I want to find all occurences of a certain string in this file; then, for each occurence, the line on which it was found should be added to a list. We assume that each line only contains at most one occurence. The text file can get ve...
c#
[0]
1,837,375
1,837,376
c# Production code running DEBUG version
<p>I have the following code:</p> <pre><code> #if (DEBUG) imgPath = GetDirectoryName(Application.ExecutablePath); #else imgPath = GetDirectoryName(Application.ExecutablePath) + "\\images\\"; #endif </code></pre> <p>When the code went into Production (live site) , it still looked the the DE...
c#
[0]
2,343,389
2,343,390
UIModalPresentationFullScreen gives error in UniversalApplication
<p>i am created Universal application, in that i used UIModalPresentationFull, for displaying MFMailComposerSheet in iPad, which helps me to show the full screen of a MailComposer view in landscape view of ipad. When i run the application in ipad simulator i works well. If i set it to iPhone simulator 3.0 or 3.1.3 it s...
iphone
[8]
4,003,140
4,003,141
ActivityGroup with custom ListView
<p>In my app, it has 4 tabs on the bottom, and each tab is connect to a ActivityGroup:</p> <pre><code>tabHost.addTab(tabHost .newTabSpec("Group1") .setIndicator("group1") .setContent(new Intent(this, Group1.class))); </code></pre> <p>group1 just like a interface that control the behavior of sub Activity</p> <pre><co...
android
[4]
3,292,574
3,292,575
T STRING Error causing me nighamres
<pre><code>// SAVE ACCOUNT SETTINGS if($task == "dosave") { $user-&gt;user_info['user_div'] = $_POST['user_div']; // UPDATE DATABASE $database-&gt;database_query("UPDATE se_users SET user_div='{$user-&gt;user_info['user_div']}; </code></pre> <p>Error received: Parse error: syntax error, unexpected T_STRING in /...
php
[2]
67,878
67,879
How to open and read a file in the src/my/package folder?
<p>I would like to load the contents of a text file in a String. The text file should stay in the same folder <code>src/my/package</code> as the <code>.java</code>.</p> <p>However, I can't find the path to this file: I have tried:</p> <pre><code>File f = new File("src/my/package/file.js"); File f = new File("file.js...
android
[4]
5,412,067
5,412,068
passing a value to call-button in android
<p>i am creating a calling application . I am trying to use a default number in actionView and want to pass a mobile number in mobile call button. </p> <p>this is my code:-</p> <pre><code>public void onClick(View arg0) { // this is real calling number long mobile = "tel:9999999999"; ...
android
[4]
4,273,027
4,273,028
Where is the path will be set for Request.AppRelativeCurrentExecutionFilePath
<p>I need to know the path for Request.AppRelativeCurrentExecutionFilePath. It gives the wrong file path when i retrieve any requests.</p>
asp.net
[9]
1,657,826
1,657,827
Is it possible to do object initialization in JavaScript similar to C#?
<p>More specifically, for a random class with two public properties, in C# you can do something like this : </p> <pre><code>new Point() { Y = 0, X = 0 } </code></pre> <p>Is it possible to do something similar in JavaScript? I was thinking of something along the line of :</p> <pre><code>{ prototype : Object....
javascript
[3]
3,253,653
3,253,654
Sending messages between threads in C#
<p>How can I sending and receiving message between threads?</p>
c#
[0]
1,597,472
1,597,473
Can't understand SecurityManager.IsGranted()
<p>I intentionally reduced the permission for a method to see whether IsGranted method works, but it doesn't. Here's my code:</p> <pre><code>[FileIOPermission(SecurityAction.Deny, Read = "d:\\faz.txt")] void aMethod() { Console.WriteLine(SecurityManager.IsGranted(new FileIOPermission(FileIOPermissionAccess.Read...
c#
[0]
3,070,735
3,070,736
Explode a string into a hashmap for searching?
<p>I have a string like this being returned from my backend:</p> <pre><code>"1,2,3,4,5,6" </code></pre> <p>I have a large array locally and want to display only those items not in this list, so I was thinking of exploding this string into an array but how can I search efficiently? As far as I know there are no hashma...
javascript
[3]
1,428,378
1,428,379
jQuery possible to Detect when a user is in a Textarea and when they leave?
<p>jQuery possible to Detect when a user is in a Textarea and when they leave? so I could make a textarea height = 15px when the user isn't focused on it...</p> <p>But when the user does click and focus on the textarea it gets a height of 50px?</p>
jquery
[5]
4,878,736
4,878,737
Function not loading on page
<p>Click event with jquery function is not working when it is before the a tag but it is working fine after the a tag. Also, if I use <code>document.ready</code> then it works. I would like to know why it is not working when it is before the a tag.</p> <pre><code>&lt;head&gt; &lt;script type="text/javascript"&gt; ...
jquery
[5]
769,072
769,073
how do i remove the matched character from a string?
<p>here is my code</p> <pre><code>$a = "Hey there, how do i remove all, the comma from this string,"; $a = str_replace($a,',','';) echo $a; </code></pre> <p>i want to remove all the commas available in the string, how do i do it?</p>
php
[2]
3,314,386
3,314,387
Pass mysqli object to class
<p>I want to pass a mysqli object to a class. I create the object in one file:</p> <pre><code>$host = 'host'; $user = 'username'; $pw = 'pw'; $db = 'db'; $link = new mysqli($host,$user,$pw,$db); </code></pre> <p>which is included in one page:</p> <pre><code>include 'php/mysql.php'; include 'php/classes/Class.Dataco...
php
[2]
5,139,986
5,139,987
Which university is offering video courses in programming languages?
<p>Frankly speaking. I'm looking for a specific video course webpage which I visited few months ago. It was posted as an answer to some question. I know this kind of questions are frowned upon and closed. But I'm helpless. I've been searching for it for more than a month and this is my last approach.</p> <p>I'm writin...
python
[7]
3,348,147
3,348,148
Not able to change <label> text using jquery in IE
<p>I am using below code to change label value using JQuery.</p> <pre><code>$("#labelId").text('Some Text here:'); </code></pre> <p>although it is working in mozilla and chrome but it is not working in IE (any versions).</p> <p>What should be the solution for this?</p>
jquery
[5]
5,201,948
5,201,949
Disable specific version for example Honeycomb / 3.1
<p>Is there a way to disable a specific version from Google Play. For example hide/disable Honeycomb version 3.1 from Google Play?</p> <p>Currently I have</p> <pre><code>&lt;supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="tr...
android
[4]
2,150,910
2,150,911
shutil.copy script not working
<p>I wrote a script in python that was supposed to copy a bunch of files to system32 and then install them through cmd.</p> <p>I can do it manually but I'm trying to make it automatic. This is what I wrote:</p> <pre><code>import shutil import os L = ['file1.type', 'file2.type'.... ] dst = "C:\\Windows\\system32" for ...
python
[7]
4,202,830
4,202,831
jquery zoom and pan
<p>i am using jquery-1.2.6.js and jquery.panFullSize.js two js file to Zoom and Pan image.</p> <p>here is my html,</p> <pre><code>&lt;a href="#" id="zoom"&gt;Zoom&lt; /a&gt; &lt;img src="testimage.jpg" alt="finnish winter" width="600" border="0" usemap="#mypicMap" id="mypic" style="border: medium solid black" /...
jquery
[5]
4,671,148
4,671,149
Prevent a multi-select input box from deselecting all the options if the user clicks a single record
<p>Is there a way to prevent a multi-select input box from deselecting all the options if the user clicks a single record with using the <kbd>Ctrl</kbd> button? Basically they would have to click the item from the list to turn it on or off and the other values would always stay either selected or unselected unless ther...
jquery
[5]
1,619,176
1,619,177
How to send email from code ?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3491651/how-to-send-an-email">How to send an email?</a> </p> </blockquote> <p>I have some simple winform application. In some place in the flow the user have button that if he will press on it the application w...
c#
[0]
4,200,677
4,200,678
obj expected error when run javascript function in asp form (visual studio)
<p>i get obj expected error when click on asp button. where is the problem?</p> <p>code:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tran...
javascript
[3]
3,103,831
3,103,832
ASP.NET MVC 3 Compare 2 Lists with Model Objects for duplicates
<p>I am building an ASP.NET MVC 3 application, where I have on list of custom objects according to this model:</p> <pre><code>public class AbnAmroTransaction { public int TransactionId { get; set; } public int AccountNumber { get; set; } public string Currency { get; set; } public int TransactionDate {...
c#
[0]
1,334,016
1,334,017
infinitly execution while send broadcast
<p>I want to use<br> <code>context.sendBroadcast(intent, receiverPermission);</code> </p> <p>in my application but I don't know to pass receiverPermission parameter in function and also how to set in manifest file please any body help me</p> <p>I want to show you my source code</p> <pre><code>public class LocationRe...
android
[4]
2,580,858
2,580,859
Filtering ArrayList of Strings
<p>I have an array list of strings and I would like to remove strings which are below a certain length. I was thinking about this method:</p> <pre><code> for (int i = 0; i &lt; result.size(); i++) { if (result.get(i).split("\\s").length != maxLength) { System.out.println(result.get(i...
java
[1]
580,667
580,668
converting date and time string to unsigned __int64 in C++
<p>I have a requirement in <a href="/questions/tagged/c%2b%2b" class="post-tag" title="show questions tagged 'c++'" rel="tag">c++</a>, which I have to read a file which consists date and time and convert it to <code>unsigned __int64</code>.</p> <p>For example I have a file "mytime.txt" with following data.</p> <pre><...
c++
[6]
3,232,529
3,232,530
Unable to start debug on web server Webserver is not configured properly
<p>I am getting the error as i specifed and when i check out the properties <code>Web Sites</code> in <code>IIS</code> it is showing as per below is it correct i think some are miising here can any one tell how to resolve this</p> <p><img src="http://i.stack.imgur.com/L1oDW.png" alt="enter image description here"></p>...
asp.net
[9]
138,638
138,639
selecting phone from iphone contacts
<p>I am a new comer in iphone development.I am developing an application for iphone which needs to select phone number and name from iphone contacts .I used "ABPeoplePickerNavigationController" class to open the contacts view.I need to show some instructions which guides the user to select the phone number when the con...
iphone
[8]
2,856,307
2,856,308
PHP:: three echo statements with the same result
<p>Perhaps this is a petty question, but consider the following PHP code:</p> <pre><code>$a = "foo1"; $b = "foo2"; $c = "foo3"; echo $a, $b, $c; echo $a . $b . $c; echo "$a$b$c"; </code></pre> <p>aren't these three statements equivalent. What's the difference. What if one cannot decide whether to use one or the ot...
php
[2]
4,442,772
4,442,773
compare string from a list of strings
<p>i'm reading a file with 10002 lines, in each line there is a name that I want to compare with a single string, and if this string is the same, i want to add the string file to a listbox, I'm using the FILE.READLINE and then add each line to a list then I use .CONTAINS method and doesnt works also with == but that do...
c#
[0]
5,186,454
5,186,455
Image processing Iphone
<p>I like to develop a hair styling application for which allows the user to take a picture and try different predefined hair styles.I need to correctly place the predefined hair in correct position of image.I really don't know from where i need to start.If any one have any ideas please share it. Thanks in advance .......
iphone
[8]
4,793,242
4,793,243
Convert FLV to MP4 or 3GP
<p>Can I convert videos with PHP or do I have to use some library?</p>
php
[2]
5,875,665
5,875,666
Stop Mirror Effect in Android Thumbnails?
<p>If I call MediaStore.Images.Thumbnails.getThumbnail() with the parameter "kind" set to MINI_KIND, many of the returned thumbnail images have an annoying mirror effect applied to them, and the image is larger than it should be because an appended part of the image "reflects" the other half.</p> <p>Does anyone know h...
android
[4]
4,819,671
4,819,672
Android: Gapless playback of a looped audio file in MediaPlayer
<p>I am playing a setLooped enabled audio file in my app, but every time the audio file loops, there is a noticeable, though very brief, gap in the audio playback... is there any way to get around this?</p>
android
[4]
2,033,810
2,033,811
Viewing all photos in a folder in android on the web
<p>I am running a web server and storing all my photos at a folder called photos. Now I want the android application to list all the photos under that particular folder(It can be a slide show or a grid view). I know how to load an image from a url . But I am really unsure about how to view all the images stored on a fo...
android
[4]
3,425,132
3,425,133
session not working
<p>I am using SQL express 2008 and visual studio 2010.</p> <p>I made a simple login form using session. I want that if the session is null the user shouldn't be able to go to the desired page. I have written the following code:</p> <pre><code>public void btnsubmit_CLICK(object sender, EventArgs e) { if (TextBox1....
c#
[0]
3,877,084
3,877,085
inline function -- "unresolved external" error?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3540931/inline-functions-in-c">Inline functions in C++</a> </p> </blockquote> <p><code>#foo.cpp</code></p> <pre><code>void func1(){ ... } inline void func2(){ ... } </code></pre> <p><code>#boo.cpp</code></p> ...
c++
[6]
4,720,699
4,720,700
Checking if a View == null before setting onClickListener
<p>I usually create the <code>initialize()</code> function and functions for setting on-click listeners, and then I call these functions from an Activity's <code>onCreate()</code>. When I call <code>someView.setOnClickListener(...)</code> in a function, should I check if the <code>someView == null</code> or not? I know...
android
[4]
5,222,805
5,222,806
Session object with WCF?
<p>Is it possible to use Session object with WCF to store session related data? If yes the can you describe how?</p> <p>Thanks</p>
c#
[0]
3,652,317
3,652,318
How to make Java Swing Desktop app communicate with a server?
<p>ex) Authenticate users on their desktop app from a server.</p> <p>Questions about server: Do I have to use Tomcat ? Are there any other solutions ? could I even use Apache ?</p>
java
[1]
5,947,109
5,947,110
How to save the contents of Data URI to image
<p>In Google Chrome the <strong>'chrome.tabs.captureVisibleTab(integer windowId, function callback)</strong>' method will return a data URL of the JPEG encoding of the visible area of the captured tab.</p> <p>We want to save that content as image to hard disk without opening/passing the contents into new html page.</p...
javascript
[3]
214,488
214,489
PHP new array from old array
<p>Here is the code in question:</p> <pre><code>$countries = array("New Zealand", "Australia", "United Kingdom", "New Zealand"); </code></pre> <p>I am after some code that will let me declare a new array from this previous array with me specifying how many items in the array.</p> <p>eg:</p> <p>If I did something li...
php
[2]
2,446,212
2,446,213
python multiline string - $ for variables
<p>I'm looking for a clean way to use variables within a python multiline string. Say I wanted to do the following</p> <pre><code>string1 = go string2 = now string3 = great """ I'm will $string1 there I will go $string2 $string3 """ </code></pre> <p>In a way I'm looking to see if there is a perl like $ to indicate a...
python
[7]
1,904,882
1,904,883
How to distinguish whether a word is half-width or full-width?
<p>Recently I've been dealing with texts with mixed languages, including Chinese, English, and even some emoticons.</p> <p>I've been searching for this issue quite a lot, but the only thing I can find is "to replace full-width characters with half-width characters" rather than telling you how to determine whether the ...
python
[7]
5,864,603
5,864,604
How to assign the value of AutoCompleteTextView from Dropdown selected value to another String
<p>Friend's I need help on setting the data content showing from DropDownlist of auto complete text box to another string,when i click the particular content from dropdown list. Help me.</p> <p>thanks in advance.</p>
android
[4]
172,279
172,280
Am I allowed to pass an integer pointer to a function that takes an integer array as an argument in c++?
<p>Probably a stupid question to ask, but seeing as how I'm new here, and this question has to do with a project I'm working one, I'm sure it wouldn't hurt to ask. Many thanks to whosoever answers.</p>
c++
[6]
3,322,238
3,322,239
I want to refresh treeview with new value
<p>I use the following code to display xml as a treeview.</p> <p>Now I want to refresh when I edit xml by using some text box in same window. When I edit and save file using textbox I want to refresh treeview also with that new value. </p> <p>How can I do it?</p> <p>I use <code>treeview1.update();</code> and <code>t...
c#
[0]
556,451
556,452
asp.net 4.0: data access strategy for single stored procedure retuning multiple recordsets in web page
<p>what is the recommended data access strategy for the following environment: single stored procedure, many parameters, asp.net 4.0, sql server 2008, and the stored proc returns 11 different recordsets, all of which get displayed in various different elements too complex and specific to be handled by server controls. ...
asp.net
[9]
4,313,874
4,313,875
How can I delete calender events in android programmatically?
<p>If it possible to delete then give some hint.</p>
android
[4]
4,650,979
4,650,980
Why UIAlertView need to be localized?
<p>I have declared UIAlertView *alert in the .h file. alloc alert in func1. and show &amp; release in func2. This would cause memory BAD_EXEC_ACCESS issue.</p> <pre><code>-(void) func1 { alert= [[UIAlertView alloc] initWithTitle:nil message:@"To Confirm." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]...
iphone
[8]
910,289
910,290
How to make unix timestamp to show time over 24 hours?
<p>I would like to show any give time in hours only.</p> <p>Example:</p> <p>Unix timestamp: 169200</p> <p>Which is equal to 1 day and 23 hours...</p> <p>But how can I convert this to hours so it shows 47:00:00 (47 hours)?</p> <p>Thanks</p> <p><strong>Edit</strong>: It must show minutes and seconds too ;)</p>
php
[2]
2,394,420
2,394,421
Exiting Foreach loop in C#
<pre><code>foreach (var name in parent.names) { if name.lastname == null) { Violated = true; this.message = "lastname reqd"; } if (!Violated) { Violated = !(name.fir...
c#
[0]
4,617,750
4,617,751
Finding total number of words in .txt document
<pre><code>find = open("words.txt") def noE(): for line in find: if line.find("e") == -1: word = line.strip() print word, noE() </code></pre> <p>The above code searches the .txt file for all words that do not contain the letter "e" and then prints them. I would like to then be...
python
[7]
3,816,812
3,816,813
How to connect Android user with his web account on the site
<p>I have a website with a database of users. On the site, I ask for their name and email.</p> <p>I am making an Android app for that website and want to keep track of the mobile users in the same way. Should I explicitly make them fill out a form on the mobile device if they are registering for the first-time?</p> <...
android
[4]
694,681
694,682
passing subdomain to a variable then creating new url
<p>HI, I am nearly there I think but am struggling to put the final bits in place. </p> <p>I am trying to look up the the subdomain of a number of different envoronments and pass the subdomain as a variable to prefix a url called via an onclick event. This is all delivered through an xsl transformation. </p> <p>I am...
javascript
[3]
479,714
479,715
Should I comment my log calls when creating my final package?
<p>I have an application that uses a lot of Log.d() or Log.e() calls for debugging. Now I want to create my final package for release. The Android Export feature from Eclipse mentions to remove the "Debuggable" flag in the manifest, which I have done. Should I also comment all the Log calls to improve the performance o...
android
[4]
5,765,662
5,765,663
Changing the background of a <td> by firing a click event is not working
<p>I have a requirement hope i can get answer here.<br> I am using a theme in my web application. That will style the Table as By the default table rows will have colors alternatively as shown below. </p> <p><img src="http://i.stack.imgur.com/Nz5Lr.png" alt="enter image description here"><br> The color will be change...
jquery
[5]
2,418,768
2,418,769
Sending text file line by line to server
<p>This code is supposed to send data from a text file line by line to a server. But its sending only the 1st line. how to move to next line of text file in android. And after sending I want to delete the line.</p> <pre><code>File file = new File(Environment.getExternalStorageDirectory(),"/BPCLTracker1/gpsdata.txt"); ...
android
[4]
2,379,682
2,379,683
how can i set time delay between two functions in iPhone?
<p>I build app which call to server. </p> <p>it takes for 20 seconds - 30 seconds to get reply from server, because the system we use depending to outside service (connecting to our partners system).</p> <p>before i can do the next, i must wait to get results. </p> <p>is there any way to set the delay time for waiti...
iphone
[8]
83,205
83,206
how to make array of words contained in string?
<p>i have a string </p> <p><code>gpbusd buy update HIT 40 PIPS HIT 110 PIPS gpbusd buy BREAK EVEN update HIT 100+ gpbusd buy 1.5500/25 1.5455 new 40 100+ gpbusd buy update CLOSE 0 TO 10 PIPS N gpbusd buy 1.5335/50 1.5320 new 40 80+ gpbusd buy update 15-20 PIPS CLOSE KEEP OPEN gpbusd buy 1.5530/50 ...
iphone
[8]
851,824
851,825
splitting of xml file using c#
<p>I am using c# and am creating xml from an external data source and saving the xml as a single xml file. How can I split the xml up and save it as multiple xml files? For example, say there are 263 records in my xdocument xml. I need to split that into multiple xml files containing exactly 25 records. (That's the...
c#
[0]
5,148,758
5,148,759
C++ I'm getting expected ‘;’ before '\xa' from g++ 4.4.3 from this code
<pre><code>#include &lt;iostream&gt; using namespace std; int main() { // char[20] name = "blah"; int ssn = 123456789; int dob = 12742; cout &lt;&lt; ssn '\n'; cout &lt;&lt; dob'\n'; return 0; } </code></pre>
c++
[6]
5,869,988
5,869,989
How can i know that the AsyncTask that ran on the background is done ?
<p>There is something that i don't understanding here ... </p> <p>I define class </p> <pre><code>public class SendStringToServer extends AsyncTask&lt;String, Integer, Boolean&gt; { . . . } </code></pre> <p>Now, i implimented the 'onPostExecute' method and i calling this background action from the main...
android
[4]
3,263,665
3,263,666
how to get all folder only in a given path in python?
<p>i'm using this code to get all files in a given folder. Is there a way to get only the folders ?</p> <pre><code>a = os.listdir('Tools') </code></pre>
python
[7]
3,456,492
3,456,493
Where to save classes of the web-application
<p>I have to create a small asp.net-application. The last such web-application I have built was a while ago. At this time, I have saved my classes in the <code>App_Code</code>-folder. </p> <p>During setting up the web-solution in VS2010, I have seen that VS does no more propose to create the <code>app_code</code> dire...
asp.net
[9]
3,322,926
3,322,927
Splitting results from chardet output to collect encoding type
<p>I am testing chardet in one of my scripts. I wanted to identify the encoding type of a result variable and chardet seems to do fine here.</p> <p>So this is what I am doing:</p> <blockquote> <p>myvar1 &lt;-- gets its value from other functions</p> <p>myvar2 = chardet.detect(myvar1) &lt;-- to detect the enc...
python
[7]
4,294,907
4,294,908
what view is this in android, I have seen this in iphone can any one help
<p>what view is this in android, I have seen this in iphone can any one help<img src="http://i.stack.imgur.com/Bx4kz.png" alt="alt text"></p> <p>the one shown in bottom near footer</p> <p><img src="http://i.stack.imgur.com/w7pP3.png" alt="alt text"></p>
android
[4]
2,512,768
2,512,769
Is it possible to get all audios in audio library and store into a MPMediaItemCollection without using mediapicker
<p>I hope to sue codes to load all audios into a MPMediaItemCollection object without using mediapicker manual action.</p> <p>Is it possible?</p>
iphone
[8]
1,131,040
1,131,041
AppDomain.FirstChanceException and stack overflow exception
<p>I'm using the <a href="http://msdn.microsoft.com/en-us/library/system.appdomain.firstchanceexception.aspx">FirstChanceException</a> event to log details about any thrown exceptions.</p> <pre><code>static void Main(string[] args) { AppDomain.CurrentDomain.FirstChanceException += (sender, eventArgs) =&gt; { ...
c#
[0]
488,474
488,475
is-a and has-a implementation error
<p>So, I got a code like this:</p> <pre><code>class Fruit {//some constructor method and instance in here} class Banana: public Fruit {//some constructor method and instance in here} class plant { public: plant(){ thisFruit-&gt;Banana();//everytime a new plant is created, its thisFruit will point to a new ...
c++
[6]
2,915,736
2,915,737
How to create a tuple of tuples in python?
<p>I want to combine:</p> <pre><code>A = (1,3,5) B = (2,4,6) </code></pre> <p>into:</p> <pre><code>C = ((1,2), (3,4), (5,6)) </code></pre> <p>Is there a function that does this in python?</p>
python
[7]
4,757,949
4,757,950
iPhone - removing files matching a pattern
<p>Is there a way to remove all files in a given directory (not recursively) using a pattern?</p> <p>I mean, I have files like file1.jpg, file2.jpg, file3.jpg, etc., and I want something like the unix</p> <pre><code>rm file*.jpg </code></pre> <p>is there a way to do that?</p> <p>thanks</p>
iphone
[8]
2,683,558
2,683,559
How do I access the 1st element of each list in a lists of lists
<p>Example:</p> <pre><code>numbers = ['1','2','3'] letters = ['a','b','c'] </code></pre> <p>I want to get [1,a] as a results. Yeah I can loop through it, but I'm wondering if there is a fast one line way of doing this.</p> <p>EDIT EDIT !!!!</p> <p>I made a horrible mistake in describing the problem.</p> <p>I have ...
python
[7]
3,539,083
3,539,084
php, get values from matrix (array)
<p>I have Matrix and how get value from there? The data obtained from a file, so that the matrix can be of different sizes</p> <p>Thanks</p>
php
[2]
4,004,492
4,004,493
hashCode implementation for singleton class
<p>what will be the implementation for</p> <pre><code>public int hashCode() { } </code></pre> <p>method in singleton class? Please do provide me the implementation</p>
java
[1]
5,490,252
5,490,253
Is this illegal syntax?
<pre><code>&lt;script type="text/javascript" language="JavaScript"&gt; &lt;!-- alert('foo'); //--&gt; &lt;/script&gt; </code></pre> <p>It's used all over in my company's grails app, but I know <code>&lt;</code> is an illegal javascript character...</p> <p>Should the <code>&lt;!--</code> be like <code>//&lt;!-...
javascript
[3]
2,849,574
2,849,575
Is it possible to maintain "boundness" of a method when passing it as an object outside its class
<p>I'm trying to write a library that will register an arbitrary list of service calls from multiple service endpoints to a container. I intend to implement the service calls in classes written one per service. Is there a way to maintain the boundedness of the methods from the service classes when registering them to...
python
[7]
3,220,442
3,220,443
Encrypt iOS app ipa file
<p>I hope to encrypt the ipa file of a freeware for jailbreak users so that others cannot view the project details.</p> <p>Is there any tool to do this?</p> <p>Welcome any comment</p>
iphone
[8]
4,255,433
4,255,434
how to set EditText box height and width programmatically in android
<p>hey i want to manage height and width of EditText Box programmatically in android i tried <code>edittext.setWidth(32);</code> and <code>edittext.setEms(50);</code> both are not working please see my below coding coze i am using it to create dynamic EditText in android</p> <pre><code>private EditText createEditText...
android
[4]
5,136,378
5,136,379
programmatically erase android browser cache, history, etc. with root
<p>I have an android tablet that is locked down (users will only be able to use standard issue android browser), so all the temporary internet stuff should be in the same place.</p> <p>Assuming I am able to root the device sometime here soon, I would like to be able to wipe out (1) cookies, (2) temp internet files, (3...
android
[4]
1,678,753
1,678,754
sip do not talk
<p>I use <strong><code>sipdemo.register</code></strong> and invite sucess,but can not talk with <code>peer.trace startaudio</code>,<br>i can see <strong><code>audiogroup.setmode(MODE_NORMAL)</code></strong> . all permissions is seted,epscial <strong><code>MODIFY_AUDIO_SETTINGS</code></strong> is seted. what are setting...
android
[4]
2,981,733
2,981,734
i want to show four random numbers minimum one maximum ten but contains one number fix
<p>I want to show 4 options of numbers as like quiz options, out of four three should be wrong and one should be the right answer. All options are numeric numbers, and I want to change right answer's position every time when page opens. Please help me</p> <p>and my result is in a String result, where i will add result...
android
[4]
3,409,369
3,409,370
Zend Server Job predecessor fails dependent
<p>I using Zend Server Jobs with setting max concurrent jobs = 4, this setting is needed - many high priority jobs what need to serve ASAP.</p> <p>Also I have jobs with low priority with long execution time 5-7 min - heavy DB operation - and I want this jobs run one at the time - if run parallel compete for DB resourc...
php
[2]
3,721,236
3,721,237
How to get preloaded .apk installed in the "stopped" state and *not* start on BOOT_COMPLETED
<p>We have an application that is being evaluated for preload on some devices. Our application has a service that will run automatically on BOOT_COMPLETED as long as the application is not in the "stopped" state. When an application is installed on a device the application is in the "stopped" state and will not run a...
android
[4]
3,179,698
3,179,699
Numerical computation in Java
<p>Ok so I'm trying to use Apache Commons Math library to compute a double integral, but they are both from negative infinity (to around 1) and it's taking ages to compute. Are there any other ways of doing such operations in java? Or should it run "faster" (I mean I could actually see the result some day before I die)...
java
[1]
432,528
432,529
How to restrict a user to enter data when a session expired in ASP.NET?
<p>I have developed a ASP.NET application,I have used sessions for parameter passing. I dont want to let the user to enter data when the session expired.Please suggest me how to do that.</p>
asp.net
[9]
2,350,419
2,350,420
Why aren't video games written in Java?
<p>So I was just wondering, why aren't many video games (commercial 3D games, not random open source 2D ones) written in Java? In theory, it makes a lot of sense; you get a productivity boost and a cross-platform application for free (among other things, such as the vast amount of Java libraries, and built-in garbage c...
java
[1]
1,799,218
1,799,219
Highlight the tabbaritem with image
<p>I have three TabBarItem in a TabBar . And each tabbar item has normal image. I want to highlight the TabBarItem image instead of the normal image.</p> <p>Can i achieve it?</p> <p>Thanks in advance</p>
iphone
[8]
792,602
792,603
Avoid hang when writing to named pipe which disappears and comes back
<p>I have a program which dumps information into a named pipe like this:</p> <pre><code>cmd=open(destination,'w') cmd.write(data) cmd.close() </code></pre> <p>This works pretty well until the pipe (destination) disappears while my program is writing to it. The problem is that it keeps hanging on the write part(?) I w...
python
[7]
1,062,178
1,062,179
Undefined in associative array lookup
<pre><code>var candidates = { "1":"Barack Obama", "2":"Mitt Romney", "3":"Dennis Kucinich", "4":"Quentin Tarantino", "5":"Count Dracula" }; function getRandomInt(min, max){ return Math.floor(Math.random() * (max - min + 1)) + min; } Object.size = function(obj) { var size = 0, key; f...
javascript
[3]
2,860,239
2,860,240
Ternary operator in foreach
<p>I am currently struggling with about 5 nested if-statements and its becoming quite confusing to look over all of them.</p> <p>So, I thought about adding ternary operators instead of ifs for simple checks, see</p> <pre><code>foreach (String control in controls) { if (!control.Equals(String.Empty)) { // Do some...
c#
[0]
2,075,033
2,075,034
execute function IF criteria is met - wordpress
<p>At the moment i have a function and a filter which shortens titles if they are longer than 25characters and appends the triple dot '...'</p> <p>However, it appends the dots to all the titles. How can i get the following code to run only if the title is longer than 25 characters?</p> <pre><code>function japanworm_s...
php
[2]
1,073,146
1,073,147
Overwriting a field in a binary file
<p>I'm writing a program that writes structs to a binary file, and then gives the user the option to edit the file. The program should then rewrite that section in the file where the original struct was written. Code:</p> <pre><code>struct Record { char name [16]; char phoneNum [16]; float balance; }; ...
c++
[6]
3,416,604
3,416,605
How to download a large, compressed file to the iphone
<p>I want to download a 90MB sqlite file to my iphone app from the web. So I'll need to save the data to disk as it comes in to avoid having too much in memory. This is similar to this question - <a href="http://stackoverflow.com/questions/648275/best-way-to-download-large-files-from-web-to-iphone-for-writing-to-disk"...
iphone
[8]
5,615,317
5,615,318
How to convert .caf file to .mp3 file using php?
<p>I have created one webservice using php which upload audio file from IOS device to server.audio file gets uploaded as .caf format which is not supported by server so is there any way to convert .caf file to .mp3 or .wav file?</p> <p>I want to create PHP script which will convert .caf file to .mp3 file any idea abou...
php
[2]
5,885,673
5,885,674
Why is this jquery code snippet failing
<pre><code>$(if($('#errorExplanation').length &gt; 0)){ $('#venue_details').toggle($('#errorExplanation').length &gt; 0); //if there is at least one errorExplanation element on the page, $("#venue_details").load("/load_events/"+ escape($('#request_artist').val()), successCallback ); } </code></pre> <p>It seem...
jquery
[5]
2,337,043
2,337,044
FigCreateCGImageFromJPEG returned
<p>I am new to iphone app development, while taking picture from camera I am getting the <strong>FigCreateCGImageFromJPEG returned</strong> error. Can any one help me out to solve this issue. Thanks in advance.</p>
iphone
[8]