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,626,648
5,626,649
Save image path name from sdcard to Sqlite database
<p>am having a little trouble here. i am trying to store and retrieve images from an sqlitedatabase by storing their image path name. the images are stored in the sdcard. I tried this code, but its not working.</p> <p>saving image path:</p> <pre><code> String filename = "/sdcard/barn.jpg" ContentValues vals2 = new C...
android
[4]
1,842,987
1,842,988
How to overload the ->* operator?
<p>I tried this, and some variations on it:</p> <pre><code>template&lt;class T&gt; class Ptr { public: Ptr(T* ptr) : p(ptr) {} ~Ptr() { if(p) delete p; } template&lt;class Method&gt; Method operator -&gt;* (Method method) { return p-&gt;*method; } private: T *p; }; class Foo { pu...
c++
[6]
3,706,815
3,706,816
Specify region codes when writing a dvd using C#
<p>How to specify region codes when writing a dvd using C#</p>
c#
[0]
5,961,204
5,961,205
How to add title in the is the ListView in android
<p>How to add title in the is the ListView in android.</p> <p>Means </p> <h2>Subject From &lt;--------Title</h2> <p>hiiiii | Raj &lt;--------List Content<br /> hello | srss</p> <p>Here I have used</p> <p>EfficientAdapter extends BaseAdapter .</p>
android
[4]
4,173,006
4,173,007
C# - If/Else Help [User and Computer Input Interaction]
<p>I am trying to figure out a way to get the Computer player to respond to my moves basically by seeing "This spot is taken, I should see if another is free and take it".</p> <p>So far, I'm not making any improvements (been like 5 hours). I want the computer to realize if a certain button (which it chose at random) i...
c#
[0]
2,828,758
2,828,759
how to write new lines in CLI and web browser?
<p>I am running a php script from CLI command and web browser. I need to dispaly new lines properly in both ways so that it does not print <code>"&lt;br /&gt;"</code> in CLI and it shows new lines in browsers. Does anyone know how to write php function for this?</p> <p>thanks for any helps</p>
php
[2]
5,282,454
5,282,455
How can I find out if a File is a file or directory if it does not exist?
<p><code>File.isFile()</code> and <code>File.isDirectory()</code> both return false not only when the <code>File</code> is not the specified type, but also when the <code>File</code> itself does not exist on the filesystem. How can I determine whether the <code>File</code> represents a file or a directory when it does...
java
[1]
5,292,112
5,292,113
Using Cordova PhoneGap... how to set layout for landscape and Portrait view
<p>here is my code below... is there a way to do a screen orientation and choose to loadUrl index.html for portrait and then maybe land/index.html for landscape. </p> <pre><code>import org.apache.cordova.*; public class MainScreen extends DroidGap { //Called when the activity is first created. @Override pub...
android
[4]
2,366,481
2,366,482
compare Long value in java
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7672317/integer-int-allowed-in-java">Integer == int allowed in java</a> </p> </blockquote> <p>What is the difference between the following two statements</p> <pre><code>Long l1 = 2L; if(l1 == 2) System.out....
java
[1]
3,530,110
3,530,111
Compare elements of a 2D array
<p>I have all several files that contain the data I collected this data as a two-dimensional array now I must veriefie there is data in the file (file1) and if they redandante in other files :means (i have transforemed my files to array) for example tab [0] [j] with another tab [ i][j] except intersection with him self...
php
[2]
3,235,823
3,235,824
ASP.NET Intranet and Internet website
<p>I am designing ASP.NET website for Intranet users. At the end of Phase-I this will be available to Intranet users.</p> <p>But after Phase-II, the same site needs to be opened to certain users that are outside this office.</p> <p>Can I can use ASP.NET Membership provider?</p> <p>Any other design recommendations?</...
asp.net
[9]
1,163,835
1,163,836
Defining a class member with a class type defined later in C++
<p>Like I would want to do something like this,</p> <pre><code>class Object { public: World * Parent_World; //This here Object(World * Parent_World=NULL) : Parent_World(Parent_World) {} }; class World { public: Object * Objects = new Object[100]; } </code></pre> <p>That doesn't work because of the order. And I can't...
c++
[6]
2,732,263
2,732,264
C++ sign extension
<p>I am working on a homework problem, printing from a binary file. I have searched and found out that my problem is a sign extension problem.</p> <p>In c the correct action would be to cast to an (unsigned char)</p> <p>I have tried this solution and it does not work with cout</p> <p>output with (unsigned) is:</p> ...
c++
[6]
3,378,776
3,378,777
comparing string with enumeration
<p>I am analyzing the following piece of code using a static analysis tool called FindBugs.</p> <pre><code>if(str.equals(enum.SOMEVALUE)) {// do something}; </code></pre> <p>where str is a String and enum is an enumeration. The tool generates the following warning for this code, and states</p> <blockquote> <p>This...
java
[1]
5,177,500
5,177,501
PHP get website root absolute URL in server?
<p>I rely heavily in <code>$_SERVER["DOCUMENT_ROOT"]</code> to get absolute paths. However this doesn't work for sites which URLs don't point to the root.</p> <p>I have sites stored in folders such as:</p> <ul> <li>site1</li> <li>site2</li> </ul> <p>all directly inside the root. Is there a way to get the path in the...
php
[2]
4,180,298
4,180,299
How do I (in ASP.NET) determine if the connection is a remote connection?
<p>I'm trying to implement a bit of functionality that will behave much like the CustomError pages: if the connection is remote function A() will run; else function B() will run. </p> <p>The only problem I'm having is that I'm not sure the best way to determine a "remote" connection. Does it matter if I'm running my c...
asp.net
[9]
740,614
740,615
Error - the program is not giving output while calling the print method
<p>This is a simple program I created - one table class, one main class. In the table class I created a print method which simply outputs my name. From the main class I am calling the print method but not getting the output.</p> <pre><code>namespace ConsoleApplication3 { class table { public static v...
c#
[0]
4,648,340
4,648,341
Check for previous version of application
<p>I want to show a What's New form in my application. However I need to detect whether it's a new install, or an upgrade.</p> <p>I'm using the following code to upgrade the settings:</p> <pre><code>if (Properties.Settings.Default.settingsUpgrade) { WhatsNew WhatsNew = new WhatsNew(); WhatsNew.Show(); Wh...
c#
[0]
5,403,848
5,403,849
PHP - add item to beginning of associative array
<p>How can I add an item to the beginning of an associative array? For example, say I have an array like this:</p> <pre><code>$arr = array('key1' =&gt; 'value1', 'key2' =&gt; 'value2'); </code></pre> <p>When I add something to it as in <code>$arr['key0'] = 'value0';</code>, I get:</p> <blockquote><pre>Array ( [...
php
[2]
5,887,200
5,887,201
How do I round to one place but force extra 0 so it looks like normal price?
<p>In JS How do I round to one place but force extra 0 so it looks like normal price?</p> <p>There are many answers on the topic but what I want to achieve is to get rid of the pennies/cents last digit. So for example instead of 15.98 I can show 16.00 or instead of 14.49 I can show 14.50.</p> <p>The below rounds to o...
javascript
[3]
3,456,544
3,456,545
view terminates when scrolling
<p>my problem is, that if i scroll my table view very fast, the screen freazes. i get the following: <em>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewControllerWrapperView isEqualToString:]: unrecognized</em> perhaps someone can help me! Thx</p>
iphone
[8]
2,426,537
2,426,538
How do I find the 1st and 3rd columns from a 3byX grid
<p>I have the following foreach</p> <pre><code>foreach( $array as $v ) { if( SOME LOGIC HERE ) $class = "first"; if( SOME LOGIC HERE ) $class2 = "third"; print '&lt;span class="$class $class2"&gt;$v["name"]&lt;/span&gt;'; } </code></pre> <p>I want to set $class1 to be 'third' for every 1st, 4th, 7th,...
php
[2]
2,018,503
2,018,504
create a two dimensional array from simple array for csv use
<p>to create a csv file with php, the expected input is a two dimensional array, so as 1 row = 1 internal array.</p> <pre><code>$list = array ( array('aaa', 'bbb', 'ccc', 'dddd'), array('123', '456', '789'), array('"aaa"', '"bbb"') ); $fp = fopen('file.csv', 'w'); foreach ($list as $fields) { fputcsv...
php
[2]
5,627,636
5,627,637
How to sort std::list<..>
<p>i have a list of Elemtents of a custom type:</p> <pre><code>std::list&lt;CDataTransferElement*&gt; m_list; </code></pre> <p>The class is defined like this:</p> <pre><code> class CDataTransferElement { public: CDataTransferElement(void); ~CDataTransferElement(void); CString Name; double Percent...
c++
[6]
1,653,342
1,653,343
how to call the array in $$variable
<pre><code>$var = "array"; $$var=array("1","2"); </code></pre> <p>How can I call the array in <code>$$var</code> without using <code>foreach</code>? I want a method like <code>$$var[0]</code>, but this doesn't work.</p>
php
[2]
5,029,477
5,029,478
Display Chinese text in activities
<p>I want to write Chinese text in activities but when i run the program i am getting error.</p> <p>How to write Chinese text in activities? And We need to import any other files???</p>
android
[4]
2,327,210
2,327,211
JQuery Tabs Custom CSS
<p>I need to apply Custom CSS for jquery tabs.... I have two Jquery tab panels on single View...How to apply diffrent CSS for both Tab panels</p> <p>Css for Selected and hover and default </p> <p>Please give me suggestion</p> <p>Thanks Narasimha</p>
jquery
[5]
2,608,120
2,608,121
Need of serialization in Java
<p>Can anyone tell me what is the need of Serialization in Java and an example scenario to explain the need . I dont need the definition .</p>
java
[1]
4,133,818
4,133,819
How do i perform an action on click of a particular link available on website?
<p>I have an application in which i have added a menu.</p> <p>Clicking on this menu opens up a website.</p> <p>There is a list of links(zip files) available on this website.</p> <p>Clicking on a particular link should result in that zip file to be downloaded to the assets folder of my application.</p> <p>I am able ...
android
[4]
2,531,534
2,531,535
jquery to find data-attr where
<p>Using the url of the page I have been able to get the value edc into a variable but what I need to do is find the data-ttl where data-uri is equal to edc.</p> <p>If PHP this would be easy but I'm unsure how to go about it in jQuery</p> <blockquote> <p>domain.com/media-centre/video/edc</p> </blockquote> <p><stro...
jquery
[5]
3,893,996
3,893,997
jQuery each() and "on success"?
<p>I'm using <code>$().each()</code> to loop through some items. I want to make sure that the action that follows after this piece of script is only executed when <code>each()</code> has completed.</p> <p>Example:</p> <pre><code>$('something').each(function() { // do stuff to items }); // do something to one of th...
jquery
[5]
5,594,277
5,594,278
jQuery: keydown event fires multiply times
<p>At present, when I press the Ctrl button and hold it pressed for a while, the handler that I binded to the keydown event with the help of jQuery is triggered multiply times - I would like to avoid triggering it more than once per a separate press. How would I accomplish that?</p>
jquery
[5]
4,140,312
4,140,313
Why does variable in setTimeout callback not have expected value?
<pre><code>&lt;div id="image_cont"&gt; &lt;img src="images/pic1.jpg" alt="pic1" /&gt; &lt;img src="images/pic2.jpg" alt="pic2" /&gt; &lt;img src="images/pic3.jpg" alt="pic3" /&gt; &lt;/div&gt; $(document).ready(function() { slide(3, "image_cont", 5000, 600); }); function slide(numberOfImages, containerId, t...
javascript
[3]
4,373,867
4,373,868
else statement doesn't seem to execute
<p>i'm a complete begginner and was hoping to get some help on my first script.</p> <p>basically i want one link that when clicked makes a div slide down and changes the links text, when its clicked again the process reverses.</p> <p>here is my code:</p> <pre><code>$(function() { if ($('#link1:contains("link text")'...
jquery
[5]
1,449,693
1,449,694
Imploding an array issue in php
<p>I have this code above which i use to implode some variable. The issue is that i need to create the same thing for <code>$hostess_name[]</code> as i did for <code>$hostess_id_selected[]</code>. I don't know what am i doing wrong. I need to implode it the same way as i did with <code>$hostess_id_selected1</code></p...
php
[2]
1,936,640
1,936,641
JS revision for jQuery 1.7+
<p>So I have a code that looks something like this</p> <pre><code>$(".something").live({ mouseover:function(e){ //do stuff }, mouseout:function(e){ //do or undo other stuff } }); </code></pre> <p>But since this <code>.live</code> method is depricated in jQuery1.7+, i have to do a bit of revising...
jquery
[5]
362,326
362,327
How can you do something with each argument in a JavaScript function?
<p>Given this function:</p> <pre><code>function foo( a,b,c ) { // } </code></pre> <p>How can you do something, say use console.log() for each argument? I know you can see the arguments by using the arguments keyword. Arguments seems to return what looks like an Array (but is of type "object" [suprise.. not]) but ...
javascript
[3]
744,561
744,562
how to change backgroundcolor of uibutton programatically
<p>I want to change the background color of a button to black.</p> <p>i have tried so many codes. but didn't works fine.</p> <p>how it is possible</p> <p>Regards</p> <p>K L BAIJU</p>
iphone
[8]
2,994,154
2,994,155
Testing android apps
<p>What exactly are mock tests...I need to know the mock and performance tests available in android for testing android apps..what is the best tool for testing android apps and how..</p>
android
[4]
5,252,393
5,252,394
How do you use Web Site Administration Tool without installing VS 2010
<p>I am running a website using asp.net Web Site Administration Tool. </p> <p>I dont want to install vs on the web server.</p> <p>Is there a way around it?</p> <p>Thanks</p>
asp.net
[9]
5,434,101
5,434,102
About NSPredicate in Core Data Fetch
<p>I have two entities, User &amp; Message.</p> <ul> <li>Message has a created_at timestamp;</li> <li>Message has a sender[to one relationship with User];</li> <li>User has a sentMessages[to many relationship with Message];</li> </ul> <p>However I want to fetch all users who have sent any messages and with their late...
iphone
[8]
2,764,389
2,764,390
Method overriding and exceptions
<p>I was going through SCJP 6 book by Kathe sierra and came across this explanations of throwing exceptions in overridden method. I quite didn't get it. Can any one explain it to me ?</p> <blockquote> <p>The overriding method must NOT throw checked exceptions that are new or broader than those declared by the ove...
java
[1]
5,449,465
5,449,466
How to increase the buffer size for reading text files in android emulator?
<p>I am developing an application which will read the text file from the SD-Card. I am able to store the details into sd-card in a text format. However, I am unable to display the data from the text file due to default buffer size limitation.</p> <p>Please let me know the procedure to increase the buffer size.</p> <p...
android
[4]
5,099,501
5,099,502
Is there really no secret stream copy method in the Java runtime?
<p>I know about IOUtils and I know about FileChannel transferTo. But I would really like to know if there is a stream copy method somewhere hidden in the normal Java runtime.</p> <p>Something like public long copy( InputStream is, OutputStream os){...}</p> <p>I know I can write it myself but I am curious.</p>
java
[1]
1,879,243
1,879,244
App crashes when multiple files "write to file" simultaneously
<p>Here is my code.</p> <pre><code>- (void) connectionDidFinishLoading: (NSURLConnection *) connection { //Each connection has its own "downloadedData". BOOL writeFlag = [downloadedData writeToFile: filePath atomically: YES]; } </code></pre> <p>I have multiple NSURLConnections at the same time.Each connectio...
iphone
[8]
3,382,543
3,382,544
How to not lock two files with Assembly.Load
<p>If I copy a file</p> <pre><code>File.Copy(src, dst); </code></pre> <p>and then load the copy</p> <pre><code>var asm = Assembly.LoadFile(dst); </code></pre> <p><strong>Why are <em>both</em> files locked by my process?</strong> </p> <p>If I delete the src before I load the dst, and then recopy the dst back to the...
c#
[0]
2,514,839
2,514,840
How can be achived the parallelism in java code with single CPU?
<p>How come in JMS(Java Messaging Services) technology we achieved two thread execute simultaneously on single CPU based system?</p>
java
[1]
5,398,898
5,398,899
All O(1) functions take exactly the same amount of time to run. True or False?
<p>"All O(1) functions take exactly the same amount of time to run." True or false? Can anybody explain the answer to me?</p>
python
[7]
3,598,927
3,598,928
Rotate an image around center
<p>How can I rotate an image around it's center point? This rotates it but also moves it:</p> <pre><code> Matrix mat = new Matrix(); mat.postRotate(45); Bitmap bMapRotate = Bitmap.createBitmap(dialBM, 0, 0, dialBM.getWidth(),dialBM.getHeight(), mat, true); dial.setImageBitmap(bMapRotate); </code></pre> <p>I've chec...
android
[4]
1,386,999
1,387,000
Transisting to different link when clicking on imageview android
<p>I have used an <code>ImageView</code> and added a link to it. I have set listeners to it. Here is the code:</p> <pre><code>case R.id.imgLogo: String url = "http://www.xyz.com"; Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(url)); startActivity(intent); break; </code></...
android
[4]
3,397,468
3,397,469
php objects, how to access a simplexmlelement
<p>I have the following object:</p> <pre><code>object(SimpleXMLElement)#337 (1) { [0]=&gt; string(4) "1001" } </code></pre> <p>But I can't seem to access it using [0] or even not using foreach($value as $obj=>$objvalue)</p> <p>What am I doing wrong?</p>
php
[2]
5,083,533
5,083,534
Convert Hex to RGB for imagegif function
<p>The function below is designed to take an input hex (with or without the "#" prefix) and apply the color update to the portion of the image between startPixel and endPixel.</p> <p>I can get the function to work fine on localhost tests when (1) supplying red, green, blue and (2) running the file directly as a stand ...
php
[2]
2,688,933
2,688,934
Install PHP5 with Apache on Win7 PC
<p>I have installed Apache 2.2 and PHP5 in my laptop. Apache seems to work fine. When I view a php page the text in the html body section displays fine but the php section does not get displayed at all. I am thinking I must have missed some entry in the apache config file to tell it where PHP is installed?</p> <p>A...
php
[2]
5,796,135
5,796,136
How do I set a background color for each item in a list view based on content
<p>So I've been modifying the notepad tutorial code: <a href="http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html" rel="nofollow">http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html</a> . </p> <p>Basically what I want to do is to create specific layout styles (i.e. backgrou...
android
[4]
5,842,451
5,842,452
Multisocket - how to count how many datagram packets are coming up
<p>So I am sending audio over UDP via multicast. And the sender is sending a raw audio UDP packet every 10 ms. Unfortunately every now and then it misses a packet. So what I did was try to time the send/receive so that I can work out if I have missed one.</p> <p>Here is what I currently have: </p> <pre><code>prevRece...
java
[1]
246,613
246,614
getElementById vs. getElementsByTagName
<p>Basic question.</p> <pre><code>document.getElementById("yy").onmouseover = hi; //document.getElementsByTagName("li").onmouseover = hi; ... </code></pre> <p>In this example, <a href="http://jsfiddle.net/8fURz/1/" rel="nofollow">http://jsfiddle.net/8fURz/1/</a> why does the first line work, but not the second line (...
javascript
[3]
59,846
59,847
adding weekdays - clears the time
<p>I've tired to add 10 weekdays to now. Everything is OK, but it clears the time part. Do you know why?</p> <pre><code>$now = date("Y-m-d H:i:s"); echo $now.'&lt;br&gt;'; $mod = strtotime($now." +10 weekdays"); echo $mod.'&lt;br&gt;'; echo date("Y-m-d H:i:s",$mod).'&lt;br&gt;'; </code></pre> <p>Output:</p> <pre><co...
php
[2]
3,462,740
3,462,741
Can I use <%= ... %> to set a control property in ASP.NET?
<pre><code>&lt;asp:TextBox ID="tbName" CssClass="formField" MaxLength="&lt;%=Constants.MaxCharacterLengthOfGameName %&gt;" runat="server"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>The code above does not work. I can set the MaxLength property of the textbox in the code behind but i rather not. Is there away I can set t...
asp.net
[9]
4,108,766
4,108,767
Most efficient approach in inherited fields?
<p>Consider a certain class hierarchy consisting of a root class and some subclasses </p> <pre><code> R | .--+--+------. | | ... | S1 S2 ... Sn </code></pre> <p>Class R has a field <code>x</code> of a certain type, say <code>X</code>, which is not a simple type, that every subclass should inherit. ...
java
[1]
2,776,880
2,776,881
unlisted android process
<p>Is there a way to craft a daemon process as to make it "unlistable" to a process viewer?</p> <p>OR</p> <p>is there a way to dynamically change a process name?</p> <p>I'd like to design a security application without having to modify the firmware, if possible (yes I know about "security through obscurity"...).</p>...
android
[4]
2,281,134
2,281,135
build an object without using of "new"
<p>How can this object be rewritten so you don't need to declare it with "new"?</p> <pre><code>var Lang = new function(){ this.get = function(str, trans){ if(TRANSLATE[str]){ var str = TRANSLATE[str][LANG]; if(count_obj(trans) &gt; 0){ for(var key in trans){ ...
javascript
[3]
3,611,665
3,611,666
Regarding joining of threads
<p>I have developed the below program on java threads , I have two threads which are executing and accessing the method inside run() now if I want to first thread to begin first and then second thread that I have done through synchronization mechanism but if I want first thread to end first and then began with second t...
java
[1]
238,858
238,859
How to call a function when using a map constructor?
<p>I found this code at <a href="http://www.cplusplus.com/reference/stl/map/map/" rel="nofollow">here</a>. How does the compiler know to use the function defined in classcomp?</p> <p>struct/fucntion</p> <pre><code>struct classcomp { bool operator() (const char&amp; lhs, const char&amp; rhs) const { retu...
c++
[6]
3,595,485
3,595,486
Memcpy from a char * buffer to a wchar_t * buffer
<p>Basically I have</p> <pre><code>void FileReader::parseBuffer(char * buffer, int length) { //start by looking for a vrsn //Header seek around for a vrns followed by 32 bit size descriptor //read 32 bits at a time int cursor = 0; char vrsn[5] = "vrsn"; cursor = this-&gt;searchForMarker(cursor, length, vrs...
c++
[6]
396,727
396,728
Base and derived class allocation
<p>In the code below, <code>drvdCls</code> derives from <code>bseCls</code>. This code compiles and runs as it is. I however find an issue here: <code>newBse</code> will get deallocated after <code>Test()</code> exits. Am I right?</p> <pre><code>bseCls* Test() { bseCls* newBse = new drvdCls(); drvdCls newDrvd...
c++
[6]
2,269,530
2,269,531
php form refresh send form again (prevent)
<p>when a form is filled and send, if you refresh the page, its says that the form will send again. (submit the form again).</p> <p>What is a good way to prevent this from happening? or kill this session?</p> <p>any guidance in this?</p> <p>thank you</p>
javascript
[3]
2,744,017
2,744,018
Python - go to two lines above match
<p>In a text file like this:</p> <p>First Name last name #<br /> secone name<br /> Address Line 1<br /> Address Line 2<br /> Work Phone: <br /> Home Phone:<br /> Status:<br /></p> <p>First Name last name #<br /> ....same as above...</p> <p>I need to match string 'Work Phone:' then go two lines up and insert charact...
python
[7]
285,481
285,482
Message box in front of all windows in console application?
<p>I am trying to get a message box to pop up in front of all windows so the user will see it. I have the following code but it seems to put the message box to the very back.</p> <pre><code>DialogResult dlgResult = MessageBox.Show(new Form() { TopMost = true }, "Do you want to continue?", "Continue?", Mess...
c#
[0]
97,543
97,544
How to add support-v4.jar javadoc into my project?
<p>I have created a project and the support-v4.jar is already inside the libs and dependency.(It this normal? Cause I know people were trying to import the .jar manually). But when I hovered my mouse over the class it said the javadoc doesn't exist. How do I solve this problem?? I created the project and if that comes ...
android
[4]
3,040,281
3,040,282
how to show only the last four digit of a credit card number
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/773396/how-to-show-only-part-of-an-int-in-c-sharp-like-cutting-off-a-part-of-a-credit">How to show only part of an int in c# (like cutting off a part of a credit card number)</a> </p> </blockquote> <p>I want to ...
c#
[0]
1,271,375
1,271,376
Creating custom and stylized GUI in Android Apps
<p>Guys, whant to get any kind of info about sources in global net about developing stylized GUI, using any kind of tools (graphical editors: photoshop, gimp, Illustrator; android resources, such as drawable and so on), web-sites, books, videos, would be great if it has samples. </p> <p>Thanks everybody for any kind o...
android
[4]
897,458
897,459
ASP.NET: Why ALWAYS use 2 RequiredFieldValidator controls when validating 2 behaviors?
<p>I always wonder why to check (i)if a field is not empty and also (ii)if the user submitted the initial value presented to him, we always need 2 RequiredFieldValidators.</p> <p>Is there any reason they made it that way? Why not just adding a <strong>bool</strong> property such as "<strong>NullOrEmptyAllowed</strong>...
asp.net
[9]
1,681,386
1,681,387
Resolving an ambiguous reference
<p>I'm trying to create a manager class to use with my charting tool, the problem is the tool I use, uses the same names for both a 3d and 2d charts which is resulting in ambiguous reference when I try to add the 2d library.. any ideas how best to resolve this?</p> <p>For example,</p> <pre><code>using tool.2dChartLib...
c#
[0]
4,869,519
4,869,520
How can be achived the parallelism in java code with single CPU?
<p>How come in JMS(Java Messaging Services) technology we achieved two thread execute simultaneously on single CPU based system?</p>
java
[1]
1,698,108
1,698,109
Can a python subclass be store in a seperate module from its superclass
<p>I've written some code that contains a main and a number of subclasses that inherit variables from a superclass.</p> <p>E.g.</p> <pre><code>class superclass(object): def __init__(self, var1, var2): self.var1 = var1 self.var2 = var2 class subclass1(superclass): def method1(self): pa...
python
[7]
162,595
162,596
Is there EVER a reason to NOT use "var" when initially declaring a Javascript variable?
<p>I already know the difference between using "var" and not using "var" to declare a Javascript variable. Using "var" ensures that the variable exists as a distinct entity strictly within the local scope of the code block, whereas not using "var" would effectively make the variable global. I also know that if you de...
javascript
[3]
3,325,136
3,325,137
Split based by a-z character in an alphanumeric string in python
<p>I have strings like "5d4h2s", where I want to get 5, 4, and 2 from that string, but I also want to know that 5 was paired with d, and that 4 was paired with h, etc etc. Is there an easy way of doing this without parsing char by char?</p>
python
[7]
6,014,912
6,014,913
Is include()/require() with "side effects" a bad practice?
<p>Is doing something like</p> <pre><code>_________________________ //index.php ... require("header.php"); ... _________________________ _________________________ //header.php printHeader() function printHeader(){ echo 'something'; ... } _________________________ </code></pre> <p>considered a bad practice t...
php
[2]
5,761,685
5,761,686
Android handle HTML links and typed links in a TextView
<p>I am trying to handle both HTML and typed links in TextViews and I am unable to find a combination of the built in tools to do this. I can make one or the other work but not both.</p> <p>Given the following formats</p> <pre><code>http://google.com &lt;a href="http://google.com/"&gt;Google!&lt;/a&gt; </code></pre> ...
android
[4]
2,835,893
2,835,894
Can I check is a page present w/ jQuery
<p>If I have a URL, can I check if the page is present or not with jQuery? For example if it returns 400 Error, I'll execute one command and if not 400, another command?</p> <p>Would I use AJAX call for it? Or what's the best way to handle it?</p> <p>Sorry, did not realise this was important. URL is not on the same d...
jquery
[5]
1,542,068
1,542,069
Can I put my own app on just my iphone?
<p>I want to create an iphone app for personal use. </p> <p>Can I just put it on my phone and use it or do I have to go through the iphone store process to get it on my phone?</p> <p>Thanks.</p>
iphone
[8]
871,705
871,706
Android Sliding gesture based tabs
<p>Google docs app uses swipable gesture based tabs using which you can navigate to different tab/category. How do we achieve this? <img src="http://i.stack.imgur.com/7R4bu.jpg" alt="enter image description here"></p>
android
[4]
89,703
89,704
PHP Getting apart of Name in to <a href="
<p>So I have this code: More explanation below</p> <pre><code>&lt;?php include_once 'imdb.class.php'; $oIMDB = new IMDB('Green Lantern'); if ($oIMDB-&gt;isReady) { echo '&lt;li class="withimage"&gt;&lt;span class="name"&gt;' . $oIMDB-&gt;getTitle() . '&lt;/span&gt;&lt;span class="comment"&gt;' . $oI...
php
[2]
1,774,748
1,774,749
why i get Permission Denial on trying to access sms messages?
<p>i wrote the simple code </p> <pre><code> ContentResolver contentResolver = this.getContentResolver(); Uri uriSMSURI = Uri.parse("content://sms/"); // HERE I GET THE EXCEPTION Cursor cur = getContentResolver().query(uriSMSURI, null, null, null, null); int count = cur.getCount(); </code></pre> ...
android
[4]
1,572,452
1,572,453
Good programming practices versus speed of ad-hoc programming
<p>I know good programming practices always help in the "long run" for a project, but sometimes they just seem to cost a lot of time. For instance, its suggested that I maintain a header file and a cpp file for each class that I make, keep only the declarations in the headers while definitions in cpp. Even with 10-12 c...
c++
[6]
4,971,869
4,971,870
Java code to Prevent duplicate <Key,Value> pairs in HashMap/HashTable
<p>I have a HashMap as below (assuming it has 10,0000 elements)</p> <p><code>HashMap&lt;String,String&gt; hm = new HashMap&lt;String,String&gt;();</code><br> <code>hm.put("John","1");</code><br> <code>hm.put("Alex","2");</code><br> <code>hm.put("Mike","3");</code><br> <code>hm.put("Justin","4");</code><br>...
java
[1]
4,736,284
4,736,285
Android AnimationDrawable start
<p>I'm using AnimationDrawable to show missing network connection. Show/hide logic is linked to network status change receiver. It works fine. But when start activity knowing status and try to start animation - animated drawable shows and freezes on first frame. I've read in documentation - 'do not start animation in O...
android
[4]
1,911,578
1,911,579
Passing JavaScript Parameters via Calling URL
<p>I have a JavaScript file that embeds a widget on a website. I want to be able to call this widget using a URL of the form:</p> <pre><code>http://domain.com/widget.js?variable=test </code></pre> <p>Within the JS script I want to be able to read in the value of the URL parameter 'variable' which is this case is 'tes...
javascript
[3]
4,050,835
4,050,836
how to print a php page with table data
<p>I have a search results in a form which displays a particular persons details. Here what I need is I should have a print page button and print that search result. How is that posible in PHP?</p>
php
[2]
244,538
244,539
Javascript object in an other object
<p>I searching for an hour now (w/o any success), that how can I define an object in an other object (in javascript):</p> <pre><code>function UserStat(arr) { var arrx = arr; this.day = function(dateofday) { //Some code going here which results will be stored variables like: this.a = someInnerFu...
javascript
[3]
3,706,778
3,706,779
Is there a more agile way to re-factor the following string formating code
<p>I need to format a string as bellow :</p> <pre><code>print "%8s%-32s%-32s%-32s" % (' ', 'CAT A', 'CAT B', 'CAT C') </code></pre> <p>Since the number of cat is a variable, here is what I code.</p> <pre><code>values = [' ', ] format = "%8s" # width is a variable width = house.get_width() for cat in range(house.get...
python
[7]
731,183
731,184
How to define level of multidimensional array
<p>Example</p> <pre><code>Array ( [key11] =&gt; value11 [key12] =&gt; Array ( [key21] =&gt; value21 [key22] =&gt; value22 [key23] =&gt; Array ( [key31] =&gt; value31 [key32] =&gt; value32 [ke...
php
[2]
2,316,776
2,316,777
is posible to excute codebehind Event first while dropdown change
<p>I have code like</p> <pre><code>&lt;asp:DropDownList ID="SiteIDDropdownList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="SiteIDDropdownList_OnSelectedIndexChanged" onChange="javascript:markItUpApply();"&gt; &lt;/asp:DropDownList&gt; </code></pre> <p>Here I need fire first "On...
asp.net
[9]
262,420
262,421
How can you know the calling method type in PHP?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1647735/how-to-tell-whether-im-static-or-an-object">How to tell whether I’m static or an object?</a><br> <a href="http://stackoverflow.com/questions/3824143/how-can-i-tell-if-a-function-is-being-called-statically-...
php
[2]
2,781,318
2,781,319
Possible to receive touch screen events in the background?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3540076/get-co-ordinates-touch-screen-in-a-background-service">Get co-ordinates touch screen in a background service</a> </p> </blockquote> <p>I'm experimenting with an accessibility project -- is it possible to...
android
[4]
5,612,550
5,612,551
How to stop from refiring an event on a page refresh
<p>I have form data that I insert into a database when the user clicks on a submit button. The problem is that after the original submission if the user refreshes the page the form data will be resubmitted and thus inserted into the database a second time. How can I fix this?</p>
c#
[0]
43,152
43,153
jquery ajax post and response evaluation
<p>i am relatively new to javascript and jquery in particular, so please bear with me, i am trying to loop through multiple s and then serialize() the data with jquery and post it using ajax to my page, this's happening alright, and the data is posted, and my php script echos 1 and everything is taken care off, but for...
jquery
[5]
3,694,033
3,694,034
How to i display all in box messages in a list?
<p>i am new to android.</p> <p>i am developing one application related to send and receiving sms.</p> <p>i want to display all receiving sms in a list.</p> <p>if any one know please help me</p> <p>thanks in advance.</p>
android
[4]
4,024,511
4,024,512
Android Socket event when other side closes?
<p>I'm writing software for an Android device that's used as a remote control for an industrial process run by a program on a PC. The PC is always listening and the Android device opens the connection to the PC using the Android Socket class. After that happens it can send commands or request data. (so I guess y...
android
[4]
2,733,088
2,733,089
Clickable layout
<p>I have a clickable linear layout that I've generated programmaticly, and I want it to turn green when it is pressed to indicate that it is clickable, like a button would. How would I go about doing this?</p>
android
[4]