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,838,475
5,838,476
Apply jQuery function to one element and *NOT* its descendants
<p>I want to add certain classes to the various levels of my websites nav header. So I'll have something in the end like</p> <pre><code>$('#navCol &gt; ul &gt; li &gt; ul &gt; li &gt; ul').addClass('lvl2'); // Each ‘li &gt; ul’ past the first ‘ul’ indicates another sub-level. </code></pre> <p>to add the <code>lvl...
jquery
[5]
3,551,113
3,551,114
Handling large strings in Android (OutOfMemeryError)
<p>I am currently working on an Android application and has encountered an OutOfMemoryError on a Motorola Defy. </p> <p>The place where the error occurs, is where I convert a 5MP image to a Base64 encoded string which subsequently is sent to a web service contained in a SOAP document. </p> <p>I am aware, that both th...
android
[4]
2,967,942
2,967,943
Difference between calling function and referencing function?
<p>Look at the following code:</p> <pre><code>window.onload = someFunction; </code></pre> <p>Many times I see the use of this kind of code and even I use the same. But, there are still few things unclear. </p> <ol> <li>The above is a call to <code>someFunction</code> as soon as the page loads, right. But, aren't we ...
javascript
[3]
3,128,175
3,128,176
uiview in navigation
<p>I am working with a navigation application. I have a homeViewController with two views(accept, service). When I click on a button in serviceView it should go to acceptView. I should have back button in navigation bar which takes me be back to serviceView from acceptView. When I am trying to use [self navigationContr...
iphone
[8]
860,381
860,382
issue in deleting when we have more than 1 file
<p>i have 10 files. i want to delete them but the condition here is as i delete file 1 to file 5 .let say in file6 i got an exception then in that case i should restore all the files deleted</p> <p>i should delete the files only if there is no exception occured in any of the file when we try to dele...
asp.net
[9]
2,621,115
2,621,116
Confusions about Wordpress get_the_title function
<p>The function:</p> <pre><code> /** * Retrieve post title. * * If the post is protected and the visitor is not an admin, then "Protected" * will be displayed before the post title. If the post is private, then * "Private" will be located before the post title. * * @since 0.71 * * @param int $id Optional. Pos...
php
[2]
2,093,261
2,093,262
SMS Manager for Dual Sim Phones?
<p>I am working with SMS Manager for sending sms in android.The code i am using is as below:</p> <pre><code>private void sendSms(String Phnno, String Message) { if (Utils.checkSIM(MyActivity.this)) { SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage(Phnno, null, Message, n...
android
[4]
3,590,714
3,590,715
How to create an immutable class
<p>I want to make the class below immutable. Can anyone provide a simple example of creating an immutable class in java?</p> <pre><code>class Emp implements Comparable { String name,job; int salary; public Emp(String n,String j,int sal) { name=n; job=j; salary=sal; ...
java
[1]
482,952
482,953
Draw a curve in iPhone?
<p>I am developing a game app in which a curve(Bezier) is required on the basis of theta provided by user and this will be in animated format. But i am not aware of openGL. Then how can i do it programatically?</p>
iphone
[8]
3,746,251
3,746,252
Is it normal for android emulator to load more that 7+ minutes?
<p>I tried to run android emulator with Google API 14 and Google API 3 the effect is the same - it loading more than 7+ minutes and seems to be stuck at displaying android logo. But whole this time my CPU is loaded with emulator process. Is it normal? Removing all avd api and reinstalling - will solve the problem?</p> ...
android
[4]
5,298,633
5,298,634
A case where named constants are not needed over magic numbers
<p>Obviously the point of using named constants over magic numbers is for code clarity and for not having to go through code changing numbers throughout.</p> <p>However, what do you do if you just have a number used just once in a function? Say you have a short member function that uses an object's velocity (which we'...
c++
[6]
2,641,642
2,641,643
Jquery- recognize the object being acquired?
<p>Lets say I have this assignment : </p> <pre><code>$("myObj").val('1') </code></pre> <p>now lets say I want to add to <code>1</code> the existsing value , so : </p> <pre><code>$("myObj").val($("myObj").val()+'1') </code></pre> <p><em>p.s. , I dont want any outside variable to remember the value</em></p> <p>I...
jquery
[5]
2,907,141
2,907,142
how to draw candlestick charts in iphone?
<p>i am new to Quertz,How can I draw candle charts in IPhone? Does anybody has any examples with a nice interface for IOS?</p>
iphone
[8]
2,034,044
2,034,045
str_get_html and simply html dom
<p>way after str_replace function $img is empty and secont $img->find('img') function show error:</p> <pre><code>Fatal error: Cannot use object of type simple_html_dom as array in D:\wamp\www\test.php on line 7 &lt;?php require_once('simple_html_dom.php'); $img_html = str_get_html('hhtml tekst html tekst &lt;img ...
php
[2]
835,151
835,152
What's a suitable return type for this Java method?
<p>we are implementing a system with Strategy pattern. </p> <p>Some callers to a specific methods require a Hashmap of data while in some case it would be a user-defined DTO. Some need both.</p> <p>How do we decide which return type to use, instead of an Arraylist containing Hashmap and DTO ? Is there anything more a...
java
[1]
4,073,994
4,073,995
jquery if div not id
<p>i want to cut the price off to all input value in all divs, except only one <code>div sale_wrap</code>. how to make exception with jquery?</p> <pre><code>&lt;div id="one_wrap"&gt; &lt;input type="checkbox" name="1" value=""&gt; &lt;input type="checkbox" name="1" value=""&gt; &lt;/div&gt; &lt;div id="two_wrap"&g...
jquery
[5]
1,759,798
1,759,799
java regular expression showing middle results
<p>How do you show all the matches?For example I have one String "Hello world and how are you a". Here I have to get all the positions where letter 'a' resides.For that I wrote one sample java program. But here only start() and end() methods are available for matcher. How do I get the middle results? Please explain me....
java
[1]
1,342,374
1,342,375
two values in one field
<p>I've this simple form, when the price is set to <code>120</code> $:</p> <pre><code> &lt;input type="checkbox" name="addon[book]" value="120" /&gt; book &lt;input type="checkbox" name="addon[plane]" value="420" /&gt; Plane </code></pre> <p>Could I send two values (USD &amp; €) with thr form?</p> <p><strong>EDIT...
php
[2]
2,148,688
2,148,689
How Writing XMl file usning XMLStreamWriter in android
<p>i want create XML file here is my following code </p> <pre><code>String fileName = "jasstech.xml"; XMLOutputFactory xof = XMLOutputFactory.newInstance(); XMLStreamWriter xtw = null;** try { xtw = xof.createXMLStreamWriter(new FileOutputStream(fileName), "UTF-8"); xtw.writeStartDocument("UTF-8", "1.0"...
android
[4]
5,904,884
5,904,885
How to get the inner html value
<pre><code>&lt;span style="color: red"&gt; advertising cctv/bust&lt;/span&gt; &lt;span style="color: red"&gt;a&lt;/span&gt;tion </code></pre> <p>how to get the value from this text</p> <p>I used replace function but it removing only once and it ignoring second one </p> <p>how can i do this one</p>
javascript
[3]
4,746,964
4,746,965
How to change DataField of BoundField
<p>When using the <code>asp:boundfield</code>, can I call a C# function that return a string which corresponds to the column name instead of writing the column itself?</p> <pre><code> &lt;asp:BoundField DataField="Notes" HeaderText="Notes"/&gt; </code></pre> <p>Instead of having <code>DataField="Notes"</code>, I want...
asp.net
[9]
3,081,422
3,081,423
Return two widgets from a getView methord
<p>I am working in an android application and I want to implement a Gallery. And on my getView method now I return a Image View. In this method I want to return a button and an Image View. How can I do this.</p> <p>Thanks in advance</p> <p>This is ma code :</p> <pre><code>ImageView imageView = new ImageView(mContext...
android
[4]
2,545,713
2,545,714
Issue with sending form in jquery
<p>I am working on a function that lets people log in to their accounts and the form should be sent without reloading the page. The problem is, with my current code the form values are not sent for some reason. What is wrong with my code?</p> <p><strong>Jquery</strong></p> <pre><code>&lt;script type="text/javascript"...
jquery
[5]
2,846,159
2,846,160
If statement variable returning empty
<p>this is a test code i wrote to get a value set for $rectype to insert into a table. problem I'm having is $rectype is returning 0 or empty. the files do exist since I perform a similar is_file check to start the process that leads up to this section of the coding</p> <pre><code>$dirchk1 = "/temp/files/" . $data[0] ...
php
[2]
5,680,006
5,680,007
How to avoid ANR occured in android?
<p>I am making an application in Android 1.6, there is an 'Application Not Responding' (ANR) error occuring - please suggest how to handle it in activity? </p> <p>I did only calling of web services according to condition and used a timer which runs and calls a particular webservice. One webservice fetches users who s...
android
[4]
4,810,990
4,810,991
Android:Running an application continously in background even if user closes the application
<p>I am new to android and I was trying out an app as "Scheduled messaging". Scenario: Suppose you want to send some message to your friend at 6PM. Then you can just make an entry and message will be sent automatically at that time. But now where I am stuck up is that the application must run always even if user tries ...
android
[4]
4,922,694
4,922,695
Structs data type in php?
<p>Can anyone give me example for structs data type in php ? How come there is something like structs in php all of a sudden ?</p>
php
[2]
4,905,496
4,905,497
How to get YEAR of previous month using date()
<p>I want to get the year of the previous month.</p> <p>For example in <code>July 2012</code> I want result <code>2012</code>. But in <code>January 2013</code> I want result <code>2012</code> and in <code>Feb 2013</code> I want result <code>2013</code></p> <p>I have searched and found this <a href="http://stackover...
php
[2]
3,433,029
3,433,030
Simple C++ code (what's wrong here?)
<p>Noob to C++.</p> <p>I'm trying to get user input (Last Name, First Name Middle Name), change part of it (Middle Name to Middle Initial) and then rearrange it (First Middle Initial Last).</p> <p>Where am I messing up in my code? </p> <p>--Thanks for ANY help you can offer!</p> <p>...</p> <pre><code>#include &lt...
c++
[6]
3,552,616
3,552,617
How can I lookup for the MX records corresponding to a particular domain name in iPhone application?
<p>E.g. I have a address say: mycompany.com &amp; there are MX records for this address as: server1.mycompany.com server2.mycompany.com server2.mycompany.com</p> <p>Now,there's a web serivce which is hosted on all 3 of above servers for redundancy or fallback. So,before calling the web service from my iPhone app,I wa...
iphone
[8]
541,625
541,626
How to sort list of date object?
<p>How to sort list of date object ? For example I have unsorted list of date objects. How to get max/min value from this list ?</p>
python
[7]
2,314,894
2,314,895
Console.ReadKey(false) in C# something fishy about it
<p>i am trying to make a simple application in C# in which every character I type is displayed in a console window. Here is my code : </p> <pre><code>class Program { static void Main(string[] args) { while (true) { System.ConsoleKeyInfo input; input = Console.ReadKey(false); ...
c#
[0]
1,269,926
1,269,927
How to add 2 or more views to one scrollView that relate with Page controll?
<p>I'm new to iphone development. I used <code>UIPageControl</code> and <code>UIScrollView</code> where I wanted to add 2 or more views into a single <code>UIScrollView</code>. I have 2 pages of Page controls. Please give me an example or link for implementing this.</p> <p>Thanks in advance. </p>
iphone
[8]
2,404,341
2,404,342
Notification when app not used for more than certain period
<p>Is there a way to send a notification to the user that app has been downloaded but a certain task from the app is not yet complete even after certain period - say a month. One way is a background service which should come alive every month in this case, check the app state (in sharedprefs) and then send a notificati...
android
[4]
3,084,147
3,084,148
What are the Default Access Modifiers in C#?
<p>What is the default access modifier for classes, methods, members, constructors, delegates and interfaces?</p>
c#
[0]
2,475,603
2,475,604
jquery sortable connected lists and selectable together?
<p>I have 2 lists and I am using the sortable feature - works great. But I also need to be able to select multiple items and drag those to the connected list as well. I have 100's of items in a given list and dragging 1 at a time is a bit painful.</p> <p>Has anyone achieved this?</p>
jquery
[5]
2,363,462
2,363,463
Is it Possible to create an entire application using just dynamic parts of C#?
<p>I am feeling rather impish about this, so please don't think I would seriously try this as I know from bitter experience the strengths of a static type checking system.</p> <p>But, as for a concept, would it be possible to basically do C# in a completely dynamic way, throwing the static type checker to one side and...
c#
[0]
579,142
579,143
What is cause of java.lang.ExceptionInInitializer error?
<p>What causes this type of exception?</p> <pre><code>&gt; java.lang.ExceptionInInitializerError  at &gt; java.lang.Class.newInstanceImpl(Native Method)  at &gt; java.lang.Class.newInstance(Class.java:1409)  at &gt; android.app.Instrumentation.newApplication(Instrumentation.java:957) &gt;  at &gt; android.app.Instrume...
android
[4]
5,391,697
5,391,698
Combing Two jQuery Objects To Make One Custom Context for Efficient Selectors
<p>I have some common elements that are in a #footer and #header divs respectively. In order to make the selectors faster, I'd like to make a custom jquery object.</p> <p>A combination of #footer and #header. Something like:</p> <pre><code>var someCustomContext = $("#footer") + $("#header"); var betterQuickerSelector...
jquery
[5]
3,904,890
3,904,891
C# polling to monitor folder
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/13918550/c-sharp-to-loop-through-folder-until-it-finds-the-correct-files">C# to loop through folder until it finds the correct files</a> </p> </blockquote> <p>Is it possible to use c# polling to monitor a folder...
c#
[0]
4,587,071
4,587,072
What happens during a file upload?
<p>I upload a file to my server (Server A) using a PHP script. With this same PHP script I again upload using CURL from my site to another server (Server B) using what was just uploaded like this:</p> <pre><code>$file = $_FILES['file']['tmp_name']; </code></pre> <p>My question is this: Does this script wait for the f...
php
[2]
2,127,815
2,127,816
How to change single char from string in JavaScript
<p>I have a variable which contains the following string</p> <pre><code>placeholder = "&lt;strong&gt;Total Damage:&lt;/strong&gt; $70,000.00" </code></pre> <p>Now, I am trying to replace Dollor sign($) with pound sign(£). Any idea how this can be done?</p> <p><strong>[Edit]</strong></p> <p>I don't know javascript,...
javascript
[3]
4,556,195
4,556,196
Problems with background on UITableViewCell iPhone
<p>I the following code in my class. When I launch my app on the simulator it works. However when launcing the app on an actual device(iPhone 1g, 3.1.3) it does not work. Any ideas?</p> <p>(it's for making gradient background)</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPat...
iphone
[8]
2,450,927
2,450,928
reject if file name contains non english character
<p>am trying to upload file which file name contains only in english character with symbol or number ,my problem is if my file name contains <strong>english with chinese character</strong> then i need to validate it and need to show alert message that file name should'nt be in non english character</p> <p>can anybody ...
javascript
[3]
4,917,893
4,917,894
Dashboard implementation for android app
<p>I need to create a dashboard for my android app. Is there any open-source dashboard implementation for android apps which I can use. If not then is there a or a tutorial about creating it.</p> <p>Note: I have only been able to find obsolete tutorials on the internet. </p>
android
[4]
1,332,129
1,332,130
Project conversion from ISO 8859-1 to UTF-8
<p>I coded a php project under ISO 8859-1, and for some technical reasons I want to encode the project under UTF-8. what is a better way to do it? I am afraid of loosing special characters like french accents and so on. thanks for you advice. </p>
php
[2]
5,479,870
5,479,871
how to extract web text in android like rss to display it on android GUI?
<p>how to extract some criteria from this page <a href="http://www.zigwheels.com/api/zigtvApi.php?method=data&amp;module=News&amp;section=News" rel="nofollow">http://www.zigwheels.com/api/zigtvApi.php?method=data&amp;module=News&amp;section=News</a></p> <p>and filter this ( content_id , thumbnail, summary , headline ...
android
[4]
2,500,108
2,500,109
javascript where to put the var statement
<p>I have a function that looks like this:</p> <pre><code>function SomeFunction() { var SomeVar; if (SomeCondition) { SomeVar = 4; } } </code></pre> <p>This is equivalent to:</p> <pre><code>function SomeFunction() { if (SomeCondition) { var SomeVar = 4; } } </code></pre> <p>Does using the var...
javascript
[3]
5,658,060
5,658,061
What's wrong with this code?
<p>When I write <code>cout&lt;&lt; Read("filepath")</code>I get strange set of identical characters. Code is below:</p> <pre><code>char* Read(std::string FilePath) { char* Buffer; ifstream F_S(FilePath); while (! F_S.eof()) { F_S.getline(Buffer,100); return Buffer; } } </code>...
c++
[6]
480,845
480,846
process argument with spaces
<p>hi i need to have argument that contain spaces.</p> <p>in this case <code>/SASE Lab Tools</code> is the subject. Under normal command line:</p> <p><code>sslist -R -H -h sinsscm01.ds.net "/SASE Lab Tools"</code></p> <p>how do i make that happen? Here is my code:</p> <pre><code>static void Main(string[] args) ...
c#
[0]
5,352,399
5,352,400
running background thread in android throughout the application
<p>hi i am new to android. can anybody help me to solve this. i want to run a background thread which will request to the server response in some time gaps. this threads have to be run in background through out the application. if any one know how do this in android please let me know.i hope you understood my problem...
android
[4]
4,286,885
4,286,886
C# -Priority based delegates and chaining in delegates possible? or Windows Work Flow?
<p>Whenever i feel hungry i will publish i am hungry.This will be notified to the service providers say (<b>MealsService,FruitService,JuiceService </b>).(These service providers know what to serve).</p> <p>But the serving priority is the concern. Priority here means my first choice is <b> MealsService </b> when ther...
c#
[0]
1,208,475
1,208,476
Will ajax work in dot.net framework 2.0?
<p>I have vs2005.Now I installed 2008 also in my machine(both are there).Previouly when I was opening my vs 2005 solution file,there was no ajax control. Now it shows me ajax control in it.(but solution file show vs2005).Will it cause any error in future?</p>
asp.net
[9]
5,722,005
5,722,006
Global keylogger in Java
<p>I'm writing an application that monitors the person’s mouse and keyboard. If they have not used the keyboard or mouse for 1 minute, it will pop up a message that says “You have not used the mouse or keyboard for 1 minute” along with an OK button.</p> <p>How do I do this in Java?</p>
java
[1]
777,363
777,364
How do I hide a adjacent div when I mouseout of a menu item, using JQuery?
<p>I was wondering how I could reverse the click triggered in this function on 'mouseout' of 'a.menu-arrow'? See code below:</p> <pre><code>$(".menu-arrow").hover(function() { $.data(this, "timer", setTimeout($.proxy(function() { $(this).click(); }, this), 500)); }, function() { clearTimeout($.data(this, "ti...
jquery
[5]
4,014,445
4,014,446
How to check whether an enum variable is assigned with a single enum value?
<p>I would like to restrict the user to use any of the enumvalue.if the user tries to assign more than two values,i have to throw an error.</p> <pre><code>public enum Fruits { Apple, Orange, Grapes } Publiv Fruits Fruits { get { return m_fruits; } set { m_fruits=value; } Fruits=Fruits.Apple&amp;Fruits.Grapes;//I nee...
c#
[0]
3,580,126
3,580,127
How do I get the value after decimal?
<p>Example -> 4.11 I need to get 11 which is the value after decimal</p> <p>How do i get that in C#?</p>
c#
[0]
1,868,428
1,868,429
std streams to write to void* and back
<p>How can I get fstream to write to a void pointer?</p> <p>Basically I've used MapFileView and got a void pointer from it for shared memory.</p> <p>I've use copymemory to copy a bunch of data back and forth between two separate applications.</p> <p>Now instead, I want to use the std library to read in a struct via ...
c++
[6]
5,381,447
5,381,448
Content Assist not working as expected on Eclipse
<p>These are the specs:</p> <ul> <li>OS: Windows 7 Professional x86</li> <li>IDE: Eclipse Juno 4.2 (for Java Developers)</li> <li>ADT: Version 20</li> <li>SDK: 7</li> </ul> <p>I'm creating an XML layout, and after dragging a ImageView to a FrameLayout, it all works as expected.</p> <pre><code>&lt;FrameLayout xmlns:a...
android
[4]
2,240,099
2,240,100
jquery: inner: outerHeight
<p>That I got no idea how. I need a function that the window height or the monitor configuration is larger than 1200, put a div position top = 1000px and else put in another position top = 800px</p>
jquery
[5]
16,134
16,135
C#:SerialPort: read and write buffer size
<p>I am writing a program to send and receive data via a serial port with C#.</p> <p>Although I have read this reference: <a href="http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.readbuffersize.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.readbuffersize.asp...
c#
[0]
204,007
204,008
How can I 'shine' a png on the iPhone in the same way that the app launcher does?
<p>I want to show users what their square flat .png image will look like when converted to a normal 'shined' icon by the app launcher.</p> <p>e.g. round corners and glassy effect.</p> <p>Thanks</p>
iphone
[8]
262,465
262,466
jQuery Basic Plugin - Loading from another page
<p>I am very inexperienced with jQuery plugins, and only mildly experienced in jQuery itself.</p> <p>I am trying to create a jQuery plugin that allows me to fill a <code>div</code> with content from another page with GET variables in the URL depending on the parameters that are passed to it.</p> <p>Eg <code>$('#mydiv...
jquery
[5]
4,653,077
4,653,078
Suggestion for API design about stream
<p>Need to design an API method whihc take OutputStream as a parameter. </p> <p>Is it a good practice to close the stream inside the API method or let the caller close it?</p> <pre><code>test(OutputStream os) { os.close() //??? } </code></pre>
java
[1]
2,874,335
2,874,336
Converting double[][] in to float[][]
<p>I was wondering if there is a way of converting a double [][] in to a float[][] in Java? I currently have a for loop in my code that does this and am looking for a better and cleaner way.</p> <p>Any ideas would be appreciated, Thanks,</p>
java
[1]
2,612,698
2,612,699
how can i send sms programmatically in iphone
<p>I need to send sms programmatically.</p> <p>I found sending programmatically email in google,But did n't found clear info regarding sending sms programmatically.</p> <p>Can any one pls post some sample code.</p> <p>Thank u in advance.</p>
iphone
[8]
1,323,014
1,323,015
How to put '<' and '>' inside a linkbutton's text property (asp.net)?
<p>How to put '&lt;' and '>' inside a linkbutton's text property (asp.net)? I tried <code>&lt;asp:LinkButton runat="server" ID="lbEdit" Text="&amp;lt;edit settings&amp;gt;"&gt;&lt;/asp:LinkButton&gt;</code> but then the link doesn't show up.</p>
asp.net
[9]
1,986,647
1,986,648
c# FindSumSubset(decimal, ArrayList<decimal>)' has some invalid arguments
<pre><code>ArrayList&lt;decimal&gt; FindSumSubset(decimal sum, ArrayList&lt;decimal&gt; list) { for (int i = 0; i &lt; list.Length; i++) { decimal value = list[i]; if (sum - value == 0.0m) { return new ArrayList().Add(value); ...
c#
[0]
3,400,616
3,400,617
Jquery and CSS style
<p>If I want to add an CSS style for a field in a table that has the value that is equal to the current time or greater than the current time but it is less than the value of the next field, how can I do this using Jquery?</p> <p>The sample of table looks like this:</p> <pre><code> ----------------------- field | ...
jquery
[5]
3,902,767
3,902,768
Permutation Id..? C++
<p>I am using permutation to generate a string (using each of its character) into "helloworld!", however it took...176791 to get to "helloworld!" Is there a ways so I can just input: 176791 to quickly permutate to "helloworld!"?</p> <pre><code> ... 176790. helloworl!d 176791. helloworld! </code></pre> <p>My co...
c++
[6]
2,470,194
2,470,195
checking of constructor parameter
<pre><code>class item { int i; public: item(int no) { } }; </code></pre> <p>I want to check the constructor parameter. If it is found to hold a negative value, then object creation should be stopped.</p> <p>Exceptions can not be used here as the targeted system does not support exceptions.</p>
c++
[6]
3,038,855
3,038,856
Looking for a simpler way to check if multiple properties & methods in an object are undefined
<p>Consider the following code:</p> <pre><code> if(eform[funcName] !== undefined){ if(eform[funcName].init !== undefined){ //finally do something } } </code></pre> <p>I'm first checking to see if the <code>eform</code> object has the property specified by the variable <code>funcName...
javascript
[3]
377,154
377,155
TypeError: 'float' object has no attribute '__getitem__'
<p>This code is a beginning attempt at reading a csv file into a couple of lists. I'm getting the error below, and I can't see why the float isn't being returned. Thanks for your help!</p> <pre><code> File "main.py", line 32, in &lt;module&gt; LR.openfile('djia_temp.csv') File "main.py", line 9, in openfile ...
python
[7]
857,721
857,722
Create a flattened representation of an class based on its MRO
<p>How would I create a flattened representation of a class that is composed of multiple base classes/mixins. Is there a library for doing such a thing? For example:</p> <pre class="lang-py prettyprint-override"><code>class Foo(object): def a(self): return class Bar(object): def b(self): ret...
python
[7]
2,537,044
2,537,045
How to limit the number of entries in a java List?
<p>I know how to limit size in Map (<a href="http://stackoverflow.com/questions/422181/how-do-i-limit-the-number-of-entries-in-a-java-hashtable">like this</a>,using LinkedHashMap.removeEldestEntry method does exactly that)</p> <p>I want to know how to limit size in a List,what is a best way to implement?</p> <p>thank...
java
[1]
2,823,707
2,823,708
javascript: lightweight lightbox script
<p>i'm looking for a lightweight javascript for displaying images the way lightbox does. it should be small + simple, no jquery/mootools plugin, no animations.</p> <p>i just should be able to display an image when clicking on its thumbnail.</p> <p>thanks</p>
javascript
[3]
2,633,941
2,633,942
Onselectedindexchanged is firing
<p>In grid row command event I am calling a <code>.ascx</code> page as a popup.</p> <p>In the popup I have one button, on clicking the button, I'm calling one more popup.</p> <p>Under the second popup I have four dropdown controls, in the dropdown controls I'm filtering and filling the data one after another.</p> <p...
asp.net
[9]
5,381,452
5,381,453
How to catch touch event of an dialog when it is clicked outside
<p>Actually i have <code>Dialog</code> in my activity, what i want is suppose the dialog is open, then on Touch of outside dialog i want to dismiss the dialog and at the same time i want to call a function which do some update in my activity.</p> <p>Initially i used <code>MyDialog.setCanceledOnTouchOutside(true);</cod...
android
[4]
112,621
112,622
What is ecmascript?
<p>In Visual Studio when I am setting my script type to JavaScript this comes up as an option in intellisense.</p> <p>A quick Google search came up with lame results, leading me to believe this isn't terribly popular to use.</p> <ul> <li>What is it? </li> <li>Does anyone use it? <code>(&lt;script type="text/ecmascrip...
javascript
[3]
3,981,922
3,981,923
Sharing Android code (Is there really no way to do this?)
<p>I have a particular collection of code along with some XML files that I need to share with every application I will make. </p> <p>At the moment I can't because as far as I am aware there is no way to do this. This seems like a massive oversight by the development team.</p> <p>If the code needs changing, I have to...
android
[4]
2,447,098
2,447,099
Mapping Settings pages to Keys
<pre><code>startActivity(new Intent(Settings.ACTION_SETTINGS)); </code></pre> <p>Above code is used to call a setting through Intent</p> <p>i need to map that intent in Combination of key..</p> <p>for example </p> <p>i need to call settings intent by pressing a+s+d</p>
android
[4]
2,222,435
2,222,436
Android Location Listener (or Android Events in general)
<p>I have a general question about LocationListener in Android. Perhaps this is about Android or Java events in general, but not sure. </p> <p>There seems to be a million ways to set up a LocationListener, and they all seem pretty ugly (mainly because of lack of reusability). Here is an example from android found <a h...
android
[4]
3,352,166
3,352,167
change value when python is in infinite loop
<p>Can this be done in python? Start by print an infinite loop and changing values in between loops.</p> <pre><code>x = 5 while ( true ): print x x = 3 # regain control of the interpreter and set to new value </code></pre> <p>expected output:</p> <pre><code>5 5 5 ...... 3 3 3 </code></pre>
python
[7]
2,926,194
2,926,195
Can not increment global variable from function in python
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/423379/using-global-variables-in-a-function-other-than-the-one-that-created-them">Using global variables in a function other than the one that created them</a> </p> </blockquote> <p>Hello Guys! I have the follow...
python
[7]
369,104
369,105
SHMultiFileProperties with c++
<p>Seen an example of using SHMultiFileProperties on the site with c# but I'm really having trouble using it with unmanaged c++. I am a beginner so i would appreciate any help or maybe a small example.</p>
c++
[6]
3,544,584
3,544,585
jQuery watch div
<p>Is there any way to watch, if the content within a div changes?</p> <p>Let's say I have:</p> <pre><code>&lt;div id="hello"&gt;&lt;p&gt;Some content here&lt;/p&gt;&lt;/div&gt; </code></pre> <p>Which at some point 5 seconds later changes to:</p> <pre><code>&lt;div id="hello"&gt;&lt;ul&gt;&lt;li&gt;This is totally ...
jquery
[5]
3,772,714
3,772,715
How detect and handle if object is used as l-value or as r-value?
<p>I have a container class called <code>Properties</code>. I want to add to it <code>operator[](const std::string &amp; name)</code> which will return property with specified name.</p> <p>Now lets consider that there is no property with specified name. In this case I wan't to add new <code>Property</code> with specif...
c++
[6]
2,564,011
2,564,012
Button disappears when ListView size is increased
<p>I am trying to create an activity with a ListView on top and a Button underneath it. But when the size of the ListView is increased the Button disappears and moves down. Any suggestions? I am using TableLayout with each row containing ListView and Button. -Thanks</p>
android
[4]
2,047,431
2,047,432
DateTime How To
<p>When creating a class what is the syntax to define a public property for that class as a DateTime type rather than string?</p>
c#
[0]
402,484
402,485
Using POST for all functions in REST protocol
<p>Is it wrong to use POST for everything in REST? I know POST is for updating and creating but what if I use it for SELECTS and DELETS as well? What I basically need is a web service that can do CRUD operations to a database. Im using PHP. Also, what if I use query strings to do the POST request instead of using JSON ...
php
[2]
1,073,966
1,073,967
How to take a screenshot from the camera view?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8996611/ios-capture-screenshot-of-camera-controller">iOS Capture &ldquo;screenshot&rdquo; of camera controller</a> </p> </blockquote> <p>I'm trying to take a screenshot when the camera of the iphone is running, ...
iphone
[8]
1,089,930
1,089,931
PHP - Checking for return false;
<p>Just a quick question - and I'm sure really basic!</p> <p>I have the following code:</p> <pre><code>function checkThings($foo, $bar) { ... if ($valid) { return $results; } else { return false; } } </code></pre> <p>On the other end of this I am currently doing</p> <pre><code>$check...
php
[2]
3,175,027
3,175,028
Dynamic instance creation without generics
<p>I would like to understand why the following doesn't work:</p> <pre><code>public class HelloClass { private class MyClass { public MyClass() { System.out.println ("Oh heck this is me!"); } } public Object newInstance (Object o) { try { ...
java
[1]
3,671,705
3,671,706
what is the 'decimal.getcontext().copy()' mean
<pre><code>import decimal # Decimals a=decimal.getcontext().copy() print a </code></pre> <p>thanks.</p> <p>what is the useful of a.</p>
python
[7]
1,586,386
1,586,387
What's the Meaning and use of window.lol&&lol() in the google homepage?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2894550/blank-space-on-google-home-page">blank space on google home page</a> </p> </blockquote> <p>What's the Meaning and use of window.lol&amp;&amp;lol() in the google homepage? AND Where is the source code of ...
javascript
[3]
5,032,827
5,032,828
Android Emulator's launch options don't work in Eclipse plugin?
<p>I need to change the emulator's default time zone. It worked in command line with -timezone option. But when I tried it in eclipse android's launch options. it didn't work. I set it in Window->preferences->android->launch->default emulator options. Am I setting it in a wrong place?</p>
android
[4]
4,305,486
4,305,487
java : Unparseable date Exception
<p>I have this value,</p> <blockquote> <p>2011-11-19T00:00:00.000-03:00</p> </blockquote> <p>which needs to be converted and set it in this format </p> <blockquote> <p>yyyyMMdd</p> </blockquote> <p>I tried this way </p> <pre><code>import java.text.DateFormat; import java.text.ParseException; import java.text.S...
java
[1]
4,477,810
4,477,811
Android - how to reset a TextView
<p>I set an original TextView value like this:</p> <pre><code>TextView problemName = (TextView) findViewById(R.id.some_variable); </code></pre> <p>But at some point I need to reset it to something new. I don't see a function like setText() or anything like that. How is the displayed text supposed to be reset?</p>...
android
[4]
5,737,945
5,737,946
jquery to disable form elements
<p>Scenario is that I have written a function for auto refresh on form element and I want onclick event on login button to disable the auto refresh function. </p> <p>I'm not able to get disable the autorefresh and the page still refreshes. </p> <p>My code is:</p> <pre><code>$('#form').ready(function () { //Increment...
jquery
[5]
4,353,890
4,353,891
JQuery - Sliding
<p>I saw <a href="http://www.mindthree.com/" rel="nofollow">this website</a> in this when we click the next or previous buttons it slides different webpages. I want the same effect but I could not find the way to do it. Can you post the answer with HTML, CSS and JQuery or Javascript code.</p>
jquery
[5]