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
100,118
100,119
How to initialize anonymous inner class in Java
<p>is there any way to initialize anonymous inner class in Java? For example:</p> <pre><code>new AbstractAction() { actionPerformed(ActionEvent event) { ... } } </code></pre> <p>Is there any way to use for example putValue method somewhere in the class declaration?</p> <p>Thank you for help.</p>
java
[1]
4,355,337
4,355,338
jQuery: this random selector is rather predictable
<p>In this fiddle <a href="http://jsfiddle.net/SySRb/40/" rel="nofollow">http://jsfiddle.net/SySRb/40/</a>, I created an array with two elements, #f-ONE and #ONE. There is a function that, when the "start" box is clicked, selects one of the two elements randomly, and, depending on which is chosen, displays either a yel...
jquery
[5]
3,112,110
3,112,111
C++ array of classes
<p>I working on a game but I have a problem with the initialization of the level. (feld is just field in german)</p> <pre><code>class level{ private: feld spielfeld[10][10]; public: /* other stuff */ void init_feld(); }; void level::init_feld() { for(int i=0;i!=10;i++){ for(int n=0;n!=10;n++){ ...
c++
[6]
5,485,779
5,485,780
A valid signing identity matching this profile could not be found in your keychain
<p>I am able to test my app on my device using the development profile/certficates...</p> <p>In the same way, I have created distribution profile/certicates for my app....</p> <p>But when I try to upload my app to iTunes , it says "Application failed codesign verification"</p> <p>Also in the Organizer, it says "A va...
iphone
[8]
4,963,396
4,963,397
How to apply a function to a collection of elements
<p>Consider I have an array of elements out of which I want to create a new 'iterable' which on every <em>next</em> applies a custom 'transformation'. What's the proper way of doing it under python 2.x?</p> <p>For people familiar with Java, the equivalent is Iterables#transform from google's collections framework.</p>...
python
[7]
1,062,744
1,062,745
Assemble a URL with jQuery
<p>I have a base url,</p> <pre><code>var url = "/example/url/here" </code></pre> <p>and an object</p> <pre><code>var data = {"id": 1, "do": "some action"} </code></pre> <p>and I want to assemble a url with these to items in a similar fashion to how the $.get works, only I just want the url. Any ideas or do I have t...
jquery
[5]
3,501,802
3,501,803
ByteBuffer as static final fields within classes
<p>I have certain values for columns that are frequently required to be stored in DB. Previously, I had been caching those values as <code>static final byte[]</code> class fields but unfortunately <code>byte[]</code> doesnt allow for easier equality comparasions(to check if another byte array elements are just the same...
java
[1]
5,050,345
5,050,346
Properties backing field - What is it good for?
<p>On one hand, I know that the advisable usage of Properties is to have a backing field, like in the following example:</p> <pre><code> private int m_Capacity; public int Capacity { get { return m_Capacity &gt; 0 ? m_Capacity : -666; } set { m_Capacity = value; } } </code></pre> <p>On...
c#
[0]
4,980,884
4,980,885
Opening a previous form when one is closed
<p>First of all, I am a newcomer to C# and programming in general. I've searched pretty thoroughly, but I can only find instances where someone wants to open another form and hide the one that the button was pressed on.</p> <p>In this instance, I'm having issues with my program continuously running when I press the (X...
c#
[0]
4,284,052
4,284,053
how to set bubble images to background of textview in android programatically?
<pre><code>msgList = (ListView)findViewById(R.id.msgList); receivedMessages = new ArrayAdapter&lt;String&gt;(this, R.layout.message); msgList.setAdapter(receivedMessages); msg = (EditText)findViewById(R.id.msg); msg.setOnKeyListener(new OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent even...
android
[4]
4,855,372
4,855,373
Problem with $_POST
<p>This wont work. All the fields are correct etc and I have a db connection.</p> <p>To the problem</p> <p>I use this script to insert a post into the db:</p> <pre><code>&lt;?php if (isset($_POST['msg'])) { $title = mysql_real_escape_string($_POST['title']); $msg = mysql_real_escape_string($_POST['msg']); // koll...
php
[2]
3,438,487
3,438,488
Is there any reason why lVals = [1, 08, 2011] throws an exception?
<p>I have discovered one thing that makes me crazy. If i specify the following list:</p> <pre><code>lVals = [1, 01, 2011] </code></pre> <p>than no any errors will be displayed, and the same will be if i use 02,03,04,05,06,07, but in case i specify second item in list as 08 or 09 i am getting the following exception:<...
python
[7]
4,743,303
4,743,304
TextView , Text is grayed out
<p>Text in the textView seems like it is grayed out. </p> <p>I want so set the text color as when you click textView then It seems in black color as it is enabled.</p>
android
[4]
813,020
813,021
C++ cout fresh array gibberish
<p>When I "cout" an empty array, I get gibberish. Why?</p> <pre><code>int main() { char test[10]; cout &lt;&lt; test; return 0; } </code></pre> <p>...returns some unicode blather. An easy answer I'm sure.</p>
c++
[6]
1,577,729
1,577,730
I want to integrate a map other than google map into an android app
<p>I want to integrate a map other than google map into an android app</p>
android
[4]
2,226,577
2,226,578
Nested Classes Adapter Pattern?
<p>I have a static class <code>Manager</code> it should adapt between two tiers of logic would it be a bad practice to devide functionalitlies by nesting static classes inside it? I have about two dozen diffrent subjects to manage with 2 -3 functions each. and would like to avoid creating 2 dozen classes for this</p> ...
c#
[0]
5,297,820
5,297,821
what does 'this' refer to in Javascript functions
<p>I understand the general idea behind the <code>this</code> keyword but I'm having trouble figuring out what it actually refers to in practice. For example, in both these example exercises, I guessed the wrong number. </p> <p>for question1, I said that the alert would be '5', because it is referring to the this.x ou...
javascript
[3]
5,241,041
5,241,042
simple python connect 4 game. why doesnt this test work?
<p>Everything about this code seems to work perfectly, except the tests for diagonal wins. The tests for vertical and horizontal wins seem to be exactly the same concept, and they work perfectly. </p> <p>The comments should mostly explain it, but the test should basically iterate through the board and check for x's in...
python
[7]
1,845,874
1,845,875
Return filename from path
<p>What did I do wrong here?</p> <p>call</p> <pre><code>printf(filename(exename)); </code></pre> <p>my function should return filename</p> <pre><code>const char* filename(const string&amp; str) { const char* path; size_t found; found=str.find_last_of("/\\"); path = (str.substr(found+1)).c_str(); cout &lt...
c++
[6]
5,172,531
5,172,532
Syncing between Mac OS X and iPhone
<p>Is there any progress made in this area since this post in 2008? </p> <p><a href="http://stackoverflow.com/questions/185673/how-do-i-sync-application-data-between-an-iphone-and-another-computer">http://stackoverflow.com/questions/185673/how-do-i-sync-application-data-between-an-iphone-and-another-computer</a></p>
iphone
[8]
2,805,406
2,805,407
How to see pushed images to sd card in emulator
<p>I create an emulator with 2000MB SD Card size and push files to it as you can see in image but i can't see these image files in gallery application in emulator. how can i see the images in gallery application? link of file to see my emulator and files that pushed to it!<br> <a href="http://up98.org/upload/server1/01...
android
[4]
1,764,901
1,764,902
Scrollable Canvas or surfaceview
<p>I want to create an application, wherein users can create a design on canvas with bitmaps and lines on it, but i want it to be scrollable i.e. my canvas should be larger than the screen size. I am using sufaceview and using canvas on it. But i have trouble having making it scrollable, what shold be my approach 1) ma...
android
[4]
2,778,254
2,778,255
Android fingerpaint canvas color
<p>I'm messing about with Fingerpaint.java in the SDK <a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html" rel="nofollow">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html</a></p> <p>I've ma...
android
[4]
4,211,149
4,211,150
Error While Calling Activity from Service
<p>i have written this code of service class for calling the activity from the service..but it not works.....please help me.......</p> <pre><code>public class MyService extends Service { private static final String TAG = "MyService"; MediaPlayer player; Uri u1 ; @Override public IBinder onBind(Intent intent) { re...
android
[4]
1,402,871
1,402,872
How to get URL for application's document directory iPhone
<p>This code is a part of Core Data. The URLsForDirectory....method does not run on iOS &lt; 4 so I need to know some other methods/objects to call. I would also appriciate documentation for future reference. Thank you</p> <pre><code>/** Returns the URL to the application's Documents directory. */ - (NSURL *)applicat...
iphone
[8]
2,021,635
2,021,636
Python: Convert list of ints to one number?
<p>I have a list of integers that I would like to convert to one number like:</p> <pre><code>numList = [1,2,3] num = magic(numList) print num, type(num) &gt;&gt;&gt; 123, &lt;type 'int'&gt; </code></pre> <p>What is the best way to implement the <i>magic</i> function?</p> <p>Thanks for your help.</p> <p><b>EDIT</b>...
python
[7]
5,902,635
5,902,636
Count exact number of charaters in a string in java
<p>I have a string of names where all the different names are seperated by the same character (#) e.g. tom#will#robert#</p> <p>I want to be able to count the number of names by counting the number of times that # appears, How would i go about doing this?</p>
java
[1]
1,078,962
1,078,963
Capitalize words in string
<p>What is the best approach to capitalize words in a string?</p>
javascript
[3]
1,611,767
1,611,768
C#|Start Remote Desktop as a Process + Put text in the textbox
<p>well, the title of this qustions is abit stupid, but i will expline it very very simple. </p> <p>in my code, i am strating a remote deskop.exe </p> <p>like this:</p> <pre><code>Process rtc; rtc = Process.Start(@"C:\Windows\System32\mstsc.exe"); </code></pre> <p>now, the thing is. when the remote deskop comes...
c#
[0]
268,309
268,310
How does an ASP.NET session expire when the browser is closed?
<p>As in the title, I wonder how a session expires when the client's browser is closed?</p>
asp.net
[9]
1,388,846
1,388,847
If else difference
<p>Is there any difference between the below statements:</p> <pre><code> Object value = null; if(value == null) { } else if(value instanceof Long) { } </code></pre> <p>vs</p> <pre><code> Object value = null; if(isNotEmpty(value)) { } else { } public boolean isNotEmpty(Object obj) { if(obj != null &a...
java
[1]
5,871,324
5,871,325
Detect if an android app is running on background
<p>I want to check if my app is running on a background mode.</p> <p>The problem is that i have many activities(list activities, map activities etc.). Initially I have tried in the life cycle's resume and pause(or the <code>onUserLeaveHint</code>) methods to set a static boolean as true or false and work with this way...
android
[4]
2,899,342
2,899,343
Checking if image does exists using javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3381663/check-if-image-exists-with-given-url-using-jquery">Check if image exists with given url using jquery</a><br> <a href="http://stackoverflow.com/questions/5678899/change-image-source-if-file-exists">Change i...
javascript
[3]
2,715,902
2,715,903
Accessing secure websites via App
<p>If my app provides a link to a secure website eg a booking system that uses https etc, then are the user's credit card and password details secure in this case ie are the card and password details encrypted when being sent from the mobile phone ? Also do you need the permssion of the website owner to incorporate suc...
android
[4]
871,675
871,676
fetching from DB and store them in a new array PHP
<p>I am fetching data from my DB and they look like this:</p> <pre><code>[{"0":"1","key-1":"1","1":"1","key-2":"1","2":"1","key-3":"1","3":"1","key-4":"1"}] </code></pre> <p>where the key-1 are the name of the column. (I only have one entry so).</p> <p>I want to extract only the column values and save them into a n...
php
[2]
3,336,010
3,336,011
C#: Detecting which application has focus
<p>I'm looking to create a C# application that changes content according to which application currently has focus. So if the user is using Firefox, my app would know that. Same for Chrome, Visual Studio, TweetDeck etc.</p> <p>Is this possible, and if so - how would I go about achieving it?</p> <p>I have a feeling I'm...
c#
[0]
2,385,355
2,385,356
JavaScript, innerHTML not being recognised by javascript
<p>I have the following code for my website:-</p> <pre><code>function HCreateWindow(top,left,width,height,zindex,parent) { var handle = Math.floor(Math.random()*10000000000); if(parent==null) { document.write("&lt;div id=\"HWINDOW" + handle + "\"style=\"top: " + top + "px; left: " + left + "px;width: " + width + "px;...
javascript
[3]
1,866,852
1,866,853
soap.wsdl_cache_enabled
<p>I want to set value of <strong>soap.wsdl_cache_enabled</strong> = <strong>0</strong> in php.ini, but do not get any option in ini. How to change it ?</p> <p>I have a wordpress plugin which gets data form a webservice, I have deleted the wsdl file but it is working, is it taking from cache?</p>
php
[2]
1,863,763
1,863,764
core java programming issues
<p>(a) There is a student class which contains name field(String) and id(String) it has no default constructor. however, it has a parameterized constructor, taking two Strings as an argument to supply value to those feilds.</p> <p>(b) it has a non static inner class name mark which contains fields cgpa(float) and sgp...
java
[1]
4,382,249
4,382,250
In C#, can you make a windows form application start as a service?
<p>I have a GUI C# Windows form program that I would like to start as a service when the computer starts and perhaps have an icon in the system tray that when clicked maximizes the program. Is this possible without major rework?</p> <p>Thanks</p>
c#
[0]
1,837,843
1,837,844
How to adjust position of textLabel, detailTextLabel and switch in tableview?
<p>I have textLabel, detailTextLabel, UISwitch in tableview cell. I want to adjust y position of them. How can I do that? I already adjusted height of cell.</p> <pre><code>UISwitch *switchView = [[UISwitch alloc] initWithFrame:CGRectMake(200, 10, 50, 30); cell.accessoryView = switchView; </code></pre> <p>Above code d...
iphone
[8]
581,346
581,347
Show multiple RoutePaths from same GeoPoint in Android
<p>I wanted to show two Route Paths from same GeoPoint means from A-B and A-C.<br/><br/> Route1 contains GeoPoints from A-B and Route2 contains GeoPoints from A-C. Please help me.</p>
android
[4]
2,057,232
2,057,233
the import android could not be resolved
<p>I opened a project that I had not opened in a while in Eclipse today. I was unable to compile due to some (inexplicable) errors.</p> <pre><code>import android.app.Activity; import android.os.Bundle; import android.view.animation.AnimationUtils; import android.widget.ImageView; import android.view.animation.Animatio...
android
[4]
5,465,348
5,465,349
How to convert "do-some-stuff" to lower camel-case "doSomeStuff" in the most neatful way?
<p>How to convert <code>"do-some-stuff"</code> to lower camel-case <code>"doSomeStuff"</code> in the most neatful way in Java?</p>
java
[1]
2,197,803
2,197,804
Piping popen stderr and stdout
<p>I want to call scripts from a directory (they are executable shell scripts) via python.</p> <p>so far so good: </p> <pre><code> for script in sorted(os.listdir(initdir), reverse=reverse): if script.endswith('.*~') or script == 'README': continue if os.access(script, os.X_OK): ...
python
[7]
3,712,292
3,712,293
Jquery element replace problem
<p>First I'm not sure this is the place to ask this question if not please direct it to its proper place. </p> <p>The problem I am having is that I can get the first click function to work and have the html element change but I can't get the second click function to work and have the element change back. I was wonderi...
jquery
[5]
4,610,717
4,610,718
Displaying the Length of Individual Sequences in File
<p>I have a file that contains two sequences. I have a program that could read all sequences, combine them together, and display the length of both sequences together. Now I want to display the length individually. The two sequences are separated by the symbol <code>&gt;</code>.</p> <p>Example:</p> <pre><code>SEQ1 &...
python
[7]
5,037,568
5,037,569
virtual methods
<p>if i have a class named <code>"Parent"</code> for example. he has a method named <code>"Print".</code> the class <code>"Kid"</code> is derived, it has a method named <code>"Print"</code>, but a new one.</p> <pre><code>new public void Print; </code></pre> <p>Let's create an object:</p> <pre><code>Parent p = new Ki...
c#
[0]
313,593
313,594
How to write an IF else statement without 'else'
<p>I can't use <code>else</code> in my script; how can I implement an <code>if else</code> statement without using <code>else</code>?</p> <p>I'm trying to resize a div:</p> <pre><code>function hideTable(){ var table = document.getElementById('PDemo'); if(table.style.width == "50%") table.style.width = "150px"...
javascript
[3]
5,598,254
5,598,255
jquery.ui-min.js conflicts with ui.core.js on draggable()
<p>Am using jquery-1.3.2.min.js, jquery.colorbox.js, jquery-ui.min.js, ui.core.js, ui.tabs.js, jquery.accordion.js, jquery.BubblePopup.js, ....etc in my projects.</p> <p>I need to drag and drop jquery colorbox popup window. I am using jquery.ui-min.js draggable() function. Error comes on calling error console</p> <bl...
jquery
[5]
255,826
255,827
What is the difference between a static variable and a dynamic variable in java/oops?
<p>please some1 tell me the difference between a 'static variable' and a 'dynamic variable' in oops or in java. Also their usage if possible.</p>
java
[1]
925,338
925,339
jQuery Hover over image problem
<p>I have a script: see fiddle <a href="http://jsfiddle.net/patrioticcow/ERTWT/" rel="nofollow">http://jsfiddle.net/patrioticcow/ERTWT/</a> . When i hover over image a black div slides down. What i want it to be able to click on that div and do something. Right now if i hover over the black div the animation goes crazy...
jquery
[5]
3,071,034
3,071,035
String.trim() returning false for same referenced object
<p>Why is this <strong>false</strong>?</p> <pre><code>String str1 = new String("Java "); String str2 = str1; System.out.println(str1.trim()==str2.trim()); //false </code></pre> <p>Initially <code>str2</code> was referencing <code>str1</code> object. So, comparing with == will return true for <code>str1==str2</cod...
java
[1]
495,522
495,523
Display a list of results with numbers in ASP.NET
<p>I have a common problem in an ASP.NET web form. I'm just surprised that I haven't found a common solution :)</p> <p>I have a list of results being returned from a SQL Server database. I want to show those results in my web page with number to the left of them. For instance, my result set may look like the following...
asp.net
[9]
3,040,491
3,040,492
how to pass parameters through soap header in java
<p>how to pass parameters through soap header in java </p>
java
[1]
4,816,887
4,816,888
Display image based on combobox value on same page
<p>How to display a image depends on the value selected in the combo box and image is to display in the same page near to the combo box... Thanks in advance...</p>
javascript
[3]
2,439,754
2,439,755
Get File Name without path using WindowAPICodePack's commonOpenFileDialog
<p>When using the Windows API Code Pack's <code>CommonOpenFileDialog</code>, how do you retrieve the <code>filename</code> of a <code>file</code> (such as <code>mydoc.text</code>) without getting the path information?</p>
c#
[0]
4,401,981
4,401,982
Cpp Variable/Structure to store 128-bit data
<p>I need some variable/struct to store 32hex number or 128-bit number in an STL container. Do you have any suggestion for me ?</p>
c++
[6]
5,547,764
5,547,765
Next UIView is not being shown when row is selected
<p>my next View is not displayed &amp; in that i use imageview &amp; scrollview. My code look like this</p> <pre><code>-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { VolunteerPhotoDetail *volunteerPhotoDetail = [[VolunteerPhotoDetail alloc]initWithNibName:@"VolunteerP...
iphone
[8]
2,713,414
2,713,415
C++ Linking release built library with my debug build
<p>I've downloaded a 3rd party library, and built the .lib file in 'release' mode. After adding the lib to my project, if i run my project in release mode, it's fine. But if i run my project in debug mode, i get an error:</p> <pre><code>_iterator_debug_level value '0' doesn't match value '2; </code></pre> <p>I could ...
c++
[6]
1,846,830
1,846,831
Python lib to make nice command line scripts with options etc
<p>I remember coming reading about a python module/lib that helped make nice command line scripts that takes in options.</p> <p>My python script (1 file) does many things, and currently I comment out/uncomment the function I want run in my <strong>main</strong> section.</p> <p>I was hoping someone knows the lib I'm t...
python
[7]
4,821,325
4,821,326
nivo slider pause on last slide
<p>Client has 5 sliders that will switch over at random times, but pause for two or three seconds when the last one has changed over. There are only 2 images per "slider"</p> <p>I figured I would use nivo slider as it looked promising.</p> <p>I have set up the different divs and sizing for each slider and got positio...
jquery
[5]
3,190,391
3,190,392
Null-Pointer by findViewById
<p>I have in my onCreate-Method a lot of findViewById. Some of them are parameter for objects I make in the onCreate-Method. Now I tried to make the findViewById-call in the Constructor of my Objects but i get a Null-Pointer. How do I get these findViewByIds in my Object?</p>
android
[4]
4,819,974
4,819,975
onDestroy method not exist in receiver. What is alternative?
<p>I am using a <code>Service</code> and I dynamically register a receiver like</p> <pre><code>private BroadcastReceiver yourCallReceiver; yourCallReceiver = new CallReceiver(); // Registers the receiver so that your service will listen for broadcasts registerReceiver(yourCallReceiver, theCallFilter)...
android
[4]
3,950,976
3,950,977
Android Redrawing an image to new position when the screen is touched
<p>I am trying to write a small android app that redraws an image everytime the screen is touched.</p> <p>I expected the image to be redrawn to the new <code>x,y</code> coordinates provided by <code>event.getX()</code> and <code>event.getY()</code> when I override the <code>onTouch(Event)</code> method in an activity....
android
[4]
3,383,029
3,383,030
javascript form validation suddenly stops working
<p>in my code i called a javascript function onsubmit of a form and inside the function making validation to my fields by using formname.fieldname.value and it works fine but suddenly it doesn't work display me an error "formname is not defined".</p> <p>Thanks in advance </p>
javascript
[3]
2,529,464
2,529,465
C# List All Permutation
<p>I have a problem.I developed a program with Apriori Algorithm.In Apriori Algorithm,I must take permutation values.For This</p> <pre><code>foreach (String s1 in array1) { foreach (String s2 in array2) { String result = s1 + " " + s2 + " " + s3; //Processing } } </code></pre> <p>I coding something...
c#
[0]
283,560
283,561
Is this a bug in PHP?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4750781/php-array-behaving-strangely-with-key-value-07-08">php array behaving strangely with key value 07 &amp; 08</a> </p> </blockquote> <p>I've found something weird in PHP, if I use numeric arrays the 8th arr...
php
[2]
3,811,734
3,811,735
Android: How to resume an App from a Notification?
<p>I am trying to program my notification to RESUME my app, instead of simply starting a new instance of my app... I am basically looking for it to do the same thing as when the Home button is long-pressed and the app is resumed from there.</p> <p>Here is what I am currently doing:</p> <pre><code>void notifyme(String...
android
[4]
436,668
436,669
Get selected text with format using javascript
<p>Basically, I want style of selected text. Suppose, I have a full text "Hello world to sample application" placed in div. Then I made a word "Hello" in bold. I want to retrieve style of word "Hello" word and not of whole div. There is one method "getCommandValue" method available but not working with Firefox. "getCo...
javascript
[3]
4,695,403
4,695,404
How to pass a dymamic array of strings pointers from C++ to a C function
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7048888/stdvectorstdstring-to-char-array">std::vector&lt;std::string&gt; to char* array</a> </p> </blockquote> <p>I have to call a c function that accepts an array of string pointers. Example</p> <pre><code>voi...
c++
[6]
807,623
807,624
Handling the different results from parsedatetime
<p>I'm trying to learn python after spending the last 15 or so years working only in Perl and only occasionally.</p> <p>I can't understand how to handle the two different kinds of results from the parse method of Calendar.parse() from parsedatetime</p> <p>Given this script:</p> <pre><code>#!/usr/bin/python import p...
python
[7]
3,963,878
3,963,879
change column header in JTable if i know column position
<p>Can i change column header in Jtable tab from "Name" to "Surname" if i know column position? I want to change column name in second or first tab, not last one.</p> <p>with this code i can change only culumn header in last tab. i have 4 tabs.</p> <pre><code>JTableHeader th = table.getTableHeader(); TableColumnModel...
java
[1]
5,498,336
5,498,337
Error function routine
<p>Pls what is the best approach considering (performance, security etc.) to implement an error function. Something in the line of ..</p> <pre><code>function trap_errors($error_code, $parametrs...) { $error_code = array =&gt; ('1001 = Error description1', '1002 = Error description2',..etc. ) } </code></pre> <p>I do...
php
[2]
5,504,066
5,504,067
Testing when an UIImage background color has changed
<p>I have a student working on a project where he has a UIImage where he is able to draw a line on the screen. We want to know if you have any idea if he goes back and forth filling the entire screen with lines is there a way to test that every pixel has been covered with the line color? For example if the background i...
iphone
[8]
1,975,975
1,975,976
from elements in a line to key and values
<p>I have a file with lines like this:</p> <pre><code>no.3 normal yes 54 0,543 12 </code></pre> <p>And I should end up with <code>("normal", yes, 54, 0.543, 12)</code> when I <code>print info(no.3)</code></p> <p>I have started by splitting up in lines. But now I'm not sure what to do?</p> <p>As I can see...
python
[7]
806,131
806,132
UIViewController Release in iphone
<p>I am Using 5 pages in my project.. Here i can navigate pages 1 to 5 one by one using presentModelViewController.. How to release in between pages such as 2,3,4 when i navigate from page 5 to page 1.. </p> <p>Thanks..</p>
iphone
[8]
3,015,674
3,015,675
How do we prevent default actions in JavaScript?
<p>What is the cross-browser method? I need to prevent any default action on an image, so that neither dragging nor anything else will fire on a default bases.</p>
javascript
[3]
5,262,401
5,262,402
converting web page scraper from python 2 to python 3
<p>I've a python 2 script to scrape data from a reddit thread, but I've currently got python 3 installed.</p> <p>I've no python knowledge, but have googled that the (initial?) problem is urllib2.</p> <p>Would this be easy to convert to python 3, or would it be better to install python 2?</p> <p>Code here:</p> <pre>...
python
[7]
3,798,151
3,798,152
Python os.getcwd paths
<p>I'm using os.listdir() to get all the files from a directory and dump them out to a txt file. I'm going to use the txt file to import into access to generate hyperlinks. The problem I'm having is getting the correct path. So when the script is ran it uses whatever directory you are in. Here is an example. Right now ...
python
[7]
373,563
373,564
How can I select all elements without a given class in jQuery?
<p>Given the following:</p> <pre><code>&lt;ul id="list"&gt; &lt;li&gt;Item 1&lt;/li&gt; &lt;li class="active"&gt;Item 2&lt;/li&gt; &lt;li&gt;Item 3&lt;/li&gt; &lt;li&gt;Item 4&lt;/li&gt; &lt;li&gt;Item 5&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>How can I select all but Item 2, AKA something like:</...
jquery
[5]
5,895,695
5,895,696
ColorTranslator.ToHtml() return string issue
<p>I need hexadecimal string of color so I am using ColorTranslator.ToHtml() property which returns string hex of Color.</p> <p>if I choose a random color it returns "#FFF0B6" etc. However, if I choose a system-defined color for example Color.Black it returns "Black" in string.</p> <p>I need hexadecimal color codes i...
c#
[0]
3,337,267
3,337,268
Using an Android Long-Button press to increment/decrement counter
<p>I want to be able to press a button on my program and hold it down (without releasing) to increment a variable. Problem I am having right now is when I conduct the long button press it only runs once, until I release and press again. </p> <p>First I want to find out if there is a way to do this without having to u...
android
[4]
5,546,552
5,546,553
How do I make a menu that does not require the user to press [enter] to make a selection?
<p>I've got a menu in Python. That part was easy. I'm using <code>raw_input()</code> to get the selection from the user. </p> <p>The problem is that <code>raw_input</code> (and input) require the user to press Enter after they make a selection. Is there any way to make the program act immediately upon a keystroke? Her...
python
[7]
304,891
304,892
C# catch control's change event from its container
<p>In my project I have a settings form. Where if any changes happen I have to notify user about it if he wants to leave that page without saving his changes. At this time I am doing this by catching every control change event. I am sure there is a better way - like catching the change event from its container. Is it p...
c#
[0]
383,508
383,509
c# how to get the row number from a datatable
<p>i am looping through every row in a datatable:</p> <pre><code>foreach (DataRow row in dt.Rows) {} </code></pre> <p>i would like to get the index of the current row within the dt datatable. for example:</p> <pre><code>int index = dt.Rows[current row number] </code></pre> <p>how do i do this?</p>
c#
[0]
2,412,074
2,412,075
Reading text files in c++
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c">LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt after installing VS2012 release preview</...
c++
[6]
1,930,485
1,930,486
httpClient doesn't retry the request
<p>I'm using the spring android rest template 1.0.0.M2 version, I need to set the request time out and the retry attempt. I did it in following way.</p> <pre><code>//Time out httpComponentsClientHttpRequestFactory.setReadTimeout(5000); restTemplate.setRequestFactory(httpComponentsClientHttpRequestFactory); //se...
android
[4]
850,324
850,325
Clearing Input Fields with JavaScript
<p>I've been looking at this for the last few hours, and can't really achieve what I'm looking for. I currently have the following two inputs:</p> <pre><code>&lt;input type="text" id="username" value="USERNAME" onfocus="inputFocused(this)" onblur="inputBlurred(this)" /&gt; &lt;input type="password" id="password" value...
javascript
[3]
346,669
346,670
Efficient in Java strings
<p>This sentences are equals <code>myString != null</code>, <code>myString.length() &gt; 0</code> and <code>! myString.equals("")</code> ? Wich is the most efficient? (Java 1.4)</p>
java
[1]
2,327,155
2,327,156
I am not able show another controller using presentModalViewController:
<p>Please see the code</p> <pre><code> -(IBAction)startGame{ NSLog(@"Button is pressed"); CharadesAppDelegate *del=(CharadesAppDelegate*)[[UIApplication sharedApplication]delegate]; [del setAllTeams:teamDict]; [del setScore:selectedScroll]; Playing *p=[[Playing alloc]init]; [self presentModalViewController:p a...
iphone
[8]
2,479,725
2,479,726
code how to make an external authentication with gmail account android
<p>I am developing an application where I have an initial login. I want the user to access my app through her gmail account. </p> <p>Can someone help me with some code or tutorial? I don't quite understand the documentation from google...</p>
android
[4]
5,946,302
5,946,303
Convert Textbox Text to Date while text changing
<p>What I want is when user input text in textbox in normal way, text change to date format. for example when user are entering 20110110 text change to 2011/01/10 </p>
c#
[0]
137,254
137,255
iPhone App Development - Audio Queue Recording
<p>I am currently working on an App which needs to get some data from the microphone. I have read through some resources on the Internet and believe that Audio Queue is a good library to do it.</p> <p>I only need to get an array which stores the microphone input data, and do not need to play it back.</p> <p>Can anyon...
iphone
[8]
3,788,411
3,788,412
How to manipulate Android classes
<p>New to Android. Trying to find docs that show what Android classes expect to elicit changes. For example, to make a keyboard always visible, I could find some info searching Google, but not directly in the docs of the SDK. Is there a source for more comprehensive docs on how Android works not just from the individ...
android
[4]
3,118,620
3,118,621
Hiding and showing groups of elements
<p>I have a page where all items of class 'div_title_item' are initially hidden. Base on some paginator logic I would then like to show some of them.</p> <pre><code>// initially $(".div_title_item").hide(); // this works fine </code></pre> <p>Now the showing part. I tried below but it didn't work.</p> <pre><code>// ...
jquery
[5]
3,649,345
3,649,346
white space allowed as part of file path?
<p>My question is kinda related to <a href="http://stackoverflow.com/questions/5365780/android-asset-not-working-on-honeycomb">android_asset not working on Honeycomb?</a></p> <p>Is it allowed to have spaces in the file path name of an html page located in the assets folder?</p> <p>For ex: Is the following legal?</p> ...
android
[4]
689,390
689,391
php address request
<p>i have this request method:</p> <pre><code>if (!$_REQUEST['0']) { echo "Address missing..."; die(); } else { code code etc. } </code></pre> <p>And address is: <a href="http://localhost/api.php?0=" rel="nofollow">http://localhost/api.php?0=</a><em>address</em></p> <p>If I open: <code>api.php?0=0</...
php
[2]
1,267,055
1,267,056
Install icons from android asset studio
<p>I need to install tab icons from Android asset studio. The downloaded zip contains a res folder with another folders: drawable, drawable-hdpi, etc. I've copied the files from the res/drawable in the downloaded zip, into the res/drawable folder and I've done the same with hdpi, ldpi and mdpi.</p> <p>Then I used the ...
android
[4]
1,134,413
1,134,414
UIScrollView landscape problems
<p>I'm playing around with the page control sample code.</p> <p>I changed the code to start the app in landscape, the app opened in the simulator but the app was still in portrait mode in a horizontal simulator.</p> <p>I then put the following code into the PhoneContentController.m file and the MyViewController.m fil...
iphone
[8]