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,848,349
5,848,350
Static Method call from unknown object
<p>I want to call a static method from one of my objects. This is no problem if I know the name of the object, but in this case, I don't.<br> I have an array with several object names and I want to call the method from one of this arrays elements. So, it looks something like this:</p> <pre><code>function call_method($...
php
[2]
610,010
610,011
PHP - sort associative array by another indexed array
<p>I have the following arrays:</p> <pre><code>$arr = array( 'keyA' =&gt; 'valueA', 'keyB' =&gt; 'valueB', 'keyC' =&gt; 'valueC', 'keyD' =&gt; 'valueD' ); $order = array('3', '4', '1', '2'); </code></pre> <p>I need to sort $arr based on $order so the output be </p> <pre><code>array( 'keyC' =&gt; 'valueC', ...
php
[2]
3,269,178
3,269,179
Get the ID of a record in a gridview asp.net
<p>i have a checkbox in a template field of a gridview and i want to get the id of the record at a checkbox tick. how do i do it? i am doing asp.net and also by using datakeynames instead, my gridview also shows the datakeynames persID column. why? </p> <p>my code: </p> <pre><code>&lt;asp:GridView ID="GridViewHostel...
asp.net
[9]
238,029
238,030
ifstream how to determine why file does not open?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/839644/get-stdfstream-failure-error-messages-and-or-exceptions">Get std::fstream failure error messages and/or exceptions</a> </p> </blockquote> <p>I am using <code>ifstream</code> and I need to make opening of ...
c++
[6]
2,787,127
2,787,128
detect gps disabled
<p>I have this code to get my GPS position:</p> <pre><code> public void run() { mLocationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE); if (mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) { Looper.prepare(); mLocationListe...
android
[4]
5,082,639
5,082,640
Android 4.0.3 switching Enter button with Search button on soft keyboard
<p>I'm trying to get this working: in my XML in EditText I have:</p> <pre><code> android:imeActionLabel="Search" android:imeOptions="actionSearch" </code></pre> <p>But it doesn't work. In code </p> <pre><code> search.setImeOptions(EditorInfo.IME_ACTION_SEARCH); </code></pre> <p>Doesn't work either. Any cl...
android
[4]
669,783
669,784
Time for App aproval on Android
<p>I'm wondering when i can expect a app to go thourgh the reviewing process and going into the android market, because I know that apps in the iphone market take like a day to a month, is it the same for the android? </p>
android
[4]
3,669,796
3,669,797
how to order a Localized text list
<p>I wonder if anyone can tell me or give me a guide of how can I order a objet List(Key,Name) by name, but name is in LocalizedText format and maybe I'm so stupid, but I can't order this List.</p> <pre><code>//Objects definied on my class: [DataMember] public virtual Guid ComplaintPreventableStateId { get; se...
asp.net
[9]
1,683,151
1,683,152
If statements based on url
<p>I'm attempting to show a div tag based on the root url of my site i.e. if the url is dev.foo.com display div if else www.foo.com don't display etc. I've come up with this</p> <pre><code>&lt;?php if (substr($_SERVER['REQUEST_URI'], 0, 5) !== 'dev.') { echo '&lt;div class="dev-site-stuff"&gt;THIS IS THE DEV SITE!...
php
[2]
3,962,659
3,962,660
adding text in the backend destroying markup in richTextbox
<p>I'm making a small text editor in an greater application, so I've taken an richtextbox and added an tool strip whit somme buttons.</p> <p>Actualy everything works of the edditing part. My app requires to add a date time in the textbox everytime a button is clicked and when I do so, the whole markup is gone.</p> <p...
c#
[0]
1,544,899
1,544,900
Moving down a level in a directory
<p>is it possible to move down a level in directory in java</p> <p>for example in command prompt</p> <p>C:\Users\foo\</p> <p>i can use cd.. to go to</p> <p>C:\Users\</p> <p>is it possible to do this in java, because i am getting a directory using System.getProperty("user.dir"); however that is not the directory i ...
java
[1]
4,565,268
4,565,269
Copy/Paste functionality in UITableViewController
<p>I have a UITableViewController. I want to pop the copy/paste menu up when the user touches a cell. I want to do as in the Contacts app. How to implement this functionality. Can someone help me.</p> <p>I tried this code,</p> <pre><code>UIMenuController *theMenu = [UIMenuController sharedMenuController]; [theMenu se...
iphone
[8]
3,118,095
3,118,096
get the value of radio button and then proceed to autosuggest
<p>hello i have developed an autosuggest in my site and it works fine and now the problem is now an user selects an radio button the autosuggest should go to corresponding suggestion </p> <pre><code>$().ready(function() { $("#q").autocomplete('?h=sugg&amp;a='+$("#rad").val(), { width:350, max: 10, highl...
jquery
[5]
2,596,136
2,596,137
jQuery Date Picker: Select Weeks at a Time
<p>I know that there are lots of jQuery date pickers available and I have looked through a number. Essentially, I need a date picker that allows the user to select only entire weeks at a time. The user is picking room reservations, which last for a week. Therefore, I want the date picker to show such explicitly.</p>...
jquery
[5]
4,691,364
4,691,365
End the jQuery function when its recalled
<p>i build a jQuery function here <a href="http://jsfiddle.net/JuW3B/3/" rel="nofollow">http://jsfiddle.net/JuW3B/3/</a> </p> <p>i want this function stop animating and completes it's animation when it's recalled by another action before the first animation completed,</p> <p>so, when it's called like this</p> <pre><...
jquery
[5]
5,639,579
5,639,580
Android putting all my canvas drawing into another class?
<p>I am delving into the art of android and canvas and I have everything up and running and a little project I am working on! I have created a framework for a canvas loop to display animation the part where I draw to the canvas is as follows;</p> <pre><code>// DRAW TO THE CANVAS @Override public void onDraw(Canvas can...
android
[4]
3,219,671
3,219,672
PHP file redirecting user when it is not supposed to
<p>I'm making a login script for a Server CP although it doesn't seem to work as intended, I can login but if I go to the index page it doesn't redirect me to the admin page, code here:</p> <p>All Code: <a href="http://pastebin.com/DC8fVtD5" rel="nofollow">http://pastebin.com/DC8fVtD5</a></p> <p>Could anyone shed any...
php
[2]
3,995,793
3,995,794
iPhone, how to got the lines count of the UITextView text content?
<p>all, as topic, I want know the lines count of the UITextView, because I do not want user use scorll bar to scrolling the content , so I want split the content to multi-sub content to show in the UITextView in order . </p> <p>thanks for helping . </p> <p>Regards</p>
iphone
[8]
311,975
311,976
JQuery - Hover event not firing on Hover out
<p>I am implementing my own 'tooltip' where it creates a new div element every time you hover over it and removes it on hover out. The code below is stripped down from what I use but it shows the problem: This piece of code works perfect when a user slowly puts their mouse over and off the $('#' + fieldName) object but...
jquery
[5]
423,091
423,092
How to send source code - very common question
<p>I wanted to know what part of the project I need to copy for my USB for example in order to get the source code of the project. Do I need to copy the whole folder? Or do I need only the .sln file? Or..?because I've tried to copy the .sln file and when I try to open it with the other computer, it says that it can't o...
c#
[0]
5,143,007
5,143,008
Sharing a text to Evernote in iphone sdks
<p>How to share a Note or a text to evernote in iphone sdk?i downloaded the API along with the sample project from the EverNote website,but the sample application is not working,it crashes. after some googling i get this <a href="http://digitalpericope.net/?p=27" rel="nofollow">link</a>,but i didnt know how to implemen...
iphone
[8]
290,410
290,411
Why are these two JavaScript Date objects not the same?
<p>I`m a beginner reading a tutorial about Dates in JavaScript, and it gives this example to compare the time between two events. </p> <p>I don't really understand why firstDate and var secondDate wouldn't be the exact same time? does the new Date object in var secondDate only take the time once doEvent is triggered, ...
javascript
[3]
3,824,930
3,824,931
Android Collada
<p>Does anyone know a tutorial or an example on how to load .dae (collada) files in Adnroid and use this files with OpenGL-Es ?</p>
android
[4]
1,061,211
1,061,212
question on string iterators
<p>I have following code</p> <pre><code>#include &lt;iostream&gt; #include &lt;string&gt; #include &lt;algorithm&gt; using namespace std; int main(){ string d="georgia is nice country": string::iterator my; for (my=d.begin();my!=d.end();my++) { cout&lt;&lt;*my&lt;&lt;endl; } return 0; } </code></pre> ...
c++
[6]
854,489
854,490
What's a convenient way of resolving a path /bar/foo/baz/../.. into /bar?
<p>Is there a module capable of doing this, or should I write something myself?</p>
python
[7]
3,360,786
3,360,787
Is it posible to open a cind of browse for file window to get the filepath of a file in c++?
<p>And if this is possible pleas explain how to do this.</p>
c++
[6]
1,752,915
1,752,916
Is it a good practice to define IHaveVirtualDestructor base class in my C++ application?
<p>I would like to define a class that looks like this:</p> <pre><code>class IHaveVirtualDestructor { public: virtual ~IHaveVirtualDestructor(); }; </code></pre> <p>And I would like all my interface and abstract classes to inherit this class. Is it a good practice? Or should every interface/abstract class define ...
c++
[6]
2,600,372
2,600,373
reg exp - search()
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/494035/how-do-you-pass-a-variable-to-a-regular-expression-javascript">How do you pass a variable to a Regular Expression JavaScript?</a> </p> </blockquote> <p>how to write a variable into a reg exp pattern?</p> ...
javascript
[3]
2,539,200
2,539,201
Terminating ASync tasks
<p>I'd like to know if anyone has ever managed to terminate an Async task? <code>Cancel</code> doesn't work, for some reason, and every time you restart the Activity a new task is started, the previous ones still remain.</p>
android
[4]
3,346,488
3,346,489
Compressing recorded video in iphone
<p>I am developing an application which records the video and saves that video in database, now i want to reduce the resolution and bitrate/sec of recorded video how i can do that. any help on it.</p> <p>thank you.</p>
iphone
[8]
6,012,270
6,012,271
is it possible to load a picture in an alert box?
<p>I am trying to have a picture to load onclick into an alert box but I am getting <code>"[object HTMLImageElement]"</code> where the picture should be.</p> <p>This is what I have:</p> <pre><code> function joePic(){ var joe_fat = new Image; joe_fat.src = "pic1.jpg"; alert (joe_fat); } &lt;input type="button" ...
javascript
[3]
367,735
367,736
Help required with TableView swipe delete
<p>I am trying to implement SMS kind of swipe and delete functionality.</p> <p>In case of SMS application, an Edit button is on the left side of the navigation bar. When a swipe is attempted on a row, the Edit button changes to a Done button. If you click on Done button, the Delete mode is cancelled. If you click anyw...
iphone
[8]
5,506,582
5,506,583
Battery level for playing video in android
<p>At which battery level video cannot played by videoview in android?</p> <p>The level which is received by broadcast from</p> <pre><code>Intent.ACTION_BATTERY_CHANGED </code></pre> <p>This intent will return battery level like 1,2....</p> <p>Thanks in advance</p>
android
[4]
828,402
828,403
where do objects, static, and constant variables live in php?
<p>where do objects, static, and constant variables live in php?</p> <p>I'm worried if I declare too many static/constants, would result to a memory leak.</p> <p>thank you.</p> <p>best regards, bhadz</p>
php
[2]
1,314,832
1,314,833
How to create a UIButton from code instead of Interface builder?
<p>I tried to write lines below to create a button instead of using Interface Builder. But I couldn't get my button appeared. Is there something wrong with the code? Or there is other steps should be taken.</p> <pre><code>UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button setTitle:@"button" ...
iphone
[8]
1,540,526
1,540,527
Alarm manager triggered too many times
<p>I have a problem regarding Alarm manager in Android. I have the following code snippet to set an alarm that should be fired each week(once).</p> <pre><code> // Add the time and set when the notification will be triggered Calendar setCalendar = item.getDate(); calendar.set(Calendar.MINUTE,setCalendar.get(Ca...
android
[4]
3,919,752
3,919,753
How do I pass data between activities in Android?
<p>I have a scenario where after logging in through a login page, there will be sign out button on each activity.</p> <p>On clicking signout, I will be passing the session id of the signed in user to signout. Can anyone guide me on how to keep session id available to all activities??</p> <p>Alternatively, are there a...
android
[4]
2,635,675
2,635,676
jQuery positioning issue
<p>I have a web form against a white background that allows the user to make certain selections. Depending on the selection that the user makes, this form could grow very long lengthwise. (Although I advised against it, the client was adamant). The form works fine and I'm happy.</p> <p>However, at the bottom of th...
jquery
[5]
197,093
197,094
is there is any notification after update or changes in contact Address Book in iphone?
<p>is there is any notification after update or changes in contact Address Book in iphone</p>
iphone
[8]
5,415,419
5,415,420
http or https when including jquery from google API
<p>Should I do this</p> <p><a href="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" rel="nofollow">https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js</a></p> <p>or</p> <p><a href="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" rel="nofollow">http://ajax.googleapis.co...
jquery
[5]
1,172,777
1,172,778
jQuery delegate() not working ie IE
<p>I have a block of code being generated dynamically using xforms and dojo.</p> <p>The following block of jQuery works fine in chrome and firefox but not in IE:</p> <blockquote> <p>jQuery('.premiumBlock').delegate('.dijitCheckBoxInput', 'click', function(){ // do something });</p> </blockquote> <p>The c...
jquery
[5]
1,352,509
1,352,510
MFMailComposer - works in simulator but not in iPhone 2G
<p>I am trying to add MFMailComposer to my iPhone app and not having much luck getting it to launch in my iPhone 2G. It always launches the email app to the accounts page and closes my app. Works like a charm in the simulator.</p> <p>-(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated];</p> <pr...
iphone
[8]
4,052,953
4,052,954
Insert deleted records into history table before DELETE using TRIGGER
<p>I have a gridview that displays a recordset from a table - Master2. I want to use gridview to delete records from this table. Before the delete occurs, I want to insert the record into a history table with a datetimestamp and userid from the person doing the delete. Is this possible or should I simply build out t...
asp.net
[9]
4,123,087
4,123,088
How to Load Google Maps API site in a Android Application using JavaScript
<p><a href="http://code.google.com/apis/maps/articles/android_v3.html" rel="nofollow">http://code.google.com/apis/maps/articles/android_v3.html</a></p> <p>I tried for this tutorial for using javascript in android for google map,but I dont find any way to use the java script where to put the code of the javascript?</p>...
android
[4]
3,095,455
3,095,456
Backup app data on android without root and with a damaged micro USB port
<p>How can i backup a app's data (i.e. angry birds scores and achievements) on my nexus 7 4.2.2. My tablet is not rooted and my micro usb port is damaged disallowing me to connect to the computer. Any suggestions? Please and thank you for your time!</p>
android
[4]
1,637,334
1,637,335
jquery change text according to id
<p>I am new using jQuery..</p> <p>I have a list something like this</p> <pre><code>&lt;ul id="abc"&gt; &lt;li&gt;&lt;a id="sp"&gt;test&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="sb"&gt;test2&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>How do i change text according to id</p> <p>i tried something like this</p> ...
jquery
[5]
4,108,263
4,108,264
What's a good substitute for an enum?
<p>I'm writing a web service that returns different types of errors.<br> Each method can return one of the three basic types of errors:<br> <code>General</code>, <code>InvalidInput</code>, or <code>Non</code>.<br> In addition to those three possible values, each method can have it's own errors (e.g. for SignIn method -...
c#
[0]
3,786,922
3,786,923
Efficient OOPS Code
<p>Can anyone tell me how to code an efficient OOPS PHP code which decreases the execution time and gives more simplicity in code.......</p>
php
[2]
5,123,505
5,123,506
I need something like a class or struct that will allow me to put functions inside of it
<p>I am looking for an upgraded version of a struct that will allow me to put functions inside of it.</p> <p>According to:</p> <p><a href="http://stackoverflow.com/questions/54585/when-should-you-use-a-class-vs-a-struct-in-c">When should you use a class vs a struct in C++?</a></p> <p>a class will not provide me with...
c++
[6]
2,695,775
2,695,776
location.search in javascript
<p>Hi I want to know what <code>location.search.substring(1)</code> actually does. I see this code on some website. I alert but this did not give any result. does it suppose to alert location href?</p> <pre><code>alert(location.search.substring(1)) </code></pre>
javascript
[3]
3,835,982
3,835,983
Why we should use inverse version of int defined by hex in C#
<p>Quote from <a href="http://www.codeproject.com/Articles/35134/How-to-calculate-CRC-in-C" rel="nofollow">this article</a>:</p> <blockquote> <p>In many industries, the first polynomial is in use to create CRC tables and then apply it for performance purposes. The default polynomial, defined by IEEE 802.3 is 0xA001 ...
c#
[0]
2,280,750
2,280,751
After Importing android project
<p>I developed a project in android [API 13] but when i tried to run that project in other system having android[API 8] . It says</p> <p><strong>Unable to resolve target 'android-13'</strong></p> <p>How to resolve this bug???</p>
android
[4]
5,203,893
5,203,894
jQuery fadeIn effect
<p>I am not sure why the following code is not behaving the way I would expect it to, but as I am new to jQuery I am sure that I'm missing something elementary.</p> <p>html:</p> <pre><code>&lt;div id="locale"&gt;&lt;/div&gt; &lt;form id="theForm"&gt; What would you like to do?&lt;br /&gt;&lt;br /&gt; &lt;input type=...
jquery
[5]
846,966
846,967
What is the better Way to Store fixed no of data in Java? (Array vs ArrayList)
<p>I believe Array and ArrayList both are non-Synchronised;behave same in multiThreaded env. And both are Index based. Only Adavantage is ArrayList has utility methods and flexible. <BR> Apart from those Utility methods only to get and set fixed no of Objects which is best in java? Is there any overhead in using Arra...
java
[1]
5,704,069
5,704,070
Start application on bootup
<p>I have two applications which I have made to start at bootup of the phone by using the <code>BOOT_COMPLETE</code> event. I would like one application to start ahead of the other on bootup. Is there any way of setting priority so that the first application is started first. Note that I cannot start one application fr...
android
[4]
5,992,215
5,992,216
Can someone help me create an Up Button in action bar
<p>Im developing an application where the home view will use dashboard design. I saw in android design pattern that they introduce a new concept of using Up Button. Im confuse a little bit cause up button and back button is always the same except that you can use Up button to go directly in your home view. Can someone ...
android
[4]
2,692,957
2,692,958
php $_GET error
<pre> $url = $_GET['url']; echo "$url"; </pre> <p>and I request /test.php?url=ok</p> <p>gives me ok as output..</p> <p>but I use a url test.php?url=http://google.com </p> <p>gives me 403- Forbidden error.. I donno why it's not working ..</p> <p>Please help me..</p>
php
[2]
2,265,731
2,265,732
connect SQlite database
<p>Im trying to view database on my web app. The problem here is that it does not view from SQLite. rather view database from chrome add-ons. Is there any way for me to view SQlite databse using Jscript?</p>
javascript
[3]
5,273,999
5,274,000
Python : How to intercept a method call which does-not exists?
<p>I want to create a class that doesn't gives an <code>Attribute Error</code> on call of any method that may or may not exists:</p> <p><strong>My class:</strong></p> <pre><code>class magic_class: ... # How to over-ride method calls ... </code></pre> <p><strong>Expected Output:</strong></p> <pre><code>o...
python
[7]
4,324,157
4,324,158
learn and practice c++
<p>I'm trying to learn c++ and I really want to do a lot of coding but I'm not sure what I can code.. Tbh, book exercises are not very interesting to me (usually because they're just too short). I like to code OS related stuff like I/O stuff..</p> <p>I'm thinking of looking at linux and try mimicking some of the tools...
c++
[6]
2,702,813
2,702,814
C# deploy, problems with folders
<p>I've finished my app and used the visual studio installer to create a package with all the files that aplication need.</p> <p>But the problem is that, if the user install the program in ProgramFiles directory, it won't start because he needs admin Rigths (This because the program needs sqlServerCe).</p> <p>How i c...
c#
[0]
739,408
739,409
alternate CSV row deletion
<p>I have a csv file as follows:</p> <pre><code>gindex 1 1 2 2 3 3 7 7 </code></pre> <p>I printed each element twice by mistake. How can I delete each repeated row and get the following results:</p> <pre><code>gindex 1 2 3 7 </code></pre>
python
[7]
2,299,175
2,299,176
Android Open Accessory SDK error INSTALL_FAILED_MISSING_SHARED_LIBRARY
<p>Using the <a href="http://developer.android.com/guide/topics/usb/adk.html" rel="nofollow">Android Open Accessory Development Kit</a> and Google API 10.</p> <p>Run in the emulator, I can install it, however when I run on my Android 2.3.4 device, Eclipse gave this error.</p> <p>How can this be solved?</p> <blockquo...
android
[4]
5,782,717
5,782,718
reference variable
<p>In some text it is given that we can't assign constant values to a reference variable. When I executed such a program I could do it. Is there any condition we can't assign a constant value to a reference variable?</p>
c++
[6]
5,664,824
5,664,825
using PHP Simple HTML DOM Parser to find <img> and height
<p>I'm using PHP Simple HTML DOM Parser to return multiple images from external pages. I need to minimize the amount of images that are returned by only returning images with a width greater than 50px and a height greater that 60px. </p> <p>How can I use PHP Simple HTML DOM Parser to pull the height and width of each ...
php
[2]
336,995
336,996
How to implement OnScaleGestureListener in Android?
<p>Update: Problem solved.</p> <p>Hello,</p> <p>I tried to implement the OnScaleGestureListener in my activity, but I received nothing. What's wrong with the following codes ?</p> <p>Thanks.</p> <pre><code>package com.test; import android.app.Activity; import android.os.Bundle; import android.view.GestureDetector....
android
[4]
4,444,263
4,444,264
iPhone UIImagePickerController video mode
<p>When using the UIImagePickerController, is there a way to specify the resolution of the captured video, or to restrict the length of the video (based on size). I would love to be able to have the video capture at a standard lower res mode rather than 720P.</p>
iphone
[8]
3,886,418
3,886,419
Creating a matrix from simple three column text fie
<p>I'm trying to create a matrix or a contingency table from a file that has this format:</p> <pre><code>Species Date Data 1 Dec 3 2 Jan 4 2 Dec 6 2 Dec 3 </code></pre> <p>Result</p> <pre><code> 1 2 Dec 3 9 Jan 4 </code></pre> <p>More that I'd like to know how to turn myfile...
python
[7]
1,277,458
1,277,459
Sending GMail with attachment from Android app
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5762073/problem-attaching-internal-file-to-gmail-in-my-android-app">Problem Attaching internal file to GMail in my android app</a> </p> </blockquote> <p>My app writes data to text files on internal memory.<br> L...
android
[4]
3,277,256
3,277,257
iPhone SDK: To the iPhone/iTouch?
<p>I have SDK 3.1 for iPhone.</p> <p>I have made an application, and i want this to put on my iPod Touch.</p> <p>How to? Is there a need of paying to Apple for a paid developer account? Or is there a way to NOT pay...?</p>
iphone
[8]
2,494,971
2,494,972
Is it possible to use long double as an integer? (adding, substracting, multiplying, dividing, perbit operations ...)
<p>As far as I know in C++ standart <code>sizeof(long double)</code> is 10 byte = 80 bit => the variable of this <code>long double</code> type can carry 2^80 different values. So my question is here, is it possible to write some wrapper or I don't know what (using, maybe, perbit operations). To use <code>long double</c...
c++
[6]
4,697,949
4,697,950
How to change colors of a Drawable in Android?
<p>I'm working on an android application, and I have a drawable that I'm loading up from a source image. On this image, I'd like to convert all of the white pixels to a different color, say blue, and then cache the resultant Drawable object so I can use it later.</p> <p>So for example say I have a 20x20 PNG file that...
android
[4]
1,236,177
1,236,178
first is not a function
<p>I am a noob in Jquery and I am playing around with the different selectors and functions right now. I am trying to do this</p> <pre><code>$('li').first(); </code></pre> <p>on firefox console and I got </p> <pre><code>TypeError: $("li").first is not a function </code></pre> <p>when </p> <pre><code>$('li') </code...
jquery
[5]
1,761,878
1,761,879
select first index in collection where like
<p>I feel sometimes that I'm reinventing the wheel.</p> <p>I'm wondering if there are any utility methods in java/jakarta commons/guava/?, that will go deeper in the collection and do something (test, modify, remove) with the elements.</p> <p>I wrote this method and now I feel that there is some one-liner that can do...
java
[1]
3,231,717
3,231,718
How to add a string into each and every string in an array by using javascript or jquery?
<p>Actually I want to add "*." at opening and ";" at ending on each array element. Below is the sample code.</p> <pre><code>var ext = getExt(filename); var s = '&lt;%=AllowedExtensions %&gt;'; var match = s.split(', '); </code></pre> <p>In the above code in 'match' I use to get ["jpg", "png", "txt"] like this. So her...
javascript
[3]
2,790,274
2,790,275
How to pass object between python instances
<p>I have a genetic expression tree program to control a bot. I have a GP.py and a MyBot.py. I need to be able to have the MyBot.py access an object created in GP.py</p> <p>The GP.py is starting the MyBot.py via the os.system() command</p> <p>I have hundreds of tree objects in the GP.py file and the MyBot.py needs to...
python
[7]
3,330,820
3,330,821
Floats and scientific notation
<p>I am creating 1D and 2D array from a file that contains lines that look like this:</p> <p>42857000 -923070 0 0 -7887 428570 -546190 -4285700 546190 0 -6.5 -0.15384 6.5 0.15384 0.007 0 0 42857000 360570 0</p> <p>When I populate the arrays from the file, they get conv...
c++
[6]
302,665
302,666
Pass a targeted method as a parameter
<p>first of all, my english is not very good so if you could be kind it would be appreciated. Thanks.</p> <p>Now my problem, like I said in the title, I would like to pass a "method name" as a parameter in another method. Like a picture is worth thousand words, there is a chunk of my function:</p> <pre><code> publ...
c#
[0]
3,382,209
3,382,210
GetTimeZoneInformation equivalent in ubuntu?
<p>i am using <code>GetTimeZoneInformation</code> in windows...but not able to find any equivalent in linux. Any idea??</p>
c++
[6]
435,098
435,099
android Custom ListView selected row on button click
<p>I have custom listview with textview and button. I set the button click handle in the xml files and the implementation in the ListActivity.</p> <p>The problem is when i click the button, I cant get which selected row that i click.</p> <p>Regards</p>
android
[4]
1,106,316
1,106,317
Php string handling tricks
<p>Need to get the 10 word before and 10 words after for the given text . i mean need to start the 10 words before the keyword and end with 10 word after the key word.</p> <p>Given text : "Twenty-three" </p> <p>The main trick : content having some html tags etc .. tags need to keep that tag with this content only ...
php
[2]
4,618,264
4,618,265
Need to search a content which is in greek letters using strtoupper and strtolower
<p>I am currently working in a GREEK project. In that project all the contents are GREEK and in that i have a search functionality. Search process is good. But strtoupper() didn't convert the Greek language to upper case and strtolower() didn't convert the Greek language to lower case. </p> <p>But for English language...
php
[2]
4,852,975
4,852,976
JAXBElement<String> to String using Simple Framework for Android
<p>I'm having big time trouble with Android Webservice.</p> <p>I am converting JAXB Annotation to Simple Annotation. Please see below.</p> <p>Here is my JAXB Annotation:</p> <pre><code>@XmlElementRef(name = "Title", namespace = "http://xxx.org/2004/07/Course", type = JAXBElement.class, required = false) protected JA...
android
[4]
2,723,558
2,723,559
php login: undefined index
<p>Im very new to php and this is my first go on on this login. so when im typing in a valid username and password from the database im getting these two errors:</p> <p>Notice: Undefined index: brukernavn on line 3</p> <p>Notice: undefined index: passord on line 4<br> <pre><code>$username = $_POST['brukernavn']...
php
[2]
1,405,022
1,405,023
How to run the Tabbar without clicking the Tabs in Android
<p>I have a Tab bar application with two tabs named "Tab1" and "Tab2".</p> <p>Whenever I launch the application ,the Tab Bar runs and the "Tab1" in the Tab Bar get selected and it runs an Activity, because I have used setCurrentTab(0) method.</p> <p>So how can I run the Second Tab named "Tab2" simultaneously along wi...
android
[4]
5,301,843
5,301,844
Will inlining Javascript reduce the chance of delays?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/138884/when-should-i-use-inline-vs-external-javascript">When should I use Inline vs. External Javascript?</a> </p> </blockquote> <p>Often Javascript needs to be run as soon as possible. For example, suppose I ha...
javascript
[3]
1,963,460
1,963,461
How to sort ArrayList of DateTime objects in descending order?
<p>How do I sort ArrayList of DateTime objects in descending order?</p> <p>Thank you.</p>
c#
[0]
360,094
360,095
Geeting data from post in PHP and insert into table
<p>I am getting data from iphone using php but when i insert post data in table it gives error </p> <pre><code> mysql_select_db("emriphone", $con); $providernpi=$_POST['ProviderNPI']; $patienid=$_POST['PatientID']; $fileurl=$_POST['FileURL']; $filetype=$_POST['FileTYPE']; $datasynid=$_POST['DataSynID']; ...
php
[2]
145,988
145,989
why this kind of error coming C#?
<p>Error 1 The type or namespace name 'ServiceContract' does not exist in the namespace 'Net_Name_Pipe' (are you missing an assembly reference?) E:\DemoWCF\Net_Name_Pipe\DisplayNamedMessage\Form1.cs 12 21 DisplayNamedMessage</p>
c#
[0]
462,434
462,435
Is it possible to sort two lists(which reference each other) in the exact same way?
<p>Okay, this may not be the smartest idea but I was a bit curious if this is possible. Say I have two lists:</p> <pre><code>list1 = [3,2,4,1, 1] list2 = [three, two, four, one, one2] </code></pre> <p>If I run <code>list1.sort()</code>, it'll sort it to <code>[1,1,2,3,4]</code> but is there a way to get to keep list...
python
[7]
5,591,235
5,591,236
What's the difference between android and com.android?
<p>What's the difference between android and com.android? </p> <p>For instance, the file android/nfc/ErrorCodes.java has a different content than com.android/nfc/ErrorCodes.java - both file exist in the Android's source code.</p> <p>I want to know why there is a package called android, and also one called com.android...
android
[4]
2,124,158
2,124,159
Automating tasks through java
<p>Here's the problem:</p> <ol> <li>Run a java client as a batch job on a unix box which will connect to Oracle and fetch some data.</li> <li>Update an excel sheet (on a Windows machine) with the data fetched.</li> <li>Create a chart/graph from the data in excel sheet.</li> <li>Send the excel (with data &amp; graph) i...
java
[1]
448,609
448,610
Is it possible to validate the size of multipart form on the client side using jQuery?
<p>Is it possible to use jQuery to make sure that the multipart form data that is submitted by a form does not exceed a given size?</p>
jquery
[5]
3,924,232
3,924,233
if statement in php form and form output
<p>I am creating a order form for a meat locker company that sends the form to their email. There is a lot of where if you select one item you can not select another item; such as t-bone and New York Strip, you can have one or the other, but not both. Here is what my code looks like.</p> <pre><code>&lt;P&gt;T-bone ste...
php
[2]
1,114,857
1,114,858
Android - android.view.InflateException with a custom view
<p>Hi i keep getting this error its an android.view.InflateException at line #9 xml</p> <p>Heres my xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:lay...
android
[4]
3,332,793
3,332,794
Jquery help regarding hiding selected div divs
<p>i have say five divs with the layout as in the following code..</p> <pre><code>//Div one &lt;div class="container"&gt; &lt;div class="hide"&gt; &lt;button class="hide" value="hide" /&gt; &lt;/div&gt; &lt;/div&gt; //Div Two &lt;div class="container"&gt; &lt;div class="hide"&gt; &lt;button class="hide" value...
jquery
[5]
5,716,560
5,716,561
Creating an ImageView with a certain style programatically
<p>I want to do this programatically:</p> <pre><code>&lt;ImageView style="@style/TitleBarSeparator" /&gt; </code></pre> <p>Where <code>TitleBarSeparator</code> is:</p> <pre><code>&lt;style name="TitleBarSeparator"&gt; &lt;item name="android:layout_width"&gt;1px&lt;/item&gt; &lt;item name="android:layout_heig...
android
[4]
5,895,324
5,895,325
uint is 32 bits no matter the system is 32 or 64 bits?
<p>in C#, uint is a UInt32 type so it will be always 32 bits long no matter the OS is 32 or 64 bits. Am I right?</p>
c#
[0]
4,554,663
4,554,664
Casting/dereferencing member variable pointer from void*, is this safe?
<p>I had a problem while hacking a bigger project so I made a simpel test case. If I'm not omitting something, my test code works fine, but maybe it works accidentally so I wanted to show it to you and ask if there are any pitfalls in this approach.</p> <p>I have an OutObj which has a member variable (pointer) InObj. ...
c++
[6]
5,936,618
5,936,619
python lookup table
<p>I have a need to create a lookup table where A=10 and Z=35(B=11, C=12 and so on), what's the easiest way to accomplish this in python? I know there must be a very easy way to do it, just can't seem to find it.</p>
python
[7]