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,248,736 | 5,248,737 | formatting currency | <p>I have this value : 12345678,99</p>
<p>I'd like have this : €12.345.678 to resume "." as thousand separator, not show decimal number and add the € befor the number.</p>
<p>Do you know the formatting string ?</p>
<p>Thanks, </p>
| c# | [0] |
4,735,378 | 4,735,379 | Is there any alternative to Java properties for keeping tree-like data? | <p>I have 3 item data that I should keep on remote PC. Let it be: ID, login, password.
If there're only 2 items, Java property will suit me great, but I have some sort of tree. It is impossible to install any DB on that machine, so the variant with DB usage is declined at once.</p>
<p>Do we have any alternative to Java properties to solve this task?</p>
<p>P.S> Almost forgot, there's only JRE on remote PC and I have no way to install JDK there.</p>
<p>Thank you in advance for you help.</p>
| java | [1] |
4,723,813 | 4,723,814 | Scheduling a method to execute recursively and terminate that method | <p>I have a method which will be called repeatedly after successive intervals.
I have used <code>public void schedule(TimerTask task, Date firstTime, long period)</code>.
How to stop this schedule method being called after certain time.</p>
<p>Right now i have no idea how to stop this method.</p>
<p>Any help would be greatly appreciated.</p>
| java | [1] |
2,866,987 | 2,866,988 | jquery rotation which can rotate table html elements | <p>I have table with some data. Table has 40 nested tds like</p>
<pre><code><table>
<tr>
<td>
xxx
</td>
<td>
xxx
</td>
<td>
xxx
</td>
...
</tr>
</table>
</code></pre>
<p>now i am looking for some jquery rotation plugin which will rotate this tds. Does anyone know any good jquery rotation plugin which can rotate table tds? And when you gove over td with mouse it will stop, I am googling but i can not found anything like this.</p>
<p>example</p>
<p>| xxx1 | | xxx2 || xxx3 || xxx4 || xxx5 || xxx6 || xxx7 || xxx8 || xxx9 || xxx10 |</p>
<p>this text will rotate like </p>
<p>| xxx11 | | xxx12 || xxx13 || xxx14 || xxx15 || xxx16 || xxx17 || xxx18 || xxx19 || xxx20 |</p>
<p>and so on...</p>
<p>hope you underastand what i am searching for</p>
| jquery | [5] |
4,817,480 | 4,817,481 | HTML of selected text | <p>Is there a cross-browser way to get HTML of selected text?</p>
| javascript | [3] |
2,315,860 | 2,315,861 | Download a PDF and rename it? | <p>I'm working on a little script to save some time. My script takes a given URL to a PDF and I want to download the PDF to the local computer, say to /Downloads but I want to rename the file with a name taken from a form. </p>
<p>Is this possible with PHP?</p>
| php | [2] |
2,059,292 | 2,059,293 | How to pass an value of type enum to another enum variable? | <p>I'm getting the value of in an enum variable but while assigning it to another variable of type enum its getting 0 all the time...Here's the code i'm using , dbProperties is the object of class DBProperties which has a member of type DBType. dbProperties.DBType is always returning 0 even after assigning a value to it...Please help...!</p>
<pre><code>DBType val = (DBType)cbDataType.SelectedIndex;
cbDataType.SelectedIndex = (int)val;
dbProperties.DBType = val;
</code></pre>
| c# | [0] |
2,742,014 | 2,742,015 | Asp.net FTP Upload and Unzip - Overwrite Files | <p>I got a custom CMS, would like to automate the upgrade.</p>
<p>Steps like:</p>
<p>1- Download the latest version zip. 2- Extract it to the local path (overwrite). 3- Exec the update stored proc.</p>
<p>I downloaded the latest zip but now ASP.net user doesn't have enough rights to overwrite, thats logical but what should I do and ideas?</p>
| asp.net | [9] |
212,264 | 212,265 | Converting/wrapping h264 video stream into MPEG2 TS | <p>I am reading in an mp4 file which I can demux. The file contains h264 video stream. I want to be able to wrap the h264 video stream in mpeg2 ts such that I can pass it onto other parts of the system as mpeg2 ts or even writing it into a new file as mpeg2 ts.
Any pointers would be appreciated.</p>
<p>Thanks,</p>
| c++ | [6] |
2,224,234 | 2,224,235 | Value Stored to during its initialization is never read when assigning a frame | <pre><code>CGRect bannerFrame = testView.frame;
bannerFrame = CGRectMake(0, 236, 480, 32);
testView.frame = bannerFrame;
</code></pre>
<p>I get <strong>Value stored to 'bannerFrame' during its initialization is never read</strong> this warning in analyze. How can i resolve it ??</p>
<p>Thanks in adv.</p>
| iphone | [8] |
2,180,810 | 2,180,811 | Getting the entire size of a website using php's FTP functions | <p>I'm trying to get the size of my website using php and ftp.
I would like to get the size of everything under httpdocs, (files and directories combined)</p>
<p>And have it output: My website is 42.5MB.</p>
<p>I've tried ftp_rawlist, but that gives me an ugly array that I have no idea how to parse. (Im new to php arrays). It also only gives me the file sizes of the files under httpdocs, not files within directories in httpdocs.</p>
<p>Is there some sort of recursive function that will do this?</p>
| php | [2] |
2,509,141 | 2,509,142 | explanation about activity re-creation on configuration change and context | <p>I'm pretty new to Android development and I'm looking for explanation about a problem I'm facing, for gaining deeper understanding of Android.</p>
<p>I have this piece of code:</p>
<pre><code>someAutoCompleteTextView.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus)
((AutoCompleteTextView)v).showDropDown();
else
((AutoCompleteTextView)v).dismissDropDown();
}
});
</code></pre>
<p>if the dropdown list is visible and the configuration changes (screen orientation) I'm getting a BadTokenException.</p>
<p>I understand that the activity is destroyed and a new one is created to replace it, but I don't quite understand what's really going on and why am I getting that exception,
after all, a new activity is created with new listeners registered to the new views and the old ones are destroyed.</p>
<p>I know that I can fix this by telling the manifest that I'll be handling configuration changes by myself, but I'm looking into deeper understanding.</p>
<p>thanks!</p>
| android | [4] |
5,062,146 | 5,062,147 | Android animation | <p>When i try to make a man run in android by displaying his images with his his legs in different position the animation does not look very good.It appears as two different images switching between one another.It does not look uniform.Is there any other way to implement animation in android.</p>
| android | [4] |
4,211,592 | 4,211,593 | How to remove namespace from Inherits Attribute without a Parser Error, Could not load type | <p>I've seen lots of posts about the Inherits Attribute, and the Parser Error "Could not load type"</p>
<p>I can get this working by putting "RootNamespace.PageName" for a specific page, where RootNamespace matches the Root namespace in my project properites.</p>
<p>But I would rather not put the namespace in there. i.e. I would rather put "PageName" than "Namespace.PageName".</p>
<p>I have a library project with a few DLLs and 10 or so .aspx and .ascx files.
To get an update of my library project, other projects in my company copy the DLLs in and then copy the .aspx and .ascx files into a specific folder in their project.</p>
<p>Only problem is every time they copy they have to change the Namespace of the inherits attribute to match the root namesapce in their project.
If they don't do this, they get no compiler errors but just get a Parser error when they hit the libary .aspx and .ascx files.</p>
<p>This is very annoying, it seems very ridiculous that so many pages will not work if the project root namespace changes.</p>
<p>Does anybody have any ideas on how I can make library pages and user controls for nuse withing other peoples projects?</p>
<p>Thanks,
Mike G</p>
| asp.net | [9] |
3,846,590 | 3,846,591 | show one random list out of many on page load | <p>help guys</p>
<pre><code><ul>
<li><p>“I should say upfront that I have never been in a cellar in my life. In fact, I can see no reason why anyone should ever go into a cellar unless there is wine involved.”</p>
<span class="author">~Rachel Hawkins, Hex Hall</span></li>
<li><p>“There is truth in wine, but you never see it listed in the ingredients on the label”</p><span class="author">~Josh Stern</span></li>
<li><p>Wine is bottled poetry.</p><span class="author">~Robert Louis Stevenson</span></li>
</ul>
</code></pre>
<p>just wanted to show 1 random list every time page refresh or loads</p>
| php | [2] |
1,254,324 | 1,254,325 | Adding dynamic content from a database | <p>I'm using a new no-name framework that I'm not completely familiar with and I'm hung up on how I will add dynamic content from the database in this environment.</p>
<p>In the index controller, I'm forced to have an index function that answers all requests for index.html. If I wanted to create a second page dynamically from a data source, how do I go about this without having to add a controller for this new page? All requests are currently being routed by htaccess. Without getting into code snippets, I'm simply looking for the logic on how this is generally handled.</p>
| php | [2] |
4,899,271 | 4,899,272 | How to get MD5 from debug.keystore file? | <p>I use some command to get MD5 private key from <code>debug.keystore</code> file but actually I get SHA1 private key instead of MD5. I do not know how to get MD5.</p>
<p>This is command that I use.</p>
<pre><code>keytool -list -alias androiddebugkey -keystore (path_to_debug_keystore).keystore -storepass android -keypass android
</code></pre>
| android | [4] |
433,179 | 433,180 | Need help to debug jQuery char counter logic | <p>I have a textarea with a counter below that counts input characters. There is a maximum input limit set as well. I also added couple of spans that insert values into that textarea too when they are clicked. </p>
<pre><code><span id="tag1" class="tags"></span>
<span id="tag2" class="tags"></span>
<br>
<textarea id="myTextArea"></textarea>
<br>
Counter: <font id="charCount"></font>
</code></pre>
<p>The content in the spans contains a numeric value, like (10). When the value is inserted into textarea I need the counter to increase by that value and not by the char count in the insert.</p>
<p>Currently some of it works and some not. Need help putting it together. I put my code here: <a href="http://jsfiddle.net/8R9DH/11/" rel="nofollow">http://jsfiddle.net/8R9DH/11/</a></p>
<hr>
<p>EDIT: </p>
<p>Expected behavior:</p>
<ol>
<li>Input into text area can be done via typing in directly or by clicking on of the spans or a combination of both</li>
<li>Counter counts all characters up to a max and stop input once the limit is reached</li>
<li><p>Counter counts each character and space entered manually but when an insert is user the counter is increased by the numeric value contained in the include. Eg.
<strong><em><text include (5)></em></strong> == 5 or <strong><em><text include (10)></em></strong> == 10
For example, the following input should be counted as 13 characters:</p>
<pre><code><textarea id="myTextArea">abc <text insert (5)> 123</textarea>
</code></pre></li>
</ol>
| jquery | [5] |
2,538,792 | 2,538,793 | Code Signing Error with iPhone Configuration utility for in-house distribution | <p>We have an Enterprise license to distribute our app in house. From that account on developer.apple.com, we generated a provisioning profile. On some people's machines, the provisioning profile works and they are able to install the app. On others, they get, </p>
<blockquote>
<p>"Could not install application on device. Error: A signed resource
has been added, modified, or deleted."</p>
</blockquote>
<p>Are there particular things I can check to see why it works on some people's machines and not on others? Thanks.</p>
| iphone | [8] |
343,316 | 343,317 | Asp.net request.querystring | <p>I am using request.querystring just to access a parameter which I am passing from one page to other.</p>
<p>It is giving me error.
Non-invocable member 'System.Web.HttpRequest.QueryString' cannot be used like a method. </p>
<p>I am using C#.</p>
<p>Any help would be appreciated!</p>
| asp.net | [9] |
2,585,719 | 2,585,720 | Get a href attr and set it to another | <pre><code><script type="text/javascript">
$(function() {
$('.thelink a').select(function() {
var a_href = $(this).attr("href");
});
$('.calltoActionMoreInformation a').attr('href', a_href);
});
</script>
<div class="thelink" style="height: 250px; position: relative;">
<a title="xxx" href="xxx">
<img alt="tree" src="x" />
</a>
</div>
</code></pre>
<p>Trying to put the href from a inside into:</p>
<pre><code> <span class="calltoActionMoreInformation" style="position: absolute; bottom: 0px;">
<a title="" href="--Link here--"></a>
</span>
</code></pre>
<p>If I set var a_href = 'http://www.google.co.uk'; it sets it correctly, so the problem lies within getting the href of the only a link within .thelink div..</p>
<p>How do I assigned the href in .thelink a to .calltoActionMoreInformation a <strong>?</strong></p>
| jquery | [5] |
1,813,625 | 1,813,626 | dir() function in commandline vs IDLE | <p>I've tried running the following code in IDLE:</p>
<pre><code>import sys
dir(sys)
</code></pre>
<p>There is no result:</p>
<pre><code>>>>
</code></pre>
<p>But when I run it in the command line, i get this:</p>
<pre><code>>>> dir(sys)
['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_getframe', '_mercurial', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dllhandle', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'exc_traceback', 'exc_type', 'exc_value', 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info', 'float_repr_style', 'getcheckinterval', 'getdefaultencoding', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'gettrace', 'getwindowsversion', 'hexversion', 'long_info', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'py3kwarning', 'setcheckinterval', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoptions', 'winver']
</code></pre>
<p>Can someone explain the difference in what I did?</p>
| python | [7] |
966,523 | 966,524 | Obtain the result in easier way | <p>I need to get an array containing reversed alternate elements of the original array.</p>
<p>For example: an array containing elements {12,56,67}.</p>
<p>I need to get an array containing {67,12}
(reversing array to get {67,56,12} then take alternate elements means {67,12})</p>
<p>I need to do this in c#</p>
| c# | [0] |
4,158,994 | 4,158,995 | Pass an object as parameters to a function in C++ | <p>In Javascript or ActionScript it's possible to pass an object to a function or a constructor.</p>
<pre><code>myfunction({myParam:1, myOtherParam:"hello"});
</code></pre>
<p>It is very useful when you have a lot of parameters to pass, IMO it makes using functions easier than using the classic approach.</p>
<pre><code>myFunction(1,"hello");
</code></pre>
<p>Is there something similar in C++?</p>
<p>TIA</p>
| c++ | [6] |
3,403,602 | 3,403,603 | Multi tab jquery issue with cvs3DLib-07, jquery say has no replace method at Line 6710 | <p>Referring to the post as mentioned in <a href="http://stackoverflow.com/questions/3847152/jquery-simple-tab-program-does-not-show-nested-div-tag/14859890#comment20830148_14859890">JQuery simple tab program does not show nested Div Tag</a> </p>
<p>I am using 3D Library, that is cvs3DLib-07.js, moment i include it all jquery tab features goes away, I have spent significant time over it any help is deeply appreciated.</p>
<p>Thanks in Advance.</p>
| jquery | [5] |
1,962,995 | 1,962,996 | What to use thread or Services for android multiplayer game app | <p>Need some help. So I am creating a multiplayer game app in android. Basically I have simultaneous thread running at the same time like UI thread, gameEngine thread, connect to server thread. Right now my app is using around 80% of the CPU resource. I think the cause of this has to do with the multiple threads. Is this normal?</p>
<p>So my question is do I use services for connecting to the server? or thread is fine? What is typical CPU usage for game app specially multiplayer game app?</p>
<p>Thanks. :) </p>
| android | [4] |
2,987,592 | 2,987,593 | how to start learning JavaScript | <p>I am experienced in the technical support like Linux, oracle, sunos etc and but if i say scripting i know little bit of bash. Now i promoted to manage technical engineers including some JavaScript developers, so i want to learn JavaScripting so that i can understand engineers. Hope you understand. Can you please advise me how can i start JavaScripting and point me to some simple docs and examples.</p>
| javascript | [3] |
4,943,251 | 4,943,252 | Problem with System.nanoTime() | <p>I´m working on a 2d java game but I´m stuck on timer problems. Here is my game loop:</p>
<pre><code>void gameLoop(isRunning){
....
doStuff();
....
}
</code></pre>
<p>I have a fps measuring code like this inside the loop:</p>
<pre><code>long thisLoop = System.currentTimeMillis();
delta = thisLoop - lastLoopTime;
lastLoopTime = thisLoop;
</code></pre>
<p>So I get how much time has passed since last loop. However, whenever I try to use <code>System.nanoTime()</code> instead of <code>System,currentTimeMillis()</code> like this:</p>
<pre><code>long thisLoop = System.nanoTime();
delta = thisLoop - lastLoopTime;
lastLoopTime = thisLoop;
</code></pre>
<p>My game gets completely screwed, doesn't render anything past first frame, no errors reported just frozen. I´m on win 7 64 lastest java 1.6. What could be wrong?</p>
| java | [1] |
3,958,650 | 3,958,651 | StringValueof && To String' What is difference? | <p>What is difference betwin this two:?</p>
<pre><code>int a=20;
System.out.print(a.toString);
System.out.print(String.valueOf(a));
</code></pre>
<p>Thanks!</p>
| java | [1] |
1,487,353 | 1,487,354 | Properties or fields in Equals and GetHashCode? | <p>I'm using a mix of <a href="http://stackoverflow.com/a/263416/47493">Jon Skeet's GetHashCode</a> and the <a href="http://msdn.microsoft.com/en-us/library/ms173147%28v=vs.80%29.aspx" rel="nofollow">MSDN Guidelines for Overloading Equals</a> to implement my Equals and GetHashCode methods. However, one thing has been bothering me.</p>
<p>Should I implement them checking against the actual fields in the class, or their properties?</p>
<p>Furthermore, what about a parent class's properties with fields that are private (thus I can't access them) - should I be checking those as well, and then should I check them via their properties?</p>
| c# | [0] |
749,229 | 749,230 | Preferring non-member non-friend functions to member functions | <p>This question title is taken from the title of item #23 in Effective C++ 3rd Edition by Scott Meyers. He uses the following code:</p>
<pre><code>class WebBrowser {
public:
void clearCache();
void clearHistory();
void removeCookies();
//This is the function in question.
void clearEverything();
};
//Alternative non-member implementation of clearEverything() member function.
void clearBrowser(WebBrowser& wb) {
wb.clearCache();
wb.clearHistory();
wb.removeCookies();
};
</code></pre>
<p>While stating that the alternative non-member non-friend function below is better for encapsulation than the member function clearEverything(). I guess part of the idea is that there are less ways to access the internal member data for the WebBrowser if there are less member functions providing access.</p>
<p>If you were to accept this and make functions of this kind external, non-friend functions, where would you put them? The functions are still fairly tightly coupled to the class, but they will no longer be part of the class. Is it good practice to put them in the class's same CPP file, in another file in the library, or what?</p>
<p>I come from a C# background primarily, and I've never shed that yearning for everything to be part of a class, so this bewilders me a little (silly though that may sound).</p>
| c++ | [6] |
1,285,434 | 1,285,435 | Getting Forms on Page in Python | <p>I'm working on a project (web vulnerability scanner).</p>
<p>I have compleate 30% of the program it can scan only GET Methods.
but having a problem now. I have no idea how I shall make the program pentest the POST Method (the forms) .</p>
<p>I'm having a idea to make it Extract the form data/names from all the pages on the website. but having no idea how I shall do it. Any ideas? This is in Python.</p>
| python | [7] |
5,889,738 | 5,889,739 | How can I get whether textBox is changed in Android Activity? | <p>I have a activity contains many edittexts. How can I know whether the user have input or change the content of the edittext?</p>
<p>Not check one edittext, there are many edittexts in the activity. If one of them has been changed. While the user leave the activity, I need tell he/her, the information is not saved.</p>
| android | [4] |
5,623,685 | 5,623,686 | php - simple cache feature - retrieve data every hour | <p>I want to set up a simple cache feature with php. I want the script to get data from somewhere, but not to do it on every page view, but only every hour. </p>
<p>I know i can have a cron job that runs a php script every hour.</p>
<p>But I was wondering if this can be achieved without cron, just inside the php script that created the page based on the data fetched (or cached). I'm really looking the simplest solution possible. It doesn't have to be accurate</p>
| php | [2] |
1,706,298 | 1,706,299 | How to edit a row in a text file with C++? | <p>I have a txt file like this:</p>
<pre><code>"shoes":12
"pants":33
"jacket":26
"glasses":16
"t-shirt":182
</code></pre>
<p>I need to replace the number of jacket ( from 26 to 42 for example ). So, I have wrote this code, but I don't know how to edit a specific row where there is the word "jacket":</p>
<pre><code>#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream f("file.txt");
string s;
if(!f) {
cout< <"file does not exist!";
return -1;
}
while(f.good())
{
getline(f, s);
// if there is the "jacket" in this row, then replace 26 with 42.
}
f.close();
return 0;
}
</code></pre>
| c++ | [6] |
5,512,427 | 5,512,428 | How to calculate area inside multiple geo coordinates in android | <p>In my application i am capturing all selected location gps coordinates,and also i am drawing line between each selected coordinates.</p>
<p>I already know how to calculate distance between two points </p>
<p>but in my application user may select any number of locations so i wants to calculate the area between all selected coordinates</p>
<p>can any one please tell me how to calculate area inside n number of coordinates.</p>
<p>And also please let me how to convert the resulting area into acres.</p>
<p>since from 2 days i am searching a lot to achieve this but not succeeded so please help me</p>
| android | [4] |
3,336,927 | 3,336,928 | asp:TextBox Disabled style is not consistent in different Browsers | <p>ASP.NET</p>
<p>When <code>TextBox1.Enabled = false;</code> it has a gray background in FF3, but no change in IE8 or Chrome. So it's harder to tell if it's disabled or not. Is there any more general way to make the disable textbox rendered more consistent on a top-level? So I don't need to change this for every page or every website? Please advise, thanks.</p>
| asp.net | [9] |
329,825 | 329,826 | How to display picture in imageview photo taken by camera in android | <p>can anybody tell How to display picture in imageview photo taken by using front camera in android can anybody provide code</p>
<p>Thanks</p>
| android | [4] |
3,092,001 | 3,092,002 | jQuery sibling selector | <p>I have the following:</p>
<pre><code><input name="Check100" type="checkbox">
<tr>
<td><input name="ClassIDs" type="checkbox" value="3132">
<td>50</td>
</tr>
<tr>
<td><input name="ClassIDs" type="checkbox" value="3133">
<td>100</td>
</tr>
<script>
$('input[name=Check100]').change(function() {
var myChecked = $(this).attr('checked');
$('input:checkbox').attr('checked',myChecked);
});
</script>
</code></pre>
<p>But what I need to do is toggle all the inputs that have a 100 in column 2.</p>
| jquery | [5] |
2,752,965 | 2,752,966 | C# Rich Text Box, Brace Matching | <p>Is there a good open source project with brace matching support? I was searching codeproject all day but failed to find any. Or atleast can someone advice me on how to tackle it? Thanks!</p>
<p>It can be in C# or VB.NET.</p>
<p><strong>Edit:</strong>
Sorry forgot to mention, I do not want to use other dll components since I'll have to include them in the directory to use them... I'd create my own so all I have is JUST the exe file to give out. Thanks!</p>
| c# | [0] |
5,347,000 | 5,347,001 | Up-to-date jQuery books | <p>jQuery just released version 1.6.4. Despite that, the list of "books about jQuery" at the bottom of jquery.com all deal with jQuery 1.4 or below. Where can I find jQuery literature dealing with the more cutting edge features of jQuery available in 2011?</p>
| jquery | [5] |
5,186,779 | 5,186,780 | Android: code to handle return button of the softkey or return button which is on mobile | <p>in my application I collect some data by the client. On the main layout.xml client put some data and in last they need to click on save button after that all the data will store in database or in other place. What I want when the client is in middle of the application and when he press on return button or back button then one alert box will popup that show data will loss what do you want "Yes" or "No".
on clicking on "Yes" application will stop and go to the home screen and if he press on "No" button then it return to the current layout where the client entering the data.</p>
<p>Please give the code for this problem. </p>
<p><img src="http://i.stack.imgur.com/yyB8c.jpg" alt="enter image description here"></p>
| android | [4] |
64,395 | 64,396 | Should I learn on the iPhone App Dev 3.0 or not | <p>I think the 3.0 update is coming out in July 09, that is about 30 days away.</p>
<p>Coming from a C# background, I am learning objective C and my way around a mac.</p>
<p><strong>Should I start learning with the 2.2 or 3.0?</strong></p>
| iphone | [8] |
4,943,286 | 4,943,287 | only can write until the 924th byte using RandomAccessFile | <p>Im having a problem when i try to fill up a randomaccessfile, in using a loop for it and it stops writing when it reaches de 924th byte, so when i try to fill up 2500 bytes with "-" for example, it only fills 924 byte. Here is the code that im using, hope someone can tell me what i am doing wrong</p>
<pre><code>public class Hashing {
private RandomAccessFile espacio;
public Hashing() throws FileNotFoundException, IOException{
File amigos = new File("Texto");
String r = "rws";
espacio = new RandomAccessFile(amigos ,r);
this.estableceEspacioLlenado();
}
public void estableceEspacioLlenado() throws IOException{
int a = 0;
while(a<2500){
if(a>=241 && a%241==0){
espacio.writeBytes("\n");
a++;
}
else{
espacio.writeBytes("-");
a++;
}
}
}
}
</code></pre>
<p>output file:</p>
<pre><code>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
</code></pre>
| java | [1] |
3,466,079 | 3,466,080 | local php files will not work | <p>I have to do a php project. I done php before so I understand the syntax for the most part. Just for a test, I made a file.php and in it I wrote:</p>
<pre><code> <html>
<body>
<?php echo "helloWorld"; ?>
</body>
</html>
</code></pre>
<p>Well it won't display. The screen is blank. I tried it in chrome, firefox, IE and nothing wants to dispaly. Actually in IE, the source is displayed which is wierd. I also tried it without all the html and just used xampp to render it. It will not work. If I right click tho in the browser and view source, the code is there. Any ideas on what's going on?</p>
| php | [2] |
2,262,551 | 2,262,552 | rss@gmail.com&b=52 I want to remove &b=52 from this mail id which String function is used for this | <p>Please give me the code for removing the <code>&amp;b=52</code> from strings such as these:</p>
<ul>
<li>rsc@gmail.com&b=52</li>
<li>ab@gmail.com&b=52</li>
<li>aaaa@gmail.com&b=52</li>
</ul>
| java | [1] |
1,028,014 | 1,028,015 | ASP.NET - Browser always returns "Page not found" message the first time I request the start page | <p>Whenever I start a new browser session and request the start page of my ASP.NET site, I am redirected to a different URL that is similar to the one I requested. For example, if I request the page</p>
<pre><code>http://myserveralias.xyz.com/virtualfolder/startpage.aspx
</code></pre>
<p>I am redirected to</p>
<pre><code>http://myserveralias.xyz.com/virtualfolder/startpage.aspx,/virtualfolder/startpage.aspx
</code></pre>
<p>If I remove everything after the comma and try again, the page loads without error.</p>
| asp.net | [9] |
2,264,538 | 2,264,539 | Multiple project solution, 'missing assembly reference' despite including it | <p>I have two projects in the current solution:</p>
<pre><code>abc.Dashboard
abc.ThingyService
</code></pre>
<p>abc.ThingyService needs to be able to use a class from abc.Dashboard.</p>
<p>I've added a reference to abc.ThingyService pointing at abc.Dashboard (right click on project -> add reference -> projects -> abc.Dashboard) but it's not recognising that it has been added.</p>
<p>One of the files in the abc.ThingyService project contains:</p>
<pre><code>using abc.Dashboard.Services
</code></pre>
<p>When I compile, I get the error:</p>
<pre><code>The type or namespace name 'Dashboard' does not exist in the namespace 'abc' (are you missing an assembly reference?)
</code></pre>
<p>Am I missing something very obvious here? :/</p>
| c# | [0] |
4,091,723 | 4,091,724 | Stack size dimension ocupied by recursive function | <p>For a C++ program that is using a recursive function, how can I evaluate the dynamic stack size occupied by this function? </p>
| c++ | [6] |
4,155,810 | 4,155,811 | JQuery ControlID in User control | <p>I have an ASP.NET Usercontrol and am using JQuery to do some stuff for me. I use the User control dynamically in different pages. I need to get the ControlID of the control that is in the user control. How do i dynamically do a $('#myControl') instead if $('#HostPage.myControl'), <strong>what is the syntax for $('<%#myControl.ControlID'%>), or can I do this.</strong></p>
| jquery | [5] |
2,432,277 | 2,432,278 | exporting sql query result to excel | <p>In my asp.net application i wanted to export the SQL query result to Excel and that excel should be avaliable to the user as a download.
Please help</p>
| asp.net | [9] |
607,773 | 607,774 | What am I calling? | <p>Is there a way to check inside a fnc what is this fnc name? I'm working currently on LargeInt class and I've realized that code for oparator> and operator< is almost identical so I would like to know what operator is calling me and react accordingly.<br>
Thank you.</p>
| c++ | [6] |
4,092,932 | 4,092,933 | The point of pointers | <p><strong>I Know</strong> am very wrong about this, but i would like some help. What is the point of pointers in c++ when i can just declare variables. What, When, Where is a good situation to use them?</p>
| c++ | [6] |
1,062,728 | 1,062,729 | ASP.NET using DLL's instead of App_Code | <p>What are the advantages, if there are any, of using a separate DLL in the BIN folder instead of adding your classes to the App_Code folder. Is there a method preferred?</p>
| asp.net | [9] |
3,525,883 | 3,525,884 | How can I resize the image that was retrieved via URL and save it? | <p>I am getting an image via URL from the Internet and trying to resize (to a smaller size) before saving it. I managed to save it, but I'm unable to resize it. How could I do that? Here is the code:</p>
<pre><code>URL url = new URL(LogoURL);
InputStream input = url.openStream();
try {
OutputStream output = new FileOutputStream("data/data/com.android.mylogo/logo.jpg");
try {
//byte[] buffer = new byte[aReasonableSize];
int bytesRead = 0;
System.out.println("Buffer Length is \t:-" + buffer.length);
while ((bytesRead = input.read(buffer, 0, buffer.length)) >= 0) {
System.out.println("inside while");
output.write(buffer, 0, bytesRead);
}
} finally {
output.close();
System.out.println("saved image");
}
} finally {
input.close();
}
</code></pre>
| android | [4] |
2,141,533 | 2,141,534 | Javascript eval limits | <p>Is there a limit to javascript's eval, like in lenght?</p>
<p>I'm trying to build an app where you can store JS code in the DB, which you can later load and eval in order to execute it, but i'm reaching a limit.
First of all, the code has to all be in one line. Any multiline statements are not executed.
Next, i'm reaching a limit in length (i guess). If i execute the code manually, it works, but put that same code in the db, load it via ajax, and try to execute it, and it fails.</p>
<p>Any ideas why?</p>
| javascript | [3] |
2,350,847 | 2,350,848 | Android programatically inserted SMS have incorrect timestamp in Messaging apps | <p>I have tried to use the undocumented content provider (content://sms) to insert a SMS into the inbox, and the insertion is successful. Then I check the newly inserted mesage in the Messaging apps, however the time displayed is always the real time that the insertion is done, instead of the time I specified in ContentValues. After I clicked and viewed the message thread, the time is then updated to the value I set in ContentValues. Have I missed something? Please help, thanks so much</p>
<p>Her is part of my code</p>
<pre><code>Uri uri = Uri.parse("content://sms");
ContentValues cv = new ContentValues();
cv.put("address", "99912345");
cv.put("date", 1309632433677);
cv.put("read", 1);
cv.put("type", 1);
cv.put("subject", null);
cv.put("body", "Testing message");
getContentResolver().insert(uri, cv);
</code></pre>
| android | [4] |
4,501,803 | 4,501,804 | Accessing of UILabel object crash | <p>I created a UIView and a UILabel outlet for the XIB. In the first load is fine then I execute the removeFromSuperview to remove that UIView and call again the addsub to show that UIView again. But when I tried to access again the UILabel like the setText method then the app will crash. Do you think its about removeFromSuperview?</p>
<p>Thanks
sasayins</p>
| iphone | [8] |
2,326,182 | 2,326,183 | PHP grabing the dominant color from an image? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/8730661/how-to-find-the-dominant-color-in-image">How to find the Dominant color in image?</a> </p>
</blockquote>
<p>How I could grab the dominant color from a PNG image with php?</p>
<p>I've seen this achieved with jquery before but that's not an option due to the amount of images I'll be processing.</p>
<p>Here is a good example of what I am trying to achieve <a href="http://lokeshdhakar.com/color-thief/" rel="nofollow">http://lokeshdhakar.com/color-thief/</a> </p>
<p>Any ideas?</p>
| php | [2] |
5,540,851 | 5,540,852 | iPhone Image Loading in Photos Application | <p>I am not sure if this is the right forum for asking this question, but I googled "questions related to iPhone" and the first page had SO from top to bottom. So here goes.</p>
<p>When I open the Photos Application in iPhone (3GS, 4 and 5 all running iOS 5.0) and open an image, first a blurred image appears for a fraction of a second, which clears up into the actual picture. My question is, does the Photo application have a low resolution copy of the high res images which it displays while the image is being loaded, OR does it generate a low res image on the fly before going on to load the high res image.</p>
<p>I am writing an application to browse through the photos, and need to know which is the best approach. That is the purpose behind this question.</p>
| iphone | [8] |
3,072,837 | 3,072,838 | Moving stuff out of appdelegate | <p>I have a tricky situation in my app . i am making the server call in application did finish launching method based on the server response i need to load different views .my app is working fine in simulator but in device the app getting crashed because of the time taking to get the server response .i tried NSThread to run the server call but screen is becoming wait until it gets the response from the server.how can i move the stuff out the app deleagte method </p>
| iphone | [8] |
5,311,452 | 5,311,453 | Win 8 App Development: How does this tutorial code work? | <p>Just started learning Win 8 app development and I'm following the basic tutorial for data binding. </p>
<p>The code I'm trying to understand is:</p>
<pre><code><div id="basicBinding">
Welcome,
<span id="nameSpan" data-win-bind="innerText: name"></span>
</div>
<script type="text/javascript">
var person = { name: "Fran" };
var personDiv = document.getElementById("nameSpan");
WinJS.Binding.processAll(personDiv, person);
</code></pre>
<p></p>
<p>I understand it as follows, apologies if any of the terminology is wrong. </p>
<p>The first line in the script creates a variable called 'person' which is a object literal and within it we is stored the name data.</p>
<p>The second line creates the variable 'personalDiv' which stores the data that has been binded to the HTML span elemet 'nameSpan'.</p>
<p>The third line of the script actually processes the first and second line so that the variables are available to the rest of the code.</p>
<p>What I don't understand is how the span element actually outputs the 'name' value of Fran. I can't quite figure out exactly what is going on that allows the 'data-win-bind' call recognise the 'person' variable and retrieve the name data. the 'personDiv' variable seems to try and retrieve a value from 'nameSpan' before nameSpan even has a value (which Is obviously me just interpreting it wrongly but I can't see the correct logic. </p>
<p>I'm sure I've over complicated this a million times given its a beginners tutorial but any help would be much appreciated!</p>
<p>Thanks! </p>
| javascript | [3] |
4,149,259 | 4,149,260 | Detecting which object invoked the method in C# | <p>Is there a way in C# to detect which object invoked a method?<br>
for example:</p>
<pre><code>class Foo1
{
Foo2 m_inner = null
Foo1()
{
m_inner = new Foo2();
m_inner.Do();
}
}
class Foo2
{
Foo2()
{
}
void Do()
{
//Here I want to know that Foo1 called it.
}
}
</code></pre>
<p>IS it possible to know in Foo2::Do that it was called from Foo1?</p>
| c# | [0] |
5,580,830 | 5,580,831 | What is wrong with my firefox browser test? | <p>I want to test if the user is using Firefox under version 3.0, if yes trigger the function and here's what I ended up with! Now I use the version 14.0 of Firefox to test it out and it still trigger the function! Anyone can help a beginner? Thanks!</p>
<p>script:</p>
<pre><code>if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
var ffversion= Number(RegExp.$1) // capture x.x portion and store as a number
if (ffversion<=3)
{
</code></pre>
| javascript | [3] |
1,476,661 | 1,476,662 | Java : Object Initialization | <p>How to interpret the statements below:</p>
<pre><code>Notes bean = null;
bean = new Notes();
</code></pre>
<p>Small explanation would be very helpful. </p>
| java | [1] |
1,813,298 | 1,813,299 | Error in counting number of words and characters from a file in java | <p>I have written the following code to print file content and print the number of character and words from file</p>
<pre><code>import java.io.*;
import java.util.*;
class Ass53
{
public static void main(String args[]) throws Exception
{
File file=new File("sample.txt");
Scanner sc=new Scanner(new FileInputStream(file));
String line,line1;
int count1=0;
int count=0;
/*Loop for printing contents of file*/
while(sc.hasNextLine())
{
line=sc.nextLine();
System.out.println(line);
}
/*loop for counting number of character in file*/
while(sc.hasNext())
{
line1=sc.next();
for(int i=1;i<=line1.length();i++)
count1++;
}
System.out.println(count1);
/*loop for counting number of words in a file*/
while(sc.hasNext())
{
sc.next();
count++;
}
System.out.println("Number of words: " + count);
}
}
</code></pre>
<p>The problem is that only first while loop is executing.I guess the reason may be the sc.nextLine for first while loop.After first while loop sc points to nothing i guess?.</p>
<p>Is there any way to fix it?
I want that my other while loop also work</p>
| java | [1] |
1,030,938 | 1,030,939 | How to open two popup window on a button click? | <p>I need to open two pdf files as popup window on click ona button in asp.net C#,but now its opening only the first popup?Can anybody help me ,to open the both windows at the same time?</p>
<p>This is my code:</p>
<pre><code>string PDFPath = folderpath + filename;
string PopupName = "popUp";
string PopupSettings = "height=900,width=1000,top=100,left=100,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,status=yes";
string NewPath = "var popup=window.open('../PopupForReport.aspx?pdfPath="
+ PDFPath.Replace("\\", "/") + "','" + PopupName + "','" + PopupSettings + "')";
ScriptManager.RegisterStartupScript(updatePanel1, updatePanel1.GetType(), "popupOpener", NewPath, true);
string PDFPath1 = folderpath + filename1;
string PopupName = "popUp";
string PopupSettings = "height=900,width=1000,top=100,left=100,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,status=yes";
string NewPath1 = "var popup=window.open('../PopupForReport.aspx?pdfPath="
+ PDFPath1.Replace("\\", "/") + "','" + PopupName + "','" + PopupSettings + "')";
ScriptManager.RegisterStartupScript(updatePanel1, updatePanel1.GetType(), "popupOpener", NewPath1, true);
</code></pre>
| c# | [0] |
961,803 | 961,804 | how to put clickable image jframe | <p>i want to add icons in jframe which does some action while click like buttons. </p>
| java | [1] |
1,549,746 | 1,549,747 | C# Noob Looking for Little Help : Why this mini code doesnt works? | <p>I am very very new at C# and i am just trying a little code here. </p>
<p>But it didn't work. I don't understand why. And i dont get any erros on Visual Studio.
It just doesn't work right. I alwasy says " You wrote a higher number. " and close.</p>
<p>Can you help me?</p>
<p>You can understand what i am trying to do.</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int number = 4 ;
Console.WriteLine("Hello");
Console.WriteLine("Write a number from 1 to 10 : ");
int x = Console.Read();
if ( x < number )
Console.WriteLine("You write a lower number.");
else if ( x > number )
Console.WriteLine("You write a higher number.");
else
Console.WriteLine("True");
Console.Read();
}
}
}
</code></pre>
| c# | [0] |
1,710,104 | 1,710,105 | Does SSTab1.TabPages.Item(?) start from 0 or 1? | <p>Hallo all,</p>
<p>short question:</p>
<p>Does the index x in SSTab1.TabPages.Item(x) start from 0 or from 1? How could I find out which tab corresponds to which item(x)?</p>
<p>Thanks in advance,</p>
<p>John</p>
| c# | [0] |
5,335,328 | 5,335,329 | how to change value of global variable inside of function | <p>I am using javascript i create a global variable. by define it outside of function i want to change the global variable value from inside a function and use it from other function how to do this? </p>
| javascript | [3] |
2,933,468 | 2,933,469 | Internationalization in Manifest file | <p>I have some label in the manifest file which has english text how can i have them in other languages also.for e.g. </p>
<pre><code><activity
android:name=".activity.MainMenuActivity"
android:label="Main Menu Options"
android:configChanges="locale"
>
</activity>
</code></pre>
<p>I want to covert the lable to persian text.how can i do it.please help.</p>
| android | [4] |
1,610,073 | 1,610,074 | How to check if array a is part of array b in java? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/808394/check-whether-an-array-is-a-subset-of-another">Check whether an array is a subset of another</a> </p>
</blockquote>
<p>I have array <code>a = { 1,4,3,5,1,2,3,6 }</code> and array <code>b= { 1,2,3 }</code>.</p>
<p>How can I check if array <code>b</code> elements appear anywhere in array <code>a</code>? Any help will be appreciated. Thanks.</p>
| java | [1] |
2,624,605 | 2,624,606 | android how do you dynamically change a radiogroup based on the radiogroups selection | <p>I get an error on the "button2.setOnClickListener(<strong>radio_listener</strong>);" </p>
<p>Because its embedded inside the onclick listener calling itself, whats the way around this?</p>
<pre><code> final RadioGroup rGroup3 = (RadioGroup) findViewById(R.id.radio_gcam);
OnClickListener radio_listener = new OnClickListener() {
public void onClick(View v) {
RadioButton button = (RadioButton) v;
no_of_gcams = 3;
gcam_names_array[0] = "Machine 1";
gcam_names_array[1] = "Machine 2";
gcam_names_array[2] = "Machine 3";
gcam_names_array[3] = "Machine 4";
for (int i = 0; i < no_of_gcams; i++)
{
RadioButton button2 = new RadioButton(ModbusDroid.this);
button2.setText(gcam_names_array[i]);
button2.setOnClickListener(radio_listener);
rGroup3.addView(button2);
}
}
};
if (no_of_gcams == 0)
{
RadioButton button1 = new RadioButton(this);
button1.setText("Setup a G-CAM");
button1.setOnClickListener(radio_listener);
rGroup3.addView(button1);}
</code></pre>
| android | [4] |
800,509 | 800,510 | Open a PopUpWindow from an AppWidget | <p>As it doesn't appear to be possible to put an EditText in an AppWidget, I would like to open a PopUpWindow with an EditText when I click on it.</p>
<p>I know how to open an Activity from an AppWidget and I also know how open a PopUpWindow from an Activity. I don't, however, know how to open a PopUpWindow from an AppWidget. I've looked into many classes in the javadoc (Intent, RemoteViews, PendingIntent, etc.), but I can't find how to start this PopUpWindow. Any help would be appreciated.</p>
| android | [4] |
5,057,187 | 5,057,188 | Android search dialog in activity.. two problems | <p>I have a simple ListActivity right now, created using the code at <a href="http://developer.android.com/guide/topics/search/search-dialog.html#PerformingSearch" rel="nofollow">http://developer.android.com/guide/topics/search/search-dialog.html#PerformingSearch</a>.</p>
<p>I simply call onSearchRequested() in onCreate for the activity, and have this in the manifest inside the activity tag so it calls itself for search (copied from the android.com link above):</p>
<pre><code> <intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</code></pre>
<p>I have two problems:</p>
<p>1) The dialog covers the first two items in the listview, is there an id for the search dialog height, so I can set an appropriate margin-top value on my listview?</p>
<p>2) There's problems when clicking an item in the listview. It takes two taps, the first dismisses (puts out of focus and closes) the search dialog, then the second to be able to click it. I don't want this. I want to be able to click on a listview item with one tap, WITHOUT dismissing the search dialog. How can this be done?</p>
<p>Any help appreciated, the documentation for this is really useless.</p>
| android | [4] |
2,143,649 | 2,143,650 | Android: How do I create loading screen while access the database | <p>I have been developing one Map project. In all Activity classes i have one method called <strong>getDataFromServer()</strong> which parse some JSON Response from the server for the particular activity. And displays that data on the Map. While receiving and parse data , I want to display loading screen. How to make getDataFromServer() method in Doinbackground().</p>
<p>Please provide me the best way........
Thanks..</p>
| android | [4] |
4,385,030 | 4,385,031 | what is wrong here | <pre><code> unsigned __int8 result[]= new unsigned __int8[sizeof(username) * 4];
</code></pre>
<p>IntelliSense: initialization with '{...}' expected for aggregate object</p>
| c++ | [6] |
5,961,334 | 5,961,335 | Simple, server-side ASP.NET richtext control? | <p>I'm aware of TinyMce, FCKeditor, and Telerik RadEditor, but they are all too heavy weight for my needs. I just want a text box where the user can mark text as bold, italic, make a list, and most importantly spellcheck it. It should also be able to count the number of characters entered. Where I'm at now is a custom server control built on TinyMce, but this seems like such overkill and the delay while it converts the text areas client side is not very slick. </p>
<p>Is there a smaller, more lightweight rich text editor out there?</p>
| asp.net | [9] |
2,192,689 | 2,192,690 | jQuery - combine statements | <p>Could i trouble someone to help me combine these statements...everytime i do i get a script error, but am unable to debug what is exactly wrong...</p>
<pre><code><script type="text/javascript">
$(function() {
$('.slideshow').after('<div id="mininav"
class="mininav">').cycle({
fx: 'fade',
speed: 'fast',
timeout: 5500, pause: 1,
pager: '#mininav',
before: function() { if (window.console)
console.log(this.src); }
});
});
</script>
<script type="text/javascript">
$(function() {
$('.slideshow').hover(function() {
$('#mininav-pause').show(); },
function() { $('#mininav-pause').hide(); });
});
</script>
</code></pre>
| jquery | [5] |
1,906,617 | 1,906,618 | Is it possible to show push notification as popup message in android? | <p>I want push notification as popup message .I dont want to show it top of the status bar . when ever push notification arrives .Please help me!!</p>
| android | [4] |
5,382,610 | 5,382,611 | Add title="" to A PHP Code | <p>I am using a code to call WP thumbnails and want to add a title="" tag. I would like the title to call the_title... how do I do so? I want to assign the title tribute to the image, not the link.</p>
<p>My code:</p>
<pre><code><?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'thmb-archive' ); } ?>
</code></pre>
| php | [2] |
5,832,324 | 5,832,325 | unable to use gets(); and puts(); in c++ program | <p>unable to use <code>gets()</code>; and <code>puts()</code>; </p>
<p>In c++ program </p>
<blockquote>
<p>error : function should have a prototype</p>
</blockquote>
<p>code :</p>
<pre><code>.
.
gets(name);
or puts(name);
.
.
</code></pre>
<p>i have included header file <code>string.h</code></p>
| c++ | [6] |
2,361,988 | 2,361,989 | iPhone SDK: How to add an image to a UIBarButton? | <p>I have used the code below to create a button on the nav bar with an image.</p>
<p>I can see the image but I can also see the border of the button around it. My question is, how can I get rid of the button border. All I want to see is the image on the nav bar, no border.</p>
<pre><code>UIBarButtonItem *settingsBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_prefs.png"] style:UIBarButtonItemStylePlain target:self action:@selector(openSettings:)];
[[self navigationItem] setLeftBarButtonItem:settingsBtn];
[settingsBtn release];
</code></pre>
<p>Thanks in advance. Any pointers, links to read further or examples appreciated.</p>
| iphone | [8] |
4,520,813 | 4,520,814 | Updating a page before initiating a download? | <p>I've got a page that allows users to enter search criteria and then display matching records. It also has a download button to enable the user to download matching records. </p>
<p>How can I code it so that clicking on "Download" will first refresh the record display before downloading the data?</p>
<p>This is the code that I'm using for the download:</p>
<pre><code>Response.ClearContent();
Response.ClearHeaders();
using (MemoryStream outputStream = new MemoryStream())
{
// some details elided...
outputStream.Write(documentData, 0, documentData.Count());
string fileName = GenerateFileName();
Response.AppendHeader("content-disposition", String.Format("attachment; filename={0}", fileName));
outputStream.Flush();
outputStream.WriteTo(Response.OutputStream);
}
Response.Flush();
Response.Close();
</code></pre>
| asp.net | [9] |
4,607,958 | 4,607,959 | Hide Activity without finish() | <p>I want my application to launch another activity/application (in this case, the Browser application), but currently when the user presses the Back button to exit the Browser, they return back to my Activity.</p>
<p>How can I make it so they do not come back to my activity after leaving the Browser, <strong>but</strong> if they relaunch my application later, the <code>Activity</code> stack of my application is as it was previously (i.e., cannot <code>finish()</code>, because that will remove the current <code>Activity</code> from the stack)?</p>
| android | [4] |
4,300,802 | 4,300,803 | jQuery is not submitting form values with .submit() | <p>i have a form with action = post and i am validating it with after validating it i am submitting that form with $("#form").submit();
but it is submitting all fields nullled while i have data in those fields.... how can i post those fields filled..</p>
| jquery | [5] |
635,744 | 635,745 | Strange results when searching if value exists in list | <p>Here's the area of code I'm having problems with. T1 and T3 are both lists of lists:</p>
<pre><code>for num in T1:
print num
print T3[0]
print type(num)
print type(T3[0])
if num == T3[0]:
print 'they are the same!'
else:
print 'nope they are not!'
if T3.index(num):
print 'number exists in list!'
</code></pre>
<p>Here's the result:</p>
<pre><code>[0, 0]
[0, 0]
<type 'list'>
<type 'list'>
they are the same!
</code></pre>
<p>The values and types are the same but when I don't see 'number exists in list!' When I tested <code>list_name.index(value)</code> on the command line it works but not here. What am I doing wrong?</p>
| python | [7] |
459,673 | 459,674 | Validation to check if password and confirm password are same is not working | <p>Here's my code:</p>
<pre><code>function validate_form(thisform)
{
with (thisform)
{
if (validate_required(name,"Name must be filled out!")==false)
{name.focus();return false;}
if (validate_required(country," Country must be filled out!")==false)
{country.focus();return false;}
if (validate_required(state,"State must be filled out!")==false)
{state.focus();return false;}
if (validate_required(city,"City must be filled out!")==false)
{city.focus();return false;}
if (validate_required(contact,"Contact must be filled out!")==false)
{contact.focus();return false;}
if (validate_required(emailid,"Email must be filled out!")==false)
{emailid.focus();return false;}
if (validate_email(userid,"Email is not valid")==false)
{userid.focus();return false;}
if (validate_required(password,"pasword must be filed out")==false)
{password.focus();return false;}
if (validate_required(cpassword,"Password must be confirmed")==false)
{cpassword.focus();return false;}
if(validate_required((password.value != cpassword.value),"Your password and confirmation password do not match.")==false) {
cpassword.focus();return false;
}
</code></pre>
<p>All other validations are working but not the last one. Why is that so and how to fix it?</p>
| javascript | [3] |
3,370,043 | 3,370,044 | Pythonic way to access arbitrary element from dictionary | <p>I have a dictionary, full of items. I want to peek at a single, arbitrary item:</p>
<pre><code>print "Amongst our dictionary's items are such diverse elements as: %s" % arb(dictionary)
</code></pre>
<p>I don't care which item. It doesn't need to be <em>random</em>.</p>
<p>I can think of many ways of implementing this, but they all seem wasteful. I am wondering if any are preferred idioms in Python, or (even better) if I am missing one.</p>
<pre><code>def arb(dictionary):
# Creates an entire list in memory. Could take a while.
return list(dictionary.values())[0]
def arb(dictionary):
# Creates an entire interator. An improvement.
for item in dictionary.itervalues():
return item
def arb(dictionary):
# No iterator, but writes to the dictionary! Twice!
key, value = dictionary.popitem()
dictionary[key] = value
return value
</code></pre>
<p>I'm in a position where the performance isn't critical enough that this matters (yet), so I can be accused of premature optimization, but I am trying to improve my Python coding style, so if there is an easily understood variant, it would be good to adopt it.</p>
| python | [7] |
2,271,155 | 2,271,156 | refresh a view in iphone programming | <p>i want to refresh my current view when i click a button
how to do this </p>
| iphone | [8] |
4,081,011 | 4,081,012 | Jquery data retrieving not work | <p>I need to store the data to each 'li' element of my 'ul', in case if i assigning the value like this:</p>
<pre><code>$('li:eq(0)').data('some', {name:'some',age:'some'})
$('li:eq(1)').data('some', {name:'some',age:'some'})
</code></pre>
<p>then is it correct. or any other short way to set the data to element?</p>
| jquery | [5] |
5,115,301 | 5,115,302 | How to guarantee Java instance control (without enum) in world of serialization? | <p>In a world before Java 1.5 (so no <code>enum</code>) and with my object being serialized, how can I enforce proper instance control? I'm talking about a class like this, where, as far as I can tell, I'm not sure that instance0 and instance1 will always be the only instances.</p>
<pre><code>import java.io.Serializable;
public final class Thing implements Serializable {
private static final long serialVersionUID = 1L;
public static final Thing instance0 = new Thing();
public static final Thing instance1 = new Thing();
private Thing(){};
}
</code></pre>
| java | [1] |
3,115,166 | 3,115,167 | TypeError: Result of expression 'input.replace' [undefined] is not a function | <p>I wrote the following function in javascript:</p>
<pre><code>function maskString(input) {
return input.replace(/\s\s+/," ");
}
</code></pre>
<p>Very simple.
In a second function I wrote:</p>
<pre><code>function secondFunction(string1, string2) { //Attetion! See Update 2!
var string1masked = maskString(string1);
var string2masked = maskString(string2);
( ... )
}
</code></pre>
<p>The error message is:
<code>TypeError: Result of expression 'input.replace' [undefined] is not a function.</code></p>
<p>Anybody an idea? Google wasn't really helpful :\</p>
<p><strong>UPDATE 1:</strong><br>
I'm using jQuery and string1 is from an textbox. I'm calling the second function like this:</p>
<pre><code>var bool = secondFunction (textarea1.val(), textarea2.val()); //Attetion! See Update 2!
</code></pre>
<p><strong>UPDATE 2:</strong><br>
I was wrong with the second function ... It's:</p>
<pre><code>function secondFunction(string1, array1) {
var string1masked = maskString(string1);
var array1masked = maskString(array1);
( ... )
}
</code></pre>
<p>So my function doesn't work with the array. Unfortunately I have no idea how to change it :(</p>
| javascript | [3] |
2,450,822 | 2,450,823 | c++ unable to get proper string input | <p>I am new to programming just wrote this simple function to calculate length of a string but I am unable to take input string from the user properly(have tried my alternatives).</p>
<pre><code>/////////Function to calculate length of a string////////////////////
void str_length(){
char str[30];
int counter=0;
cout << "Enter string: ";
gets(str);
//cin.getline(str,256);
//cin >> str;
for(int i=0;str[i] != '\0';i++){
counter++;
}
cout << "String length is: " << counter << endl;
}
///////////////////////////////////////////////////////////////
</code></pre>
<p>of all possible ways the program either exits abruptly or with 'cin' I can only get partial string till the first space.</p>
| c++ | [6] |
1,097,292 | 1,097,293 | java listing the txt files in sub folders | <p>Hi I have a jlist and currently it is viewing a folder + subfolders... Now i would like to change this to view the files in the subfolders as well. below please find the code I am currently using:</p>
<pre><code> jList1.setModel(new javax.swing.AbstractListModel()
{
File folder = new File ("/Assignment_Datex/message_outbox/");
File[] listofFiles = folder.listFiles();
// @Override
public int getSize()
{ return listofFiles.length; }
// @Override
public Object getElementAt(int i)
{ return listofFiles[i];}
}
);
</code></pre>
<p><img src="http://i.stack.imgur.com/IQqNA.jpg" alt="enter image description here"></p>
<p>Right now as you can see in the screenshot, the Jlist is only viewing the folders and not the files in them... Any help please?</p>
| java | [1] |
3,742,359 | 3,742,360 | Selector with image and textview at the same time | <p>I know how to make a selector for imageview and how to do it for textView ,now i have a tabwidget that contains tabs each tab have image and text view below it , my question is how to change the background of the image view and the color o it text view when the user click on the tab .</p>
| android | [4] |
2,388,439 | 2,388,440 | document.activeElement.id is not working | <p>I am developing an application for device. and i want to know the current focused anchor.</p>
<p>for this i used <strong>document.activeElement.id</strong>. It is working fine on webkit but not working on older browser.
So i used </p>
<pre><code> $(":a").focus(function () {
id = this.id;
});
</code></pre>
<p>It is also not working. I go through meny website and i found that .focus method wil work for only <strong>input</strong> tag.</p>
<p>So please give me IDea for this problem . If it will be purely javascript it will be better .</p>
<p>Any help will be appricated</p>
| javascript | [3] |
1,098,969 | 1,098,970 | Implement animation in UIButton | <p>I'm new to cocoa and iphone programming and I want to implement an animation in UIButton. For example, I create a custom UIButton with a square image. Then when I press that UIButton, the square image will flip. Note that the square image is the image of the UIButton.</p>
<pre><code>[UIButton setImage:[UIImage imageNamed:@"square.png"]];
</code></pre>
| iphone | [8] |
4,208,368 | 4,208,369 | jquery: add html after a group of divs | <p>I have something like this:
...</p>
<pre><code><div id="d120" >content</div>
<div id="d123" >content</div>
<div id="d112" >content</div>
<div id="d145" >content</div>
<div id="d134" >content</div>
//Insert here hello world
<div id="bla" >asd</div>
<div id="footer" >asd</div>
</code></pre>
<p>anybody knows how to insert html after all the divs that have id like d+number</p>
| jquery | [5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.