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,998,886
5,998,887
Difference between __get__ and __getattr__ in Python
<p>I've been trying to figure this out for a while. I see plenty of questions like <a href="http://stackoverflow.com/questions/3278077/difference-between-getattr-vs-getattribute-in-python">this one</a>, asking about the difference between <code>__getattr__</code> and <code>__getattribute__</code>.</p> <p>However, my ...
python
[7]
708,636
708,637
Strange behaviour of MotionEvent getHistorySize() method
<p>There is a strange behaviour of MotionEvent <code>getHistorySize()</code> method on some devices. For example:</p> <pre><code>@Override public boolean onTouchEvent(MotionEvent ev){ if(ev.getAction() == MotionEvent.ACTION_DOWN) return true; if(ev.getAction() == MotionEvent.ACTION_MODE){ int...
android
[4]
5,911,501
5,911,502
OAuth2 coonection to a server - android
<p>I'm developing an app in which when the user enters the email id and submit, I want to connect to the server using oAuth2 and store the mail id in the list. I have the url, access_token, client id, client secret and post header and body. But I'm not sure how to implement it. Any help is highly appreciated</p>
android
[4]
5,898,412
5,898,413
How to detect if document.write() has taken place in JavaScript?
<p>I want to do something when 2 document.write() statements have successfully occured. I tried the following but it didn't work:</p> <pre><code> function loadFields() { var load1 = document.write("&lt;input type='text' name='StoreLocation' value='"+storeLocation+"' /&gt;"); var load2 = ...
javascript
[3]
4,716,377
4,716,378
Array dereferencing doesn't work
<p>I have uploaded my project to a free web server and I see this error:</p> <pre><code>Parse error: syntax error, unexpected '[' in /home/a9243209/public_html/index.php on line 28` </code></pre> <p>Line 28:</p> <pre><code>$year = getdate(strtotime($currentDate))['year']; </code></pre> <p><strong>Note</strong></p>...
php
[2]
3,986,969
3,986,970
ASP.NET: I'm new to n-tier architecture. Can someone give me a high level overview?
<p>can you please describe what an n-tier architecture is. what is a data access layer? what type of code would typically go into this data access layer class? i have basically the same question for the business access layer. what type of code typically goes there? finally, can you also explain, in high level, how thes...
asp.net
[9]
2,798,335
2,798,336
How to continue video play while orientation change in android
<p>I used videoview for playing a video in android default player. When I change its orientation, it starts playing from beginning. </p> <p>How could I make it to continue from that point, where orientation changed ?</p>
android
[4]
1,833,934
1,833,935
Create a function inside a function into a class?
<p>I'm trying to create some classes and i would like to use this syntax:</p> <pre><code>$my = new My(); $my-&gt;field()-&gt;test('test'); </code></pre> <p>I know how to do a <code>$my-&gt;test('test')</code>, it's easy - but I don't know how to add a <code>field()</code> attribute to make an easier comprehension of ...
php
[2]
3,407,686
3,407,687
Call a non-static class function from a static function
<p>We have a static class function in our code that houses a fair amount of code. Where this code was originally used, and still is used, no instance of the class can be created hence why it is static. The functionality of this function is now needed elsewhere in our codebase, where an instance of the class is already ...
c++
[6]
3,043,087
3,043,088
Function getting called on the load of page
<pre><code>for (var key in obj[i]) { dataDump[key] = textField.value; var callback = function(zeKey){ return function(e){ dataDump[zeKey] = e.source.value; }; }(key); textField.addEventListener('change', callback); } </code></pre> <p>When I load the window, this function gets c...
javascript
[3]
683,576
683,577
c# parameters question
<p>I am new to c# and need help understanding what going on in the following function</p> <pre><code> public bool parse(String s) { table.Clear(); return parse(s, table, null); } </code></pre> <p>where table is a Dictionary. I can see that is is recursive but how is parse being passed three...
c#
[0]
3,240,018
3,240,019
C# Checking if remote desktop is enabled on a windows client
<p>Is there any way I can detect if remote desktop is enabled on windows xp/vista/7. I know that you can access the session information using performance counters but what I really need is a enabled/disabled flag?</p> <pre><code>PerformanceCounter performanceCounter = new PerformanceCounter("Terminal Services", "Activ...
c#
[0]
743,705
743,706
Opening the numpad of the device
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8476490/open-a-numeric-keyboard-without-forcing-the-edittext-to-be-numeric-only">Open a numeric keyboard without forcing the EditText to be numeric only</a> </p> </blockquote> <p>In my app i have an EditText fie...
android
[4]
5,239,401
5,239,402
jquery div on top of another div
<p>I have a web page that contains a div element called #order_details that is hidden. When a user clicks on a button, then the #order_details div element appears. It appears that the div element has a z-index of 6500 which I have verified is the highest z-index in the entire site. It is also using jQuery because I ...
jquery
[5]
2,625,744
2,625,745
Javascript. Calculating a percentage results in 1% difference
<p>I'm having an issue with some javascript where I am calculating a percentage. It always comes in 1% off:</p> <pre><code>pcOff = parseInt((1-(PriceFrom/PriceFromRRP))*100); </code></pre> <p>PriceFrom and PriceFromRRP are captured from a JSON return and in the case of <code>PriceFrom = '40.00'</code> and <code>Price...
javascript
[3]
882,279
882,280
How Do I acces a class from my Main Form?
<p>Hi Im new to C# infact somedays past only.I got a project from universty so I though os using c#.</p> <p>What Im doing in this case is <strong>reading text messages from a cell phone and then putting them in a text file.</strong> I learnt that I have to make a class for writing a File so I did and added that Class ...
c#
[0]
4,574,321
4,574,322
Inconsistent arguments in ArrayList methods
<p>In ArrayList API <strong>add()</strong> takes an argument of generic parameter type, but <strong>contains()</strong> and <strong>indexOf()</strong> take arguments of type <strong>Object</strong>.</p> <pre><code>public class ArrayList&lt;E&gt; ...{ public boolean add(E e); public boolean contains(Object ...
java
[1]
4,318,438
4,318,439
Image showing on emulator but not on Android tablet
<p>I am developing an Android app which gets an image encoded in base 64 from a web service, and shows it in an ImageView. </p> <p>My problem is that the image is showing correctly on the emulator, but when running on the tablet (tablet ASUS Transformer with Android 4) the ImageView seems to disappear when loading it ...
android
[4]
1,445,585
1,445,586
how to get a reference to the defining 'class' inside an inner method in JavaScript?
<p>I have the following JS code:</p> <pre><code>var Item = function () { this.property = ''; this.myfunction = function () { var value = this.property; }; }; </code></pre> <p>however, <code>this</code> does not point to the defining class so value doesn't get anything.</p> <p>how do I access...
javascript
[3]
1,205,504
1,205,505
Give me an example for this type of method?
<p>Please show me a simple code with class name as return type in a method? Some of the codings in project as classname as return type for methods? I don't understand What that mean?</p> <p>Can anyone give me a breif explanation and simple example regarding that one?</p> <p>For example</p> <pre><code>public Dataset ...
c#
[0]
3,258,433
3,258,434
Is there a way to check an object reference to see if it is not set to an instance of an object?
<p>The compiler is always complaining about: "Object reference not set to an instance of an object." So hopefully there is an easy way to check whether this is the case before I try doing something that would cause it... thanks.</p>
c#
[0]
3,422,880
3,422,881
How to add a page adaptor to an ASP.NET project?
<p>I want to try the method of saving the viewstate to the DB as mentioned <a href="http://forums.asp.net/t/1293397.aspx/1?Store%20ViewState%20in%20the%20Database%20instead%20of%20Hidden%20Form%20Field/" rel="nofollow" title="here">here</a> but am confused by the PageAdaptor part. It says I should use app.browser to di...
asp.net
[9]
3,461,590
3,461,591
Android: incomplete soap response?
<p>I make a soap request in my Android app using <code>HttpURLConnection</code> the response is a base64 encoded string holding the data of an image.</p> <p>the problem is that the response always received in complete. so the image can not be constructed correctly.</p> <p>what can be the reason for this ?</p> <p>tha...
android
[4]
4,086,566
4,086,567
run animation then change page - jquery
<p>I am trying to build a script that will prevent a link from changing pages immediately and running an animation first. This is what I have so far:</p> <pre><code>$('a').click(function(event){ event.preventDefault(); $('#nav-bar').animate({ left:'-260' }, 1500, function(){ //want to use callback...
jquery
[5]
461,356
461,357
how to retain the selcted values in the form even after page refreshing
<p>actually i'm new to php &amp; i'm developing a project SIMILAR TO ONLINE EXAMINTAION. so i'm display questionS RANDOMLY FROM D.B what the thing is. i'm displaying 5 questions ALONG WITH THEIR OPTIONS in a single form. and i selected a radio button from a form &amp; done page refreshing.the selected radio button ca...
php
[2]
5,130,912
5,130,913
How to set horizontal scroll menu bar
<p>friend's, I have task to set menus in horizontal scrolling with images at two ends to show availability of menus. I did it by using gallery view, but i need to place an seperator (Vertical Line) between menus,i can't able to get the seperator in between the gallery. How can i get it.</p> <p>i need the view below ...
android
[4]
2,995,540
2,995,541
NullPointerException in class
<p>I have a class that contains 2 functions:</p> <pre><code>public class FileHandler extends Activity { public void writeToFile(){ String fileName = "lastDevice.txt"; try { FileOutputStream fos = openFileOutput(fileName, MODE_PRIVATE); //Exception thrown here fos.write("some device id".getB...
android
[4]
5,376,665
5,376,666
C# encryption key discussion
<p>I am writing a .net application and want to use a supper strong encryption key by using the unicode characters to make it hard for the hackers to hack the code. The encryption key would be any characters from the <a href="http://www.unicode.org" rel="nofollow">http://www.unicode.org</a>. For example my encryption k...
c#
[0]
2,555,683
2,555,684
How to get Screen metrics outside an Activity?
<p>I have a Generic Pool that i am making here:</p> <pre><code>public class FruitPool extends GenericPool&lt;Sprite&gt; { // =========================================================== // Constants // =========================================================== // ============================================...
android
[4]
4,518,605
4,518,606
Star TSP100 is not able to print physically using microsoft point of service
<p>Hi I am stuck with previous 2-3 days for the printing functionality with the Star TSP100 printer. I am developing an application in Visual studio 2010. I have installed driver of the printer. also installed the "POS for .Net v1.12.exe" and connected the printer to the com port. I have written the code for implementi...
c#
[0]
3,000,352
3,000,353
Weird jQuery show() issue - What am I not seeing?
<p>I have a DIV that contains an image with a hotspot. It is set to hidden by default.</p> <p>I have a function I call to show it. </p> <p>In the function, this works:</p> <pre><code>$('#adChart').css("visibility", "visible"); </code></pre> <p>But this does NOT work:</p> <pre><code>$('#adChart').show(); </code></p...
jquery
[5]
1,431,824
1,431,825
Why are argument modifiers (i.e., 'const' or 'volatile') not considered part of a function's type or signature?
<p>Note that the following two functions have the same type and signature:</p> <pre><code>void foo1(int t) {} // foo1 has type 'void(*)(int)', and signature '(*)(int)' void foo2(const int t) {} // Also type 'void(*)(int)', signature '(*)(int)' </code></pre> <p>(the <code>const</code> is not part of the function type ...
c++
[6]
960,269
960,270
Instantiate variables in class instead of onCreate() wrong?
<p>Is something wrong with this construct in Android?</p> <pre><code>class A extends Activity { private Object myObject = new Object(); @Override protected void onCreate(Bundle savedInstanceState) { //myObject = new Object(); } </code></pre> <p>}</p> <p>Because at some point(s) later I get (sometimes, not repr...
android
[4]
2,578,382
2,578,383
MediaStore.EXTRA_OUTPUT How to save image with low Pixe
<pre><code> Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE ); intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri ); </code></pre> <p>When i use this code, the camera is default to 5M Pixe, but now i want to use the lowest Pixe to save image 1.2M Pixe.<br/></p> <p>how can i do ...
android
[4]
5,450,349
5,450,350
Do in_array have a like function?
<p>I have an array of people that is registered as online in a html file. I am using this so that each can have an image assigned to them. But when checking to see if using name is already in use the in_array function return false and allow the script to continue. </p> <pre><code>$user = "&lt; img src='default.jpg' /&...
php
[2]
5,040,029
5,040,030
News Aggregators
<p>I need to create a news aggregator for our application, something similar to reading AP News from Yahoo, or something like <a href="http://popurls.com/" rel="nofollow">http://popurls.com/</a>; the problem is that I don't know how it works. <br /> So, a couple of questions: <br /> 1) How do I determine what news site...
php
[2]
3,369,505
3,369,506
Trying to make a thai translator in Python, but am unable to write using Thai characters
<p>I am trying to make a thai translator, but am unable to write using Thai characters. I saw somewhere to do this to check what the default encoding is:</p> <pre><code>import sys; print(sys.getdefaultencoding()) </code></pre> <p>I get utf-8 </p> <p>My problem is that I just get ?? when I use Thai characters. Is th...
python
[7]
718,548
718,549
What does Object.create( Class.prototype ) do in this code?
<p>I'm reading about the <a href="http://addyosmani.com/resources/essentialjsdesignpatterns/book/#mixinpatternjavascript" rel="nofollow">mixin pattern in javascript</a> and I encountered this piece of code that I don't understand:</p> <pre><code>SuperHero.prototype = Object.create( Person.prototype ); </code></pre> <...
javascript
[3]
3,458,151
3,458,152
First 6 ListView elements are continuously being invoked with getView()
<p>When I check my logs, when using ListView, I see, that getView() method of a custom adapter is continuously invoked on first 6 elements, even if I scroll to the very end of the list. Has anyone seen behaviour like this?</p>
android
[4]
4,257,742
4,257,743
How to assign value in the callback function?
<p>I am having issues with a <code>callback</code> function</p> <pre><code>project.prototype.getFolder = function(path){ this.imagePath; var instance = this; function getImage(image, callback) { var it = function(i){ codes..... //I am sure variable image is not null ...
javascript
[3]
4,231,103
4,231,104
Weird arithmetical behavior in JavaScript
<p>I'm trying to code my own slide show in JavaScript. What I already have is a skeleton which works in Opera, Safari and Chrome:</p> <pre><code>var slideShow = (function() { var latestGames = document.getElementById('latestGames').getElementsByTagName('li'); var displayedGame = 0; return { init: f...
javascript
[3]
5,411,731
5,411,732
My ASP.NET site doesn't find files located in different folders
<p>My website has many pages which operate on some data in a database. Since many procedures are the same, I have put all of these "general" functions inside a (public partial) static class and saved it in the App_Code folder as suggested by Visual Studio:</p> <pre><code>Root | +-- App_Code | | | +-- ...
asp.net
[9]
926,274
926,275
Static dataset in ASP.NET
<p>Will declaring a dataset as STATIC in ASP.net website help in persisting data across post backs?</p> <p>I was looking at an application and somehow a static dataset was able to persist the data even if we closed the application and opened it again.</p>
asp.net
[9]
3,929,303
3,929,304
Uses of .sub() in real life
<p>I stumbled upon the <code>.sub</code> function from browsing the jQuery source. There is a <a href="http://api.jquery.com/jQuery.sub/" rel="nofollow">documentation page</a> but it doesn't show any convincing 'real-life' applications.</p> <p>Do people actually use <code>.sub()</code>? If so, for what?</p>
jquery
[5]
5,757,048
5,757,049
ASP.net: What type of application/website is more suitable to Webform or MVC?
<p>I have read all the post regarding the pro and con of ASP.net webform vs mvc.</p> <p>However, I'm wondering under what circumstance does one use webform or mvc? would it come down to what you or your team is more familiar with?</p>
asp.net
[9]
5,833,057
5,833,058
Can we update an existing plist file of an iphone app?
<p>Can we update the content of an existing plist file of an iphone app such that the older plist file is replaced by the updated one in the app?</p>
iphone
[8]
3,147,617
3,147,618
getApplicaiton return which object among applicaitons
<p>in android there is a base class Application for global application state keeper.</p> <p>i create two or more call extending from Application</p> <p>by getApplicaiton() which object i will get from this method ?</p>
android
[4]
3,755,563
3,755,564
Where the microsoft.office.tools.excel.dll is installed?
<p>I have installed VS2010 SP1 with .NET 4.0 and cannot find where the microsoft.office.tools.excel.dll is located.</p> <p>Question> Where I can find this DLL?</p>
c#
[0]
2,593,296
2,593,297
'undefined' is not a function (evaluating '$(this).calcSubWidth()')
<p>Having an issue with an error related to the navigation menu. When hovering over, a javascript error appears: 'undefined' is not a function (evaluating '$(this).calcSubWidth()'). It is in menu.js. However, even with the erro, the menu works fine.</p> <p>Website: <a href="http://csenew.drdino.coresense.com" rel="nof...
jquery
[5]
166,816
166,817
Fastest method to detect if there is a tag with attribute [itemtype='http://schema.org/Offer']
<p>I am looking to detect with Javascript the fastest possible way, if there is a HTML tag with attribute <code>[itemtype='http://schema.org/Offer']</code> in the current page.</p>
javascript
[3]
3,479,535
3,479,536
jquery: disable submit button in a form and enable it onChange of any element on the form
<p>I need to disable the disable the submit button on my form and to enable if the onchange event occurs for any other input on the form <br/> so basically I need to:</p> <ul> <li>disable the submit button</li> <li>add a method that enbales the submit button to the onchange event for all the other inputs on the form</...
jquery
[5]
3,763,390
3,763,391
How can running CMD from c# with a hidden CMD
<p>How can running CMD from c# without to see the cmd windows? </p>
c#
[0]
1,266,011
1,266,012
need help in Java passing objects
<p>UPDATE: i modified the hashCode, now is a little better. :) but the problem is still there... :(</p> <p>so, and modified my method too:</p> <pre><code>private Node getMinNode() { int min = 9999999; //value Node minNode = new Node(); //key,index for (Node key : this.distances.keySet()) { in...
java
[1]
1,299,626
1,299,627
I am not able to add multiple div controls to a parent div control
<pre><code>protected void lbChatFriend_Click(object sender, EventArgs e) { ChatDivContent.Visible = true; System.Web.UI.HtmlControls.HtmlGenericControl createDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV"); createDiv.ID = "div"; createDiv.Style.Add(...
asp.net
[9]
2,812,248
2,812,249
unexpected javascript date behavior
<p>I have the following code:</p> <pre><code>var newDate=new Date('05/22/2012'); var month=newDate.getMonth(); var day=newDate.getDate()+(-2); var year=newDate.getYear(); document.write(month+'/'+day+'/'+year); </code></pre> <p>I expected it to return '05/20/2012' but instead it returns '04/20/2012'</p> <p>This make...
javascript
[3]
5,715,001
5,715,002
C++ Vector of vectors is messing with me
<p>If I put this code in a .cpp file and run it, it runs just fine:</p> <pre><code>#include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;string&gt; using namespace std; typedef vector&lt;int&gt; row; typedef vector&lt;row&gt; myMatrix; void main() { //cout &lt;&lt; endl &lt;&lt; "test" &lt;&lt; endl; ...
c++
[6]
3,125,739
3,125,740
Moving widgets in runtime on Android
<p><br> I have a simple demo with two buttons. They are laid out with a RelativeLayout at the top and bottom of the screen.<br> When I click one of them, I want them to switch places. What is the best way to do that?</p> <p>This is my res/layout/main.xml :</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &...
android
[4]
348,329
348,330
Persist a Python class instance across command-line calls (without shelve)?
<p>I have an existing Python class that is used for data capture. It has start() and stop() methods to start and stop the data capture. Right now this class is used in a single Python script, e.g.:</p> <pre><code>dataGrabber = DataGrabber() dataGrabber.start() # do a bunch of stuff... dataGrabber.stop() </code></pre> ...
python
[7]
1,301,797
1,301,798
play back song in iPhoneapp
<p>I want to play a song global in iPhone. If I quit the sound application and I dont pause the song then that song play globle in iphone.</p>
iphone
[8]
1,395,298
1,395,299
Emulator stops working in android
<pre><code>Error: </code></pre> <p>ActivityManager:Starting:Intent{act=android.intent.category.LAUNCHER}cmp=com.personal/.PersonalActivity}</p> <p>Activity not started ,its current task has been brought to front</p>
android
[4]
2,190,980
2,190,981
How to remove icon programatically (Android)
<p>By remove the below intent-filter in AndroidManifest.xml, it can remove the icon after install.</p> <pre><code>&lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; </code></pre> <p>But i have t...
android
[4]
4,292,757
4,292,758
MVC Razor: How to mix html helpers and text in same line?
<p>I would like to use multiple html helpers in the same line, but I'm not succeding.</p> <p>The result I search is: <code>Name:&lt;textbox&gt;</code> (note the ":")</p> <pre><code>@Html.LabelFor(x=&gt;x.Name) ":" @Html.EditorFor(x =&gt; x.Name) //doesn't work </code></pre> <p>How can I achive this?</p>
asp.net
[9]
3,498,541
3,498,542
How can I append a .png image into a html file using java?
<p>I generate a html file using log4j WriterAppender file. I also takesnapshots of my screen using webdriver. Now I wish to append them together.</p> <p>Any idea how to do that?</p> <p>Thanks!</p> <p>Apologies for not being clear and daft. My situation is that I have got a html file which is generated dynamically by...
java
[1]
5,285,583
5,285,584
Reverse filter in jQuery
<p>Instead of this...</p> <pre><code>$("#gridContainerAvailable input:checkbox") </code></pre> <p>How do I do this...</p> <pre><code>var parent = $("#gridContainerAvailable"); parent.[insert method here].('input:checkbox') </code></pre> <p>Cheers, Ian.</p>
jquery
[5]
3,860,927
3,860,928
Is onCreate called when an Activity object is created?
<p>Is onCreate called when a class object that extends activity is created? Or is it only called when an activity is <em>started</em>, for example over startActivity(...).</p>
android
[4]
5,086,752
5,086,753
Declaring variable in a FOR one time
<p>I have a simple question in java. I have this piece of code:</p> <pre><code>int i1=0; for(String x: list1) { for(String y: list2) { if(x == y) { log ("Checking "+x+" with "+y+" =&gt; found a match!"); list1.remove(i1); break; } else ...
java
[1]
4,903,250
4,903,251
Passing objects in javascript
<p>I want to pass an object in javascript. But i am getting an error <code>javascript:callbackCredits(1,dotsContainer_credits); is undefined</code></p> <p>My code is as follows:</p> <pre><code>var dotSlideCredits = { show : 3, width : 430, functionName : "callbackCredits", ...
javascript
[3]
625,004
625,005
JQuery IE 7 or IE9 dynamically add or remove options in select list not getting updated properly
<p>I’m new to JQuery and I hope some experts can help me with a strange issue I’m facing.</p> <p>I’m building a web application using ASP.NET MVC. In one of the view I’m giving a feature to the end users to add (or) remove a row dynamically to a table using JQuery. The first and second columns of the table will have a...
jquery
[5]
3,242,005
3,242,006
Freeing Application resources
<p>Usually resources such as threads, services, memory allocation... are allocated and defined per Activity. Hence, resources will be allocated on Activity.onCreate() and freed on Activity.pause(). This is very well defined.</p> <p>But, suppose my resources are allocated per Application (i.e I define a service which i...
android
[4]
1,191,840
1,191,841
is it possible to access HTML form data POSTed through a WebView?
<p>I've started to write an app which provides the user with an HTML form via a WebView. As the form is not under my control, the data filled in may be sent as either GET or POST request. My app is required to capture the transported form data, that is, get a hold on what was entered into the form fields.</p> <p>Using...
android
[4]
937,834
937,835
JavaScript private methods, asynchronous access
<p>I'm using a pattern like the one shown below to create a javascript library that has private and public methods. The idea is that the page that includes this library would call MYLIB.login() and provide two functions for when the user clicks OK, or Cancel.</p> <pre><code>var MYLIB = function() { // private da...
javascript
[3]
1,019,989
1,019,990
Ordering a set of lines so that they follow one from the other
<pre><code>Line# Lat. Lon. 1a 1573313.042320 6180142.720910 .. .. 1z 1569171.442602 6184932.867930 3a 1569171.764930 6184934.045650 .. .. 3z 1570412.815667 6190358.086690 5a 1570605.667770 6190253.392920 .. .. 5z 1570373.562963 6190464.146120 4a 1573503.8429...
python
[7]
5,998,811
5,998,812
reinitialize an object with self.__init__(...)
<p>Could anybody explain whether it is safe to reinitialize an object by calling "self.<strong>init</strong>(". as shown in the following simplified example?</p> <p>The reason i'm asking is that i couldn't find this method neither in several python books nor in internet. There are some who suggest to list all attribut...
python
[7]
3,816,476
3,816,477
rest webservice in android
<p>can anybody give example of rest webservice in android</p>
android
[4]
3,569,583
3,569,584
How do I send DTMF tones and pauses using Android ACTION_CALL Intent with commas in the number?
<p>I have an application that calls a number stored by the user. Everything works okay unless the number contains commas or hash signs, in which case the Uri gets truncated after the digits. I have read that you need to encode the hash sign but even doing that, or without a hash sign, the commas never get passed throug...
android
[4]
431,332
431,333
Is there any reason to sanitize user input if the input is not going to be stored anywhere?
<p>I can understand why user input that will be stored in a database needs to be sanitized to prevent sql injection and the like. But for a standalone script that just returns temporary data back to the user based on there original input. Is there a need to sanitize the user's original input in this situation?</p>
php
[2]
2,484,741
2,484,742
hiding an element with javascript, in a modular way
<p>I'm trying to create some functionality akin to .hide in jquery, but just using plain javascript, here's what I have so far:</p> <pre><code>(function() { addLoadEventHandler(function() { getByName = (function(name){ return document.getElementsByTagName(name) }) hide = (funct...
javascript
[3]
2,111,923
2,111,924
inheritance related problem in c#
<p>i learnt that private members are available in sub class in c# but we cant use these then what is the use of those private members n sub class and how can i access those private member in sub class please let me now i am not getting this point.</p>
c#
[0]
3,201,538
3,201,539
how to check if a passcode or screenlock is set in Android?
<p>Hi friend's i am new in Android</p> <blockquote> <p>how to check if a passcode or screenlock is set in Android.</p> </blockquote> <p>Is there any public API to figure this out. MY current application stores some secure data so it's important to know from the business logic of the application.please suggest me so...
android
[4]
439,263
439,264
Need direction on where to begin my programming journey. Non language specific just a foundation..where do I start?
<p>Sorry if this is in the wrong forum but I'm taking the plunge and I want to learn how to program from the ground up. I've been using VB.NET but only by copying/pasting what I could find on the net.</p> <p>I am wanting to start fresh. I'm looking for direction on what types of things I should be researching for a go...
c#
[0]
5,330,440
5,330,441
Surprising output of Python program
<p>I am just started learning Python am getting bit confused after seeing the output of following program:</p> <pre><code>#!/usr/bin/python # Function definition is here def changeme( mylist ): "This changes a passed list into this function" mylist = [1,2,3,4]; # This would assig new reference in mylist pr...
python
[7]
983,257
983,258
read file from assets
<pre><code>public class Utils { public static List&lt;Message&gt; getMesages() { //File file = new File("file:///android_asset/helloworld.txtv"); AssetManager assetManager = getAssets(); InputStream ims assetManager.open("helloworld.txt"); } } </code></pre> <p>I am using this code trying read file from as...
android
[4]
1,557,773
1,557,774
Adding setUTCDate() to replace "computers" time
<p>Well, I followed this tutorial <a href="http://tutorialzine.com/2011/12/countdown-jquery/" rel="nofollow">http://tutorialzine.com/2011/12/countdown-jquery/</a> (I have no idea how to do ANYTHING in JavaScript, I've done everything I know so far, and gotten a little budge..) But I wanted to just be able to set a date...
javascript
[3]
1,554,817
1,554,818
FF keeps spinning after document.write()
<pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" &gt; function fn() { document.write("Hello there!!!"); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;button onclick="fn()"&gt;click&lt;/button&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>After ...
javascript
[3]
3,086,312
3,086,313
error : Permission denied to access property 'document'
<p>how can I fix this message in firefox? i am using an Iframe which has an anchor tag? I would like to get a reference to this anchor but i am getting this error when I am trying to access anchor:</p> <pre><code> var frameWindow = document.getElementById('myIframe').contentWindow; var anchor = frameWindow...
javascript
[3]
2,077,281
2,077,282
iPhone: multi-part post using NSURLRequest
<p>I've seen a few articles, forum posts talking about uploading a file using NSURLRequest and NSURLConnection. Some of the ones I've seen are:</p> <ul> <li><a href="http://forums.macrumors.com/showthread.php?t=427513" rel="nofollow">http://forums.macrumors.com/showthread.php?t=427513</a></li> <li><a href="http://sta...
iphone
[8]
3,383,592
3,383,593
Determine if there is a value in a text field after submitting form
<p>All, I have a contact form on my page. I've got some jQuery things to contorl the form submission and I also have some PHP validation before I send the form. I'm still getting some blank emails. I make the email address and name a required field. I then have the following PHP:</p> <pre><code>&lt;?php $email = $_POS...
php
[2]
125,428
125,429
How to have an indefinite number of arguments in a Java method
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2635229/java-variadic-function-parameters">Java variadic function parameters</a> </p> </blockquote> <p>I'm new to Java, so if this is common knowledge, I'm sorry.</p> <p>I would like to be able to have an undef...
java
[1]
5,793,510
5,793,511
android emulating a reboot
<p>I have coded a BroadcastReceiver to enable the resetting of an alarm if a user has to reboot hid device. Is there any way to test this in the emulator, in other words what sequence of events are required to cause the emulator to kick off the BroadcastReceiver . Ron</p>
android
[4]
3,321,737
3,321,738
how to play m4a sound file in systemsoundid?
<p>I want to play m4a sound file in device.In simulater its playing but not in device.can help me for this problem?</p>
iphone
[8]
3,379,804
3,379,805
Jquery update div after form submit with same form and S_POST data
<p>A have a page with 6 (Jquery) tabs and on each tab there is a form, i want to submit one of the forms without refreshing the whole page. When i submit a form i want to "reload" the same form in that tab, but with the $_POST data so i can use that for PHP scripting (database insert after vallidation).</p> <p>I tried...
jquery
[5]
5,563,983
5,563,984
MSSQL Query issue in PHP and querying text data
<p>I'm trying a query in PHP to connect and extract data from a MSSQL EXPRESS (2008 R2) database. But i'm getting an error when i'm pulling ntext based data from the DB.</p> <p>Error is;</p> <blockquote> <p>Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as IS...
php
[2]
393,616
393,617
PHP Patterns - how can I write this code?
<p>I want to make an category-system CMS. Everything is fine, except a big trouble.</p> <p>How can I can handle and generate the mysql query depends by some inputs like:</p> <blockquote> <p>site.com/some-category&amp;sortby=views&amp;from=smt&amp;anotherInput=key</p> </blockquote> <p>For example, for this input my...
php
[2]
1,164,135
1,164,136
How to assign a new ascii key code value
<p>If the user press <code>enter</code> key, it should behave as he is pressing the <code>esc</code> key.</p> <pre><code>function OnEditorKeyPress(editor, e) { if (e.htmlEvent.keyCode == 13) { e.htmlEvent.keyCode = 27; //treeList.CancelEdit(); } } </code></pre> <p>But the value 13 remains same...
javascript
[3]
870,721
870,722
directorynotfound exception
<p>A DirectoryNotFound exception keeps happening for no apparent reason. The exception is thrown in: </p> <pre><code>public static string[] getKeywords(string filename) { string[] keywords = XElement.Load(filename).Elements("Keyword").Attributes("name").Select(n =&gt; n.Value).ToArray(); return keyword...
c#
[0]
3,153,614
3,153,615
limit textbox to x number of characters
<p>I have a textbox on an aspx page which I have limited to accept 250 characters. This works fine when a user just types data in, but if they paste the textbox will accept way more. Is there a way I can get around this? I dont want to disable pasting in the textbox though.</p> <p>thanks again</p>
asp.net
[9]
3,503,851
3,503,852
How can I return two parameters from a javascript function?
<p>I have the following:</p> <pre><code>function getPk(entity) { var store = window.localStorage; switch (entity) { case "City": if (store.getItem('AccountID')) { // Need to return both of the below pieces of information return store.getItem('AccountID') + "0...
javascript
[3]
3,841,848
3,841,849
Greedy match with negative lookahead in a regular expression
<p>I have a regular expression in which I'm trying to extract every group of letters that is not immediately followed by a "(" symbol. For example, the following regular expression operates on a mathematical formula that includes variable names (x, y, and z) and function names (movav and movsum), both of which are comp...
python
[7]
367,315
367,316
Time based loop and Frame based loop
<p>Trying to understand the concepts of setting constant speed on game loop. My head hurts. I read the <a href="http://www.koonsolo.com/news/dewitters-gameloop/" rel="nofollow">deWiTTERS page</a>, but I can't see the why/how...when I get it...it slips.</p> <pre><code>while(true) { player-&gt;update() ; pla...
c++
[6]
1,794,560
1,794,561
var exists or var gets value syntax?
<p>I came across the following line of code in the underscore.js source:</p> <pre><code>function (obj, iterator, context) { iterator || (iterator = _.identity); ... } </code></pre> <p>Is that syntax equivalent to:</p> <pre><code>if (!iterator) { iterator = _.identity; } </code></pre> <p>Are there any performa...
javascript
[3]