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
4,954,264
4,954,265
PHP system specific line endings behaviour
<p>I was wondering what does it mean in layman's terms:</p> <blockquote> <p>pay attention to line endings - PHP uses a native function to parse the input, so a Mac file won't work on Unix</p> </blockquote> <p>An example of what this means will help.</p> <p>The text can be found here at <a href="http://php.net/get_...
php
[2]
4,011,166
4,011,167
Building an Exception in C#
<p>I have inherited a code-base which uses a compiled logging library. I cannot update the logging library. This library has method that logs details for an Exception. The method takes a single Exception as a parameter. I'm now building a mobile application that will tie into this system. </p> <p>In this mobile applic...
c#
[0]
3,525,253
3,525,254
SyntaxError: Non-ASCII character '\xa3' in file when function returns '£'
<p>Hi I'm trying understand why I'm getting this error.</p> <p>Say I have a function:</p> <pre><code>def NewFunction(): return '£' </code></pre> <p>I want to print some stuff with a pound sign in front of it and it prints an error when I try to run this program, this error message is displayed:</p> <pre class="...
python
[7]
3,631,596
3,631,597
check for null variables
<p>I have multiple variables which I set prior to creating an object, I want to check if any of those variables in null, if any variable then display an error. Is there a way to incorporate this in a foreach loop?</p> <p>For eg.</p> <pre><code>Var Var1 = blah1; Var Var2 = blah2; Var Var3 = blah3; Var Var4 = blah4; Va...
c#
[0]
4,635,139
4,635,140
Android ViewPagerIndicator with pictures
<p>I need to do something like ViewPagerIndicator, just so I can move something like the pictures in this application:</p> <p><a href="http://i46.tinypic.com/dfxhfq.png" rel="nofollow">http://i46.tinypic.com/dfxhfq.png</a></p> <p>Please some tips.</p>
android
[4]
3,851,726
3,851,727
How do you divide each element in a list by an int?
<p>I just want to divide each element in a list by an int.</p> <pre><code>myList = [10,20,30,40,50,60,70,80,90] myInt = 10 newList = myList/myInt </code></pre> <p>This is the error:</p> <pre><code>TypeError: unsupported operand type(s) for /: 'list' and 'int' </code></pre> <p>I understand why i am receiving this er...
python
[7]
1,293,856
1,293,857
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]
2,394,398
2,394,399
Self inflating ListView
<p>I've got a listview and it's adapter, which accepts a list of object data. Is it possible to extend the adapter or the listview itself to start track position, namely implement OnScrollListener. So far I've tried implementing adapter as OnScrollListener and extentding ListView with further implementation as OnScroll...
android
[4]
3,407,245
3,407,246
Error converting replicasisland from SVN in Eclipse to an Android Project
<p>I have been trying this for hours without success.</p> <p><a href="http://replicaisland.googlecode.com/svn/trunk/" rel="nofollow">http://replicaisland.googlecode.com/svn/trunk/</a></p> <p>I have added the repository and successfully downloaded the project into the workspace using the option "check out as a project...
android
[4]
487,761
487,762
Jquery how do I add +1 to a number in a table
<p>So I am generating a table with php/mysql, and in this table are numbers in rows. I have a button that when clicked, adds +1 to this number value <strong>in the MySQL database</strong>. The problem is, I have to refresh the page for the new number to show up in the table.</p> <p>I am attempting to show the new numb...
jquery
[5]
3,497,649
3,497,650
include files in a method?
<p>i want to have a class that includes all files for me.</p> <p>eg.</p> <pre><code>Loader::loadZend // loads all zend libraries Loader::loadSymfony // loads all symfony components </code></pre> <p>if i include a file in a method, does this become globally available?</p> <p>it seems that it doesnt work.</p> <p>may...
php
[2]
4,412,610
4,412,611
How to pass object to a function in this scenario
<p>I have the following piece of code:</p> <pre><code> NameX.functionA(functionB(Dictionary["___"])) </code></pre> <p>Instead of <em>_</em> I would like to make a reference to NameX in the form of a string, so that the program interprets it as </p> <pre><code> NameX.functionA(functionB(Dictionary["NameX"])) </code><...
python
[7]
1,440,731
1,440,732
How to store a ratio in a single variable and read it back in C#
<p>Let's say I have a system that must store how many people voted on fighter A and how many on fighter B.</p> <p>Let's say ratio is 200:1</p> <p>How can I store that value in a single variable, instead of storing both values (number of voters on A and number of voters on B) in two variables. </p> <p>How you would d...
c#
[0]
5,568,490
5,568,491
Get keyCharValue with KeyCode and Modifiers
<p>I use the library <a href="http://code.google.com/p/jnativehook/" rel="nofollow">JNativeHook</a> which allows to listen to every event from my keyboard.</p> <p>It sends events <a href="http://code.google.com/p/jnativehook/source/browse/trunk/src/org/jnativehook/keyboard/NativeKeyEvent.java?spec=svn214&amp;r=214" re...
java
[1]
2,749,724
2,749,725
Dynamic table link to new page
<p>I have a dynamic table that populates using a mysql database. I have rows including the column titles 'bottle name', 'cost', 'size'. They are displayed in the browser using PHP and html.</p> <p>One of the columns in the sql database is 'description'. I have been set the task of creating a link from bottle name that...
php
[2]
5,278,291
5,278,292
jQuery - How to hide an element that is not contain the specific class
<p>Suppose I have the html code below, I want to ONLY display the "p" element with class="go-1", it is not good to write the statement to hide the element with class="2", class="3", class="100"... how can I write it in a smart way?</p> <p>The statement can be say as "if "p" class not equal to "go-1" then hide it"<br /...
jquery
[5]
3,713,343
3,713,344
Javascript equivalent of php mktime
<p>Iam using mktime() function in php to get the seconds for given year,month,date and minutes as like</p> <pre><code>$seconds = mktime($hour,$minute,$month,$day,$year); </code></pre> <p>but I want to use the same in javascript...can anyone suggest me the way to use its equivalent function in javascript that takes ab...
javascript
[3]
4,189,965
4,189,966
How to change with jQuery a data attribute of a set of elements?
<p>say I have a set of elements $elements. Say they all have a data attr named "amount". First one has data-amount = 1, second 2 and so on. Whats the simplest way to increment in x that value for all of them. y solution is</p> <pre><code>$elements.each(function(){ $(this).data('amount',$(this).data('amount')+=x); ...
jquery
[5]
5,331,990
5,331,991
How to eliminate the '\n' at the end of a txt file
<p>I'd like to eliminate the extra '\n' at the end of a txt file. Which function can be used to do this job in c / c++.</p> <p>Thanks advanced</p>
c++
[6]
322,573
322,574
In Symfony Form class get the value of submitted fields
<p>In symfony how I will get the value of $_REQUEST in a form class. I am getting the value of all form fields in <strong>action.class.php</strong> and templates. While submitting a form and it is validating I need to get the value of some form field. Please help me!</p>
php
[2]
271,665
271,666
Need to find whether checkbox in listview is checked or not
<p>I have created listview using layoutinflator. Listview contains checkbox and textview for each row. I am displaying items in a listview with checkbox checked by default.I can check\uncheck these items. </p> <p>Now on the same layout I have one button and under clickevent of this button I want to check which item ha...
android
[4]
4,729,218
4,729,219
How to use javascript to swap images with option change?
<p>Hi everyone I need to make javascript code to swap images with option change. Here is the code:</p> <pre><code>&lt;select name="Color:"onchange="document.getElementById('myimage').src = this.value; "&gt; &lt;option value="images/taylormade_purelite_standbag_bk.jpg"&gt;Black/White&lt;/option&gt; &lt;option value="i...
javascript
[3]
225,339
225,340
Intercept an HTTP request at browser end to alter some html content
<p>I would like to do as follows. What would be the best way? A general answer will also be fine.</p> <p>I would like to intercept an HTTP request at the client end to alter some html content. For example, I go to CNN.com and rather than an article that's displaying "Two LA Dogs marry", it should say "Ridiculous titl...
c#
[0]
2,642,354
2,642,355
reloadData in tableView makes performance slow
<p>I'm working on the table view and im facing a problem such that my table is slowing down to display a data. What I have coded is</p> <pre><code>-(void) loadView { getDataForTableView(); } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of row...
iphone
[8]
2,212,859
2,212,860
Trigger change event <select> using jquery
<p>is there anyway i could trigger a change event on select box on page load and select a particular option. </p> <p>i was trying to output something like <a href="http://jsfiddle.net/v7QWd/1/" rel="nofollow">this</a> </p> <p>update:</p> <p>i was able to change option by following code.</p> <pre><code>$(&lt;element...
jquery
[5]
728,782
728,783
Save File to a remote Url
<p>first of all sorry for my english , not my main lang.</p> <p>I need to export some data to a remote folder from android. </p> <p>I have a file on android "file.xml" and i need to export it to a folder (under iis) "http://192.168.x.xx/folder/fileuploaded.txt"</p> <p>It seems most of the examples out there are usi...
android
[4]
3,099,142
3,099,143
C# program that replaces even numbers with the word even
<p>I am trying to write a program that replaces even numbers with the word "EVEN". So far, I have:</p> <pre><code>List&lt;int&gt; num = new List&lt;int&gt;(); for (int num1 = 0; num &lt; 101; num++) { num.add(num1) } foreach(int n in num1) { if (n/3) { num.Replace("EVEN") } } </code></pre> <p>Is this cl...
c#
[0]
5,105,210
5,105,211
Production Apply Push Notification Certificate
<p>Is it possible for another Apple developer to push notifications to another application if they know the device token?</p>
iphone
[8]
4,026,706
4,026,707
How do I ask a function for the names of its parameters in Python?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/582056/getting-list-of-parameters-inside-python-function">Getting list of parameters inside python function</a> </p> </blockquote> <p>E.g. supposes I have</p> <pre><code>def foo(a, b='B'): return </code></pre> ...
python
[7]
5,042,705
5,042,706
jQuery how to code it more nicely
<p>How do you make this code shorter, i'm very new to jquery but i managed to build what i wanted, but is there another way to do this e.g more nicely. </p> <p>Thanks! </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $(".genre").click(function () { $(".sobox...
jquery
[5]
3,967,441
3,967,442
#define TRACE(...) doesn't work in C++
<p>I have the following preprocessor divective:</p> <pre><code>#ifndef NDEBUG #define TRACE printf #else #define TRACE(...) #endif </code></pre> <p>and example of usage is:</p> <pre><code>TRACE("TRACE: some parameter = %i\n", param); </code></pre> <p>In C all works perfectly well when I build both debug and release...
c++
[6]
3,473,212
3,473,213
Looping through an image directory
<p>I need to loop through a .png image directory and insert the file name in a mysql database.</p> <p>This is what I have so far:</p> <pre><code>mysql_connect('localhost', 'admin', ''); mysql_select_db('database'); // Each file is formated like this $file = 'Abe+Froman+SK_HG.png'; $player_name = urldecode(str_repla...
php
[2]
3,395,236
3,395,237
Auto answering in android
<p>I have to perform a task of creating an Android Application that will pick all the calls, play a pre-recorded voice to the other party and cut the phone. Is it possible?</p> <p>Skeleton code is most welcome.</p>
android
[4]
3,743,492
3,743,493
My php variables are not being printed out.
<pre><code> &lt;?php if ( is_user_logged_in() ) { echo '&lt;a href="/community"&gt;&lt;img id="visit-the-forums" src="&lt;?php bloginfo('template_url') ?&gt;/images/visit-the-forums.png" alt="Check out the Forums!" /&gt;&lt;/a&gt;' } else { echo '&lt;a href="/community"&gt;&lt;img id="join-the-forums...
php
[2]
5,119,657
5,119,658
Types in copy constructor
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1051379/is-there-a-difference-in-c-between-copy-initialization-and-direct-initializati">Is there a difference in C++ between copy initialization and direct initialization?</a> </p> </blockquote> <pre><code>Class...
c++
[6]
3,004,078
3,004,079
JavaScript solution for anagram of a palindrome
<p>I was asked to implement the same question as this in an interview recently:</p> <p><a href="http://stackoverflow.com/questions/8447222/anagram-of-a-palindrome">Anagram of a palindrome</a></p> <p>I could not provide an answer but am interested to know the JavaScript solution.</p>
javascript
[3]
3,475,829
3,475,830
How to attach EventArgs/custom params when you assign a delegate to the event?
<p>I have this code:</p> <pre><code>this.form.Resize += new EventHandler(form_Resize); </code></pre> <p>But I want to assign some objects for later access in the <code>form_Resize</code> event, how can I do that?</p> <p>and do I access the data in the EventArgs?</p>
c#
[0]
351,380
351,381
Printing a value makes the program work?
<pre><code>#include &lt;iostream&gt; #include &lt;cstdio&gt; using namespace std; bool numar(unsigned long long n) { return (n &gt; 99) &amp;&amp; ((n % 100) == 25); } int main() { freopen("numere.in", "r", stdin); freopen("numere.out", "w", stdout); int cnt = 0; unsigned long long n, a, Nblabl...
c++
[6]
4,460,198
4,460,199
Python os.path.walk() method
<p>I'm currently using the <code>walk</code> method in a uni assignment. It's all working fine, but I was hoping that someone could explain something to me. </p> <p>in the example below, what is the <code>a</code> parameter used for on the <code>myvisit</code> method? </p> <pre><code>&gt;&gt;&gt; from os.path import ...
python
[7]
426,513
426,514
Is there any way to get a filename from a full path?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1418193/how-to-get-file-name-from-full-path-with-php">How to get file name from full path with PHP?</a> </p> </blockquote> <p>File Path : </p> <blockquote> <p>users_gallery/2012/August/14-August-2012/8/Sasasa...
php
[2]
5,698,797
5,698,798
Hide Android "voice to Text" Dialog Box
<p>I am working with an Voice to Text Application where I need to keep Voice command Dialog in background, means I don't want to hide it again n again.</p> <p>Pls shows me how can I do this.</p>
android
[4]
2,645,506
2,645,507
Help!!! RegEx.Replace
<p>How do i achieve this directory format using the RegEx.</p> <pre><code>Input FileName(40 chars) : 000a2d0e62e43b0f680a6eb6019f9671b15ca291 output should looks like this: 00\0a2\d0e\62e43 get only the first 13th character. </code></pre> <p>Thanks a lot.</p> <p>johnL</p>
c#
[0]
5,638,527
5,638,528
Whats the best way to bring an already running app to the front in android?
<p>I have two apps that I want to be able to switch between without killing each different activity and without re-launching the activity I want to switch back too. </p> <p>Lets say I have a edittext in each activity and I want the text that is written to stay in that edittext view so that when this activity is brough...
android
[4]
2,752,525
2,752,526
How to create sms backup in android
<p>I am creating a sample of sms backup and creating csv file. It is working fine in Emulator but its is not working on my handset (samsung galaxy Note). Here is the code please suggest how it can be fixed</p> <pre><code>while (curLog.moveToNext()) { Cursor cursor = getContentResolver().query(Uri.parse("co...
android
[4]
4,140,689
4,140,690
compress image while taking an image in android
<p>Hello I am developing a CAMERA APPLICATION. After taking an image the image will be save in sdcard. I want while saving in sdcard the size of the image should be 400kb to 500kb but now its taking more than 1mb. How to compress and save in sdcard after capturing the image.</p> <p>My code is</p> <pre><code> public v...
android
[4]
688,177
688,178
socket programming using bufferedreader
<p>In my application I have 2 programmes, called <code>server.java</code> and <code>client.java</code>, <code>server.java</code> acts as a server and <code>client.java</code> acts as a client. From <code>server.java</code>, I am writing some data to <code>client.java</code>, by using the following code:</p> <pre><code...
java
[1]
5,961,058
5,961,059
random.choice always same
<p>I have a quick question. I'm currently using random.choice() to pick from a list and was wondering why it always calls the same item. It changes once I stop the program and restart it. Could anyone explain to me how the random class works and makes it so it does this?</p> <p>Thanks</p>
python
[7]
2,897,001
2,897,002
How I can make the Menu same this website www.chanel.com by using jquery
<p>Hello I'm new of the jQuery, I found this website <a href="http://www.chanel.com/" rel="nofollow">http://www.chanel.com/</a> and I like them menu so much, Ex when it mouse hover it popup the image and when mouse out image is gone and and see the background, So can I do like this in Jquery by using something like th...
jquery
[5]
4,769,502
4,769,503
is it possible to disable implicit ToString() call?
<p>I'm wondering if there is a way to get a compilation error for this code:</p> <pre><code>var customer = new SomeCustomerClass(); Console.WriteLine("Customer address:" + customer); </code></pre> <p>so I will be forced to write something like this:</p> <pre><code>var customer = new SomeCustomerClass(); Console.Writ...
c#
[0]
69,824
69,825
How enable/disable item in contextmenu
<p>I can disable a item in the contextmenu with this:</p> <pre><code>menu.getItem(1).setEnabled(false); </code></pre> <p>in the onCreateContextMenu, but what if I later would like to set it to true within the same activity? How can I do that during runtime?</p> <p>EDIT: </p> <pre><code> // Create context men...
android
[4]
5,508,356
5,508,357
Checking if a line starts with contents in a list
<p>I have a list that looks like this:</p> <pre><code>List&lt;String&gt; messages = Arrays.asList("//", "/*", "*", "}", "{"); </code></pre> <p>I then read in a file and go through it line by line. I'd like to check to see if the beginning of the line matches any of what's in the list.</p> <p>I was doing it this way...
java
[1]
4,097,613
4,097,614
Plus equals operator to increase value each time
<p>I am sure this is very simple but I can't get seem to get this to work just right. Here is my code:</p> <pre><code>var zero = 10; function some(elem, num) { return elem += num; } console.log(some(zero, 10)); console.log(some(zero, 10)); console.log(some(zero, 10)); </code></pre> <p>From what I understand, I...
javascript
[3]
1,272,685
1,272,686
How to check if post field is from 8 - 20 characters long
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2492926/php-strlen-question">PHP strlen question</a> </p> </blockquote> <p>how to check if text from post field is 8 - 20 characters long? Is it done with strlen, and could you give me some example, please?</p>
php
[2]
4,903,901
4,903,902
Getting nearby locations
<p>I want to get nearby cities from current location depending upon distance, e.g, cities in radius of 100km,200km etc using the gps of iphone. How can i determine these cties as gps only gives the details of the current location.</p> <p>Thanks in advance</p>
iphone
[8]
4,864,426
4,864,427
python 2.7 question
<p>I recently upgraded from python 2.6 to python 2.7 and everytime I try todo "python setup.py install" I get.</p> <pre><code>'python' is not recognized as an internal or external command, operable program or batch file. </code></pre> <p>It worked fine with 2.6.</p>
python
[7]
1,505,371
1,505,372
vbulletin forum automatic reply
<p>I would like to create a php script that automatically reply pre-defined vb forum threads every X hours.</p> <p>any ideas on creation such task?</p> <p>should it use cron jobs or there is a differet work around for it...</p> <p>Thank you</p>
php
[2]
2,514,170
2,514,171
final total method PHP result
<p>I'm currently trying to create a final total method using PHP. So far I keep getting this error for the following code:</p> <p>Notice: Undefined variable: finalTotal</p> <p>The method does work and the final amount is calculated however I am not sure how to define the $finalTotal variable so no errors turn up. Any...
php
[2]
5,017,817
5,017,818
Compile Error CS0305
<p>I'm new to C# programming and have hit a snag I cannot get past.</p> <p>I'm getting this compile error:</p> <blockquote> <p>CS0305: Using the generic type 'System.Collections.Generic.IEnumerable' reuires 1 type arguments</p> </blockquote> <p>with this code;</p> <pre><code>class Program { static voi...
c#
[0]
3,958,490
3,958,491
What does the term "canonical form" or "canonical representation" in Java mean?
<p>I have often heard this term being used, but I have never really understood it.</p> <p>What does it mean, and can anyone give some examples/point me to some links?</p> <p>EDIT: Thanks to everyone for the replies. Can you also tell me how the canonical representation is useful in equals() performance, as stated in ...
java
[1]
4,628,944
4,628,945
please define #define
<p>Could someone give me some examples of how to use #define in c#?</p> <pre><code>#define //preprocessor directive </code></pre> <p>what is the purpose of it? Here example from Microsoft which I still don't get:</p> <pre><code>// preprocessor_if.cs #define DEBUG #define MYTEST using System; public class MyClass { ...
c#
[0]
2,776,850
2,776,851
Any API for Siri
<p>now that we know that the iPhone has speech to text and text to speech capabilities, as demonstrated by Siri, is this going to be an API available to developers? has apple said anything about this?</p>
iphone
[8]
2,966,227
2,966,228
best way to implement a deck for a card game in python
<p>What is the best way to store the cards and suits in python so that I can hold a reference to these values in another variable?</p> <p>For example, if I have a list called hand (cards in players hand), how could I hold values that could refer to the names of suits and values of specific cards, and how would these n...
python
[7]
1,922,084
1,922,085
What does the following Python code do?
<pre><code>tmp = dict(zip(listToAppend, x_test)) # x_test is a data vector imported earlier from a file </code></pre>
python
[7]
2,063,768
2,063,769
Android onHoverEvent and onTouchEvent
<p>I have a class that is extending <code>View</code> and i want to use the stylus (galaxy note) for input as it has hovering capabilities. </p> <p>I have added listeners for both hover and touch events but i have this issue i can not get around nicely: when i touch the screen with the stylus i have a hover event gene...
android
[4]
4,761,000
4,761,001
Music in background
<p>Who do I create an app that plays music in background of a call, audible to only the caller and the listener? Can any body suggest a method for doing it? I had tried to create a music service which is used for creating background service for apps, but it is not fully satisfying my goals. </p> <p>I created a backgro...
android
[4]
5,032,218
5,032,219
parse exception (unparseable date)
<p>I am getting parse exception when i execute the below code.Can anyone please help me out</p> <pre><code>private Boolean validateDateFormat(HttpSession session, PropertiesHandler props, String startDate,Date sqlDate) { logger.info("Enter validate"); Boolean isvalid = true; HashMap hashMap = n...
java
[1]
2,909,196
2,909,197
Modying Properties of a Class
<p>Finding a suitable question title and -tags for this question struck me rather hard.</p> <p>Basically I've built a game wherein several units/mobs will be present. Now I'm interested in building a system, so each unit can have effects/buffs/debuffs applied to them that will modify the properties of the unit. Exampl...
c#
[0]
4,915,739
4,915,740
stream textfile to textbox c#
<p>Suppose i have a textfile which continuous to be updated with text, how can i display the contents in a textbox in windows form (in real-time)?</p> <p>for example. this is the contents of log.txt:</p> <pre><code>connected, bla bla bla disconnected, bla bla bla </code></pre> <p>PS: i want it to be displayed in tex...
c#
[0]
3,076,297
3,076,298
In Java, how to use reflection to get a static method and execute it?
<p>I have a bunch of static method names, how do I execute them. I think I can use reflection, but how to do that?</p>
java
[1]
3,788,928
3,788,929
displaying multiple frames in a php page
<p>I would like to create four frames with google maps in a php page and reload the frames with different set of style attributes on the same map when a particular checkbox is selected on the main page containing the four frames.I need some inputs on how to proceed with this.</p> <p>Thanks in Advance, Deepthi</p>
php
[2]
3,002,397
3,002,398
dismissing the NumberPad keyboard from a UIScrollView
<p>I have an application with UIScrollView added as a subview of UIView. This Scroll view has a textfield with keyboard type set to numberPad. Now the problem is , i want to dismiss the keyboard when i tap anywhere else in the scroll view. how can i do this ... ?</p>
iphone
[8]
748,502
748,503
What is The remote server returned an error: (400) Bad Request?
<p>I am trying to add contacts to the constant contact site n there i am getting following exception The remote server returned an error: (400) Bad Request.</p> <p>i am using ASp.net C# application for inserting my records.</p> <p>can any one tell me the solution ,or why i am getting the above error?</p> <p>Thanks...
asp.net
[9]
1,457,761
1,457,762
Python question on parse routines with dicts, while loops, and assignments
<p>I have some code from a much-maligned Python resource, if you ask SO, but I am trying to divine Python’s parse routine from it, regardless its didactic merits.</p> <pre><code>def princess_lives_here(): #&lt;some messages and conditionals to keep you going in the text-based game&gt; #&lt;one of the condition...
python
[7]
2,787,649
2,787,650
Copying object with const members to a non const object
<p>I have the following data container:</p> <pre><code>struct Node { explicit Node(const std::vector&lt;Data&gt;&amp; _data, const Value&amp; _value): data(_data), value(_value) { } const std::vector&lt;Data&gt; data; const Value value; }; </code></pre> <p>I wish to write a mock along these lines...
c++
[6]
980,612
980,613
Iphone terminal commands
<p>I`m working on school project and I want to use function system(""). For example system("ping www.google.com"). Is this function allowed by Apple ? It is possible to pass in App Store ? Thanx for any answer.</p>
iphone
[8]
1,802,740
1,802,741
How to run openGrads script commands using c#
<p>I have been encountering the error of Metafile not open. When I execute the c# program the command line opens up and shoots this error without performing the activity to be initiated by the script. How do I solve this? Here is the code where I pass all my commands--</p> <pre><code>static void Main(string[] args) { ...
c#
[0]
3,831,451
3,831,452
Free Webasyst alternative
<p>Is there any free alternative to webasyst files <a href="http://www.webasyst.net/files/" rel="nofollow">http://www.webasyst.net/files/</a> script and webasyst notes.</p>
php
[2]
187,569
187,570
How can I initialise a static member of a class after certain other initialisation has taken place?
<p>I want to be able to initialise the static member <code>scalingfactor</code> in the following class:</p> <pre><code>class ScalingRect: public Rect { public: static float scalingfactor; ... }; </code></pre> <p>I thought I'd initialise it using a static member function of another class like this in the .cpp...
c++
[6]
5,125,970
5,125,971
Javascript sliding image gallery, ... how?
<p>I was wondering of any of you could push me in the right direction :). I'm trying 2 make an image "sliding" gallery, but it is a little complicated. it has 2 have 3 or 5 "views" the mainview ( the one you are currently watching) a previous and a next. The previous and the next must dynamically load images and unload...
javascript
[3]
5,378,120
5,378,121
how to configure the php RAR Archive installer windows
<pre><code>&lt;?php $rar_arch = RarArchive::open('filename.rar'); if ($rar_arch === FALSE) die("Failed opening file"); $entries = $rar_arch-&gt;getEntries(); if ($entries === FALSE) die("Failed fetching entries"); echo "Found " . count($entries) . " extract\location"; if (empty($entries)) die("No valid entries found.")...
php
[2]
4,237,657
4,237,658
How to start video using intent android
<p>I am trying to start the video media type using intents. I am completely new to this. I would appreciate a heads up. </p>
android
[4]
5,923,140
5,923,141
Why is this PHP comparison failing?
<p>I'm trying to compare a defined code against a set of blocked country codes. In the following example the country code is getting caught in my if block:</p> <pre><code>$country_code = 'US'; if ($country_code == ("NG" || "RO" || "VN" || "GH" || "SN" || "TN" || "IN" || "ID" || "KE" || "CN" || "CI" || "ZA" || "DZ" |...
php
[2]
2,033,150
2,033,151
java interface problem
<p>Code:-</p> <pre><code>10. interface Foo { int bar(); } 11. public class Sprite { 12. public int fubar( Foo foo) { return foo.bar(); } 13. public void testFoo() { 14. fubar( 15. new Foo() { public int bar(){ return 1; } } 16. ); 17. } 18. } </code></pre> <p>-Am not being able...
java
[1]
4,227,150
4,227,151
Node cannot be inserted at the specified point in the hierarchy" code: "3
<p>I have this:</p> <pre><code>window.PRINT = function() { $(arguments).each(function(Index,Value) { $('body').append(Value); }) }; </code></pre> <p>And I'm getting this:</p> <blockquote> <p>Node cannot be inserted at the specified point in the hierarchy" code: "3</p> </blockquote> <p>I'm tryi...
jquery
[5]
4,248,070
4,248,071
File.Move Error - System.IO.FileNotFoundException: Could not find file 'c:\windows\system32\inetsrv
<p>I have no idea why I'd get this error below. The filevPath when I debug is a completely valid (yes, the physical the image is definitely there physically on the hard drive in the filePath variable that is being passed) path and obviously is not the same path as the error is reporting which looks like some generic e...
c#
[0]
5,474,239
5,474,240
SQLite database location
<p>Using Eclipse to build an Android app. When I create/open a database (SQLite) my log indicates that its location is /data/data/package/databases/dbname. Is there a way to access this db using one of the Windows-based SQLite managers, eg; SQLite Database Browser. The path must be the path as it would be on the dev...
android
[4]
932,673
932,674
Multiplication in C#
<p>to get the value of a column i need to multiply the following value by .45, whats this best way of doing this ?</p> <pre><code>total = total + Convert.ToInt32(dtGetValues.Rows[i]["tot_amt"]); </code></pre> <p>i tried this but it does not work</p> <pre><code>total1 = total1 + Convert.ToInt32 (dtGetValues.Rows [i] ...
c#
[0]
1,434,475
1,434,476
Differences between Jar, Android Library and Android Library Project
<p>As I understand, the three ways of distributing my application are via Jar, Android Library and Android Library Project.</p> <p><strong>Jar</strong> - cannot contain resources or XML layouts (so this is out for me)</p> <p><strong>Android Library</strong> - I don't really know how this works but the Google API uses...
android
[4]
5,234,163
5,234,164
Layout of my Alpha Animation File
<p>First of all Im trying to animate a TextView view in one of my app's but it doesn't seem to work. I believe the answer lies in the alpha.xml file; I keep getting an error from this file but can't determine why:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;alpha xmlns:android="http://schemas.a...
android
[4]
220,699
220,700
Android: How to display formated code in TextView?
<p>I am writing an android application that will be displaying codes... specially java codes, or maybe jsp code as well. I was thinking about placing these codes in a TextView. However i dont know how to do this for android. I didnt find any tutorial or documentation on how to display formated text in a TextView. I kno...
android
[4]
5,694,736
5,694,737
How To Limit Properties Available On a Python Class
<p>Take the following class</p> <pre><code>class Person(object): def __init__(self, first_name, last_name): self.first_name = first_name self.last_name = last_name </code></pre> <p><em>How can I prevent the following usage?</em></p> <pre><code>p1 = Person('Foo', 'Bar') p1.firstname='Fooooooo' </code></pre> ...
python
[7]
47,105
47,106
joining string to next string in list
<p>I have a list with a large number of words in it: sentence = ['a','list','with','a','lot','of','strings','in','it']</p> <p>I want to be be able to go through the list and combine pairs of words according to some conditions I have. e.g.</p> <p>['a','list','with','a','lot','of','strings','in','it'] becomes ['a list...
python
[7]
1,462,611
1,462,612
403 error in accessing an URL but works fine in browsers
<pre><code>String url = "http://maps.googleapis.com/maps/api/directions/xml?origin=Chicago,IL&amp;destination=Los+Angeles,CA&amp;waypoints=Joplin,MO|Oklahoma+City,OK&amp;sensor=false"; URL google = new URL(url); HttpURLConnection con = (HttpURLConnection) google.openConnection(); </code></pre> <p>and ...
java
[1]
97,970
97,971
Has jQuery 1.8 changed how .data() returns the value?
<p>Related question: <a href="http://stackoverflow.com/questions/12622812/stop-jquery-data-from-converting">Stop jQuery .data() from converting</a> </p> <p>According to the documentation for <code>.data()</code>: </p> <blockquote> <p>Every attempt is made to convert the string to a JavaScript value (this includes...
jquery
[5]
3,398,423
3,398,424
force applied in x axis using UIAccelerometer
<p>I want to determine the force applied or the speed at which the iphone is moved in x axis using UIAccelerometer.</p>
iphone
[8]
5,187,315
5,187,316
How can I split a JavaScript string by white space or comma?
<p>If I try</p> <pre><code>"my, tags are, in here".split(" ,") </code></pre> <p>I get the following</p> <pre><code>[ 'my, tags are, in here' ] </code></pre> <p>Whereas I want</p> <pre><code>['my', 'tags', 'are', 'in', 'here'] </code></pre>
javascript
[3]
4,456,866
4,456,867
Javascript to create fence calclutor
<p>do you know if it is possible to build calculator to calculate fence, gates, etc. in JavaScript to get result similar to <a href="http://diy-vinyl-fence.com/content/16-fence-calculator" rel="nofollow">http://diy-vinyl-fence.com/content/16-fence-calculator</a> ?</p> <p>if you have any point, libraries, framework to ...
javascript
[3]
1,984,208
1,984,209
I cant get to set desire time of AlarmCLock in Android
<p>Hi guys this is what i have so far:</p> <pre><code>PendingIntent sender = PendingIntent.getBroadcast(mainactivity, 0, intent, 0); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.add(Calendar.SECOND, 10); A...
android
[4]
173,175
173,176
How to skip using __autoload?
<p>I have a php file which has multiple classes in it. I noticed that __autoload is being called when I instantiate any of the classes, even after the 'package' file has been autoloaded. This is worrying me, because surely if the initial 'package' .php file has been loaded, it is unnecessary overhead for __autoload whe...
php
[2]
3,935,480
3,935,481
iphone app new update popup
<p>I've seen apps the shows a dialog box when a new version of the app is available.</p> <p>How does it do that?</p>
iphone
[8]