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 |
|---|---|---|---|---|---|
3,136,025 | 3,136,026 | Operator keyword used in an unexpected manner in a function | <p>I ran across this code recently which is part of a template class:</p>
<pre><code>operator T*();
</code></pre>
<p>I have been unable to find a clarification on this on SO or online. I have been unable to figure out how this declaration is working.</p>
| c++ | [6] |
2,982,792 | 2,982,793 | How to start kdiff from Console application? | <p>UPDATED...</p>
<p>I want to call kdiff from Console application. So I'm building two files and want to compare they at the end of executing my program:</p>
<pre><code>string diffCmd = string.Format("{0} {1}", Logging.FileNames[0], Logging.FileNames[1]);
// diffCmd = D:\vdenisenko\DbHelper\DbHelper\bin\Debug\Report... | c# | [0] |
4,222,498 | 4,222,499 | what jQuery library does this? | <p>I want to be able to have the following UI. When you click on the close button on top, the row below it moves to the top and so on.</p>
<p><img src="http://i.stack.imgur.com/Ut8A4.png" alt="enter image description here"></p>
<p>Is there a library for this?</p>
| jquery | [5] |
4,304,036 | 4,304,037 | How to change last letter of filename to lowercase if it is a letter? | <p>I have been given data which cannot be interpreted by my software unless it has a lowercase letter at the end. The data was delivered with an uppercase letter at the end.</p>
<p>Somehow I need to first recursively loop through all folders and find whether the filename ends with a letter and then change it to lowerc... | python | [7] |
5,514,035 | 5,514,036 | Giving extending classes a specific behaviour? | <p>How can I have several extensions of a class <code>Fruit</code>, and based on what class/type the object ist, execute the same method on this fruit but with different function?</p>
<p>Example: I'm using a <code>FruitManager</code> to add a new <code>Fruit fruit = new Apple();</code> to the fruitstore. If this frui... | java | [1] |
4,369,979 | 4,369,980 | Very simple jQuery countdown | <p>I want to do two things using a countdown in jQuery. I have looked at the delay method but it won't be applied to an element like shown in the docs.</p>
<p>What I want to do is wait 2 hours and then 30 seconds before the timeout do function A and then after that do function B.</p>
<p>During function A I will be sh... | jquery | [5] |
213,202 | 213,203 | Android:textwatcher is swapping keypad automatically from numeric to qwerty after single entry of digit? | <p>I want to use a text watcher which should take both alpha numeric characters and only numeric characters, initially my keypad is qwerty but when I want to enter all numeric values and press a numeric digit my keypad automatically swaps to qwerty back again. Why is this happening? Can you please help me on this?</p>
| android | [4] |
1,349,806 | 1,349,807 | Programming with Java for beginners | <p>I am a registered Student at a university in Switzerland, thus I know that programming is part of Electrotechnik (electrical engineering), the field I am going to take. </p>
<p>How can I learn programming with Java with easiest way, and without help by others?</p>
<p>I tried it through learning books, but I found ... | java | [1] |
3,879,303 | 3,879,304 | Is there any example for android media player with add player control in Notification? | <p>Is there any example for android media player with notification to add player controls like play/pause,previous and next button?</p>
| android | [4] |
3,188,055 | 3,188,056 | Convert binary string to list of integers using Python | <p>I am new to Python. Here's what I am trying to do: </p>
<ol>
<li>Slice a long binary string into 3 digit-long chunks. </li>
<li>Store each "chunk" into a list called row. </li>
<li>Convert each binary chunk into a number (0-7).</li>
<li>Store the converted list of numbers into a new list called numbers. </li>
</ol>... | python | [7] |
2,327,465 | 2,327,466 | Python string extraction | <p>In the following string how to get the id after the directory media and after getting the id ignore the rest of the string to read only the id numbers</p>
<pre><code>id_arr= ["/opt/media/12/htmls","/opt/media/24/htmls","/opt/media/26/htmls","/opt/media/56/htmls"]
</code></pre>
<p>The output should be 12 24 26 56</... | python | [7] |
2,109,489 | 2,109,490 | Toggle additional rows in a table | <p>I am trying to setup a table to toggle additional 'detail' rows. Essentially, the table is loaded, if a row is clicked, it will insert a 'details' row after said row. If said row is clicked again, it will remove the 'details' row. The following yields unexpected results. I was wondering what the best approach would ... | jquery | [5] |
4,939,461 | 4,939,462 | I can't pass a String array to my AsyncTask | <p>The compiler error is "<code>The method execute(ArrayList<String>...) in the type AsyncTask<ArrayList<String>,Void,ArrayList<String>> is not applicable for the arguments (String)</code>"</p>
<p>Why wouldn't it accept the new parameter? can anyone see what i am doing wrong?</p>
<pre><code> ... | android | [4] |
4,005,534 | 4,005,535 | jQuery function to check classes between two divs? | <p>I've got a page with two sets of <code>div</code> like so</p>
<pre><code><div id="set1">
<div class="1"></div>
<div class="2"></div>
<div class="3"></div>
.....
<div class="n"></div>
</div>
<div id="set2">
<div class="1"></div>
<div c... | jquery | [5] |
4,602,893 | 4,602,894 | JAVA Code for Card Reader | <p>I have MAGTEK Card Reader. I need to capture the data from magnetic card when card is swiped on the card reader. I have to develop this using core Java. Any code or application of the above would be appreciated.</p>
<p>Regards,
Sandeep Raju</p>
| java | [1] |
3,941,836 | 3,941,837 | How do I get the name of a python class as a string? | <p>What method do I call to get the name of a class?</p>
| python | [7] |
679,163 | 679,164 | What is the best way to copy a folder and all subfolders and files using c# | <p>I need to copy a Folder from one drive to a removable Hard disk.
The Folder which needs to be copied will have many sub folders and files in it.
The input will be Source Path and Target Path.</p>
<p>Like..</p>
<p>Source Path : "C:\SourceFolder" </p>
<p>Target Path : "E:\"</p>
<p>After copying is done, i shud be ... | c# | [0] |
240,205 | 240,206 | I want to calculate distance in a gps | <p>I am currently working on a gps project. I have read an xml file, I can print out the longitude and latitude bounds in the form of minLat, maxLat, minLon, maxLon. Way,Relation and Node properties like, id, user, uid, version, visible, changeset and timestamp . I can also print out the tag key and value and the refer... | java | [1] |
3,483,206 | 3,483,207 | multiple transition animations for an activity | <p>I have 3 activities -
Activity A, Activity B and Activity C. the transitions are as follows</p>
<p>A->B and B->A , A->C and C->A</p>
<p>now, when I am returning to A, I need different animation for the transition, depending on whether I am coming from B or C.</p>
<p>Activity A is the home page of the app, so I am... | android | [4] |
3,069,266 | 3,069,267 | for (var propertyName in object) vs for (propertyName in object)? | <p>Which one of those two methods for iterating over the property names of an object are preferable?</p>
<pre><code>for (var propertyName in object) {
}
</code></pre>
<p>vs.</p>
<pre><code>for (propertyName in object) {
}
</code></pre>
<p>I know in the second example, propertyName becomes a global variable, which... | javascript | [3] |
2,556,382 | 2,556,383 | Adding dynamic height with jQuery | <p>I need to calculate available height of an element and add it to a style via jQuery. How to I add the var of the height? Here's where I am at the moment:</p>
<pre><code>var scrolH = $("#box").height() - $(".alert").height() - 100;
$("#container").css({"overflow-y":"scroll", "height": scrolH + "px"});
</code></pre>
| jquery | [5] |
3,612,669 | 3,612,670 | How set width of one element equal to other in android? | <p>I have two buttons defined in XML</p>
<pre><code> <Button
android:layout_alignParentBottom="true"
android:id="@+id/takepic_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Take_Pic"
andro... | android | [4] |
805,975 | 805,976 | Issues with "Read More" feature of my website | <p>I need your help with doing a Read More feature for my website. Contents that the Read More feature will be applied on are generated dynamically. When I implement it, and I click the Read More...i'm taken to the same page and the full article dosent show.</p>
<p>Please how can I fix this.</p>
<p>Thank you.</p>
<p... | php | [2] |
2,790,677 | 2,790,678 | clear UIWebView Shadow | <p>Is there a way to remove the UIWebView Shadow ? </p>
| iphone | [8] |
5,302,690 | 5,302,691 | Android: Display custom dialog in center of the container | <p>How to display custom dialog as a center of the container?</p>
<pre><code>Dialog customdialog = new Dialog(this,android.R.style.Theme_Translucent_NoTitleBar);
Window window = customdialog.getWindow();
window.setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
window.setGravity(Gravity.CENTER);
</code></... | android | [4] |
5,877,744 | 5,877,745 | how to do functions in an AsyncTask? | <p>I have to use directions() function in an AsyncTask to avoid network processing on the UI thread.i'm unable to do this thing.
MY code is</p>
<pre><code> public class MainActivity extends MapActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceStat... | android | [4] |
2,606,550 | 2,606,551 | Strip all non-numeric characters (except for ".") from a string in Python | <p>I've got a pretty good working snippit of code, but I was wondering if anyone has any better suggestions on how to do this:</p>
<pre><code>val = ''.join([c for c in val if c in '1234567890.'])
</code></pre>
<p>What would you do?</p>
| python | [7] |
3,416,384 | 3,416,385 | Is it possible to get a reference to a live collection in jQuery? | <p>I have a simple table with 1 row to start out with. </p>
<pre><code><table>
<tr id="tr1">
<td>ROW 1</td>
<td>ROW 1</td>
</tr>
</table>
</code></pre>
<p>Each <code>tr</code> listens to a click event. Once clicked on a table row I would like to ... | jquery | [5] |
990,408 | 990,409 | load a code as the first thing in a webpage? | <p>How do I make the followings code load the first thing in my website ? as matter of fact I want the href to load the first thing.</p>
<pre><code><link rel="image_src" href="" id="ShareImageID"/>
<script>
var ShareImageIdVar = location.href.match(/\d+/);
document.getElementById('ShareImageID').href = "ht... | javascript | [3] |
2,779,786 | 2,779,787 | how to resize ImagView by java code for android | <p>how to resize ImagView by java code when i press the Image ?</p>
<p>this my xml</p>
<pre><code><ImageView
android:id="@+id/MyPic"
android:src="@drawable/clean"
android:layout_gravity="center"
android:gravity="center"
android:layout_height="70dp"
... | android | [4] |
1,218,801 | 1,218,802 | I want to send a textBox value in email in C#. some one Help me? | <p>I want to send a textBox value in email in C#. some one Help me?</p>
| c# | [0] |
5,782 | 5,783 | Easy way to blur label | <p>Need to create blurred shadow under UILabel. Same text but with blur and offset. Since NSShadow not supported in the iPhone SDK only way I see is Quartz render. Is there simpliest solution ?
Thanks</p>
| iphone | [8] |
3,616,180 | 3,616,181 | Match number of chars between quotes with Javascript? | <p>Suppose my data is the following</p>
<pre><code>Hello { "I have {g{t{" braces { between "{" { quotes{ "{{"
</code></pre>
<p>How can I match the { symbol that is only between the quotes? I am trying to extract the number of occurrences of a specified character only between quotes. Any ideas? The sample should matc... | javascript | [3] |
871,765 | 871,766 | Weird string does not name a type Error C++ | <h3>game.cpp</h3>
<pre><code>#include <iostream>
#include <string>
#include <sstream>
#include "game.h"
#include "board.h"
#include "piece.h"
using namespace std;
</code></pre>
<h3>game.h</h3>
<pre><code>#ifndef GAME_H
#define GAME_H
#include <string>
class Game
{
private:
strin... | c++ | [6] |
813,950 | 813,951 | Fget in smtp function | <p>I want to read last line which is 250 from Ehlo command. Currently it reads the first line which has 250 . Here is the current code</p>
<pre><code>fputs($socket, "EHLO server1.aa.com\r\n"); // ehlo command
$res = fgets($socket, 1024); // read output
if (substr(trim($res), 0, 3) != "250") {
</code></pre>
<p>Plea... | php | [2] |
3,094,405 | 3,094,406 | What is the difference between AVAudioPlayer and MPMusicPlayerController? | <p>It looks like both of them can play audio file.
What is the difference between AVAudioPlayer and MPMusicPlayerController?</p>
<p>Welcome any comment</p>
<p>Thanks
interdev</p>
| iphone | [8] |
4,232,522 | 4,232,523 | Javascript - streamlining code | <p>I've created a rough version of a site that will pull and display hundreds of pdfs. I want to be able to bookmark each pdf once the user clicks on it. The only way I could think of doing this is the following:</p>
<pre><code><script>
$(document).ready(function(){
$(".pdf1").click(function(){
... | javascript | [3] |
3,675,076 | 3,675,077 | Using UIAlertView in a manner similar to Windows' MessageBox()? | <p>I'm new to the iPhone and I would like to be able to use UIAlertView in a manner similar to the Windows <code>MessageBox()</code> or the <code>MessageDlg()</code> in <code>Delphi</code>.</p>
<p>For example, I have a method that needs to ask the user for confirmation on something, and proceed based on their response... | iphone | [8] |
229,768 | 229,769 | Exception occurs for some users with email contact picker | <p>I am trying to allow my users to select a contact from among their contacts that have email addresses. This is the code that is executed when they click the appropriate button:</p>
<pre><code>Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Email.CONTENT_URI);
startActivityForResult(i... | android | [4] |
2,685,489 | 2,685,490 | Python execute complex shell command | <p>Hi I have to execute a shell command :diff <(ssh -n root@10.22.254.34 cat /vms/cloudburst.qcow2.*) <(ssh -n root@10.22.254.101 cat /vms/cloudburst.qcow2)
I tried </p>
<pre><code>cmd="diff <(ssh -n root@10.22.254.34 cat /vms/cloudburst.qcow2.*) <(ssh -n root@10.22.254.101 cat /vms/cloudburst.qcow2)"
args... | python | [7] |
890,946 | 890,947 | In java, what's the relationship between field and class? | <p>Please refer to this API. The link is:</p>
<p><a href="http://download.carrot2.org/stable/javadoc/org/carrot2/text/preprocessing/pipeline/CompletePreprocessingPipeline.html" rel="nofollow">http://download.carrot2.org/stable/javadoc/org/carrot2/text/preprocessing/pipeline/CompletePreprocessingPipeline.html</a></p>
... | java | [1] |
13,089 | 13,090 | Android: SMS and contacts data access | <p>I'm trying to do a backup & restore application and I want to backup all SMS and all contacts informations. I read a lot about content providers but I first tried to copy these <code>contacts2.db</code> and <code>smsmms.db</code> files (the lazy and easiest way I figured out ) with no success because of permissi... | android | [4] |
5,385,517 | 5,385,518 | match and replace using php | <p>I have a html file that contains urls that start with ftps, http, https, mms, ed2k.. and in certain paragraphs. I need to sort these links and remove all the links that start with mms://. I tried preg_replace but it doesnt work coz many links are too long. can someone suggest a good method to remove the links using ... | php | [2] |
4,894,760 | 4,894,761 | Using $.each for more complex JSON data | <p>I understand how to use <code>$.each</code> to go through JSON data which looks like this:</p>
<pre><code>{
"one": "Singular sensation",
"two": "Beady little eyes",
"three": "Little birds pitch by my doorstep"
}
</code></pre>
<p>For example:</p>
<pre><code>$.each(data, function(key, val) {
echo '&... | jquery | [5] |
2,972,165 | 2,972,166 | How to get pictures of the camera preview, before its Callback draws theese pictures to its holder? | <p>I really hope you guys could help me, because I couldn't find no solution for my task since 2 weeks now, neither by searching, nor by myself. </p>
<p>What I'm trying to do is to get the camera-preview-pictures in bitmap format, before they are drawn to the camera-preview's surfaceView!, then i want to manipulate t... | android | [4] |
5,952,566 | 5,952,567 | Break parent, top variables in iframe to prevent frame busting, but still access functions of parent | <p>I am loading a website's content in an iframe through a proxy on my server. If I add this javascript at the top of the file,</p>
<pre><code>var top = "";
var parent = "";
</code></pre>
<p>I can successfully prevent the website from frame busting. How can I do this and still access functions in the parent window, l... | javascript | [3] |
5,412,460 | 5,412,461 | Unique value in find and replace | <p>My problem is that im using jQuery to replace the bb tags in a message. I want to replace all the <code>[youtube][/youtube]</code> with a youtube video and so far it works only if there is only 1 <code>[youtube][/youtube]</code> tag. If there is multiple <code>[youtube][/youtube]</code> tags in a message they change... | jquery | [5] |
1,635,671 | 1,635,672 | Convert Degrees/Minutes/Seconds to Decimal Coordinates | <p>In one part of my code I convert from decimal coordinates to degrees/minutes/seconds and I use this:</p>
<pre><code>double coord = 59.345235;
int sec = (int)Math.Round(coord * 3600);
int deg = sec / 3600;
sec = Math.Abs(sec % 3600);
int min = sec / 60;
sec %= 60;
</code></pre>
<p>How would I convert back from degr... | c# | [0] |
5,603,926 | 5,603,927 | Jquery find class with a certain text and change the css of the parent class if conditions are true | <p>I am trying to achieve the following using Jquery but I am not sure how to go about doing it. Any help would be greatly appreciated. Thank you.</p>
<pre><code><script>
$a = array(1,2);
if ($('.box:contains($a)')){
$('.inbox' //the .inbox where .box text = $a).css(//something);
}
</script>
<bod... | jquery | [5] |
5,091,390 | 5,091,391 | how to apply JavaScript replace() Method 2 time in a page | <p>JavaScript replace() Method</p>
<p>Hello <strong>username</strong>!Don’t forget me this weekend!<strong>Username</strong>.</p>
<p>When i use this</p>
<pre><code>str.replace("username", "Username");
</code></pre>
<p>but it's replace only first occurance i have to perform replace all.</p>
| javascript | [3] |
1,684,526 | 1,684,527 | how find location within kml file using php | <p>how can i find the user entered location is within kml file using php. PHP</p>
| php | [2] |
671,615 | 671,616 | Getting a value from a .text function | <p>I have functions in which values are constantly being calculated I am trying to store the value of these functions when the button is pressed however when I try the code below it doesn't work. How then can I capture this in a variable when a button is paused?</p>
<p><code>songposition = $("#songCurrentpos").text(pa... | jquery | [5] |
2,584,444 | 2,584,445 | Android: Multiclick at the same button | <p>In my Application I have a simple image switcher and 2 buttons(Next and Previous) at the bottom of screen to switch images. Also I set animation to image switcher with duration 700. So when i click "Next" button firstly I disable next button, and than set to Clickable with delay with the same duration...because i ne... | android | [4] |
2,632,921 | 2,632,922 | Javascript :: Does better to write: var arr=[]; then var arr=new Array();? | <p>Does better to write and why: </p>
<pre><code>var arr=[]; then var arr=new Array();
var obj={}; then var obj=new Object();
</code></pre>
<p>I read <a href="http://www.slideshare.net/Sampetruda/advanced-javascript-closures-prototypes-and-inheritance?src=related_normal&rel=908356">slide lection page 36</a> abou... | javascript | [3] |
4,653,406 | 4,653,407 | removing a breakpoint I didn't set | <p>It seems to quite frequently happen that when I'm playing with code in the chrome console that execution of a webpage is stopped by a breakpoint in the jquery file, such as you see below. If I don't have the console open when running the page, it doesn't stop, only when console open. I also can't click on the break... | javascript | [3] |
5,818,472 | 5,818,473 | Compile error: X does not exist in the current context | <p>The name 'MenuItems_Click' does not exist in the current context. Should I name it anywhere in ContextMenuStrip?</p>
<pre><code>private void icnNotify_Click(object sender, EventArgs e)
{
// Create a new instance of the Favorites class
Favorite.Favorites objFavorites =
new Favorite.Fa... | c# | [0] |
2,798,795 | 2,798,796 | Any reason behind hyphens in a GUID? | <p>Just when I generated a GUID, I found some hyphens in between the character and also at specified intervals</p>
<pre><code>8b55fec7-c987-4e7b-abad-16e5aaea9b53
</code></pre>
<p>Is there any story behind this?</p>
<p><strong>Note:</strong> My intention is to remove those hyphens as I am adding this GUID to a filen... | c# | [0] |
4,241,222 | 4,241,223 | find the phone number based on name - android | <p>I have a list view with three persons from the contact list . How can I display the phone number of these persons?</p>
<p>Can someone please post a code?</p>
<pre><code> for (int i=0;i<list.size();i++)
{
Log.i("TAG","PHONE NO IS: "+ ......)---------phone number?
//list.get(i).getName() - is ... | android | [4] |
2,101,779 | 2,101,780 | Python reading file that might not exist | <p>What is the best way in python to handle reading a file that may potentially not exist?</p>
<p>Currently I have the following:</p>
<pre><code> try:
with open(filename, "r") as f:
return f.read()
except IOError:
return False
</code></pre>
<p>Is this the best way to do it or is th... | python | [7] |
4,256,429 | 4,256,430 | Passing string through stat() function | <p>I have following code:</p>
<pre><code>#include <stdio.h> // For printf()
#include <sys/stat.h> // For struct stat and stat()
struct stat stResult;
if(stat("Filename.txt", &stResult) == 0)
{
// We have File Attributes
// stResult.st_size is the size in bytes (I believe)
//... | c++ | [6] |
5,826,579 | 5,826,580 | changing uitableviewcellaccessory image | <p>is it possible to change the uitableviewcellaccessory image in tableviewcell??</p>
| iphone | [8] |
47,008 | 47,009 | running a function when another is clicked using jquery | <p>When i run this <code>$btns.first().click();</code> in the first function it doesnt action it where as if i click it (as per second function it works perfectly. The result is the slides all show when i click on a tab instead of just one. And then when i click one of the inner buttons the slides all disapear leaving... | jquery | [5] |
4,447,731 | 4,447,732 | Unable to upate ListView data | <p>I have a class A which extends Activity. From the class A ,I am calling Adapter class B which extends BaseAdapter.</p>
<p>I am displaying ListView data from within the overriden method
public View getView(final int position, View convertView, ViewGroup parent)</p>
<p>I am fetching the data for the ListView from S... | android | [4] |
4,166,078 | 4,166,079 | jQuery click OUT with overlay | <p>I would like it that when the user clicks out of the #email-form div, it is hidden and #stamp is displayed again. I am trying to do this with an overlay div, but it's not working..</p>
<pre><code> jQuery('#email-form').hide();
jQuery('#stamp').click(function() {
jQuery(this).hide();... | jquery | [5] |
4,334,274 | 4,334,275 | Possible to capture entire call stack from a jQuery call? | <p>Admittedly, a strange question....but is it <strong>possible</strong> to somehow capture an entire javascript call stack from jQuery? For example, let's say on page ready, I do a for each on every row in a table, and for a certain cell in each row, I want to change the row color based on this cell exceeding a certa... | jquery | [5] |
4,579,208 | 4,579,209 | Hide the acrobat reader tool bar and capturing the print event from my application | <p>Hi all
I want to capture the print event from my asp.net web application and also i want to disable the save button from acrobat tool bar.</p>
| asp.net | [9] |
3,011,981 | 3,011,982 | If I use "on" with jQuery do I need to include this function inside a document ready? | <p>I have the following:</p>
<pre><code>$("#menu, #home").on('click', 'a', function() {
// javascript code
});
</code></pre>
<p>But it's not inside a document ready? Will it still work okay even if the #menu or #home are not yet part of the DOM? </p>
| jquery | [5] |
4,552,662 | 4,552,663 | How to access a variable in an object from a member object's function | <p>Ok, I have a class:</p>
<pre><code>class class1
{
public:
class2 object2;
int a;
};
</code></pre>
<p>where:</p>
<pre><code>class class2
{
public:
void function2();
};
</code></pre>
<p>Basically, I need function2 in object2 to be able to access "a." How would I go about doing this? Thanks.</p>
| c++ | [6] |
3,999,311 | 3,999,312 | Why do types referenced outside of a namespace need to be fully qualified? | <p>Given the following code snippet:</p>
<pre><code>using System;
using Foo = System.Int32;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
}
}
}
</code></pre>
<p>If I remove the "System." from in front of Int32 in my declaration for the "Foo" ty... | c# | [0] |
1,805,244 | 1,805,245 | How can I achieve safe user-generated client script execution? | <p>So we all know that <strong>eval</strong> is bad, and allowing users to create their own JavaScripts to run on your site is just potentially VERY dangerous, opening doors to all kinds of security risks.</p>
<p><strong>My challenge however, is to come up with a solution, to allow users to create their own custom scr... | javascript | [3] |
3,145,877 | 3,145,878 | JAVA: Read char from String to a certain char | <p>Is there a method or way to read and keep reading chars from a string, putting them in a new string until there is a certain char.
Keep reading from < to > but no further.
Thankx</p>
| java | [1] |
4,171,822 | 4,171,823 | Adding ImageViews to SurfaceView | <p>I am developing game in android. In my game i have SurfaceView(i.e., GameView) which is set on setContentView(new GameView(this));. During the runtime i have to add no of imageviews to the surface view. Each ImageView should listen for TouchEvent. and now How to add ImageViews to surfaceview?</p>
| android | [4] |
4,471,295 | 4,471,296 | Flurry State level user Details | <p>friend's
I have configured Flurry Analytics in my application,it points the users in the country well,but here i need to know the detailed view of the state wise users by clicking up the country from map showing but the corresponding users from that state is not showing.</p>
<p>I set <code><uses-permissio... | android | [4] |
5,532,304 | 5,532,305 | Is it possible to skip parameters that have default values in a php(5) function call? | <p>I have this:</p>
<pre><code>function foo($a='apple', $b='brown', $c='Capulet') {
// do something
}
</code></pre>
<p>Is something like this possible:</p>
<pre><code>foo('aardvark', <use the default, please>, 'Montague');
</code></pre>
| php | [2] |
2,937,486 | 2,937,487 | Get microphone soundlevel in android | <p>Im trying to get the sound level by getting live-input from the microphone.</p>
<p>As apps such as ,Sound meter and deciBel. I found this sample code from the link: </p>
<p><a href="http://code.google.com/p/android-labs/source/browse/trunk/NoiseAlert/src/com/google/android/noisealert/SoundMeter.java" rel="nofollow... | android | [4] |
4,826,245 | 4,826,246 | How to make a login and registration system in android? | <p>I have thorough understanding of php and mysql but I need help with making a registration form in android. I am not that experienced in java and none of the tutorials that are out are up to date.</p>
| android | [4] |
3,345,989 | 3,345,990 | Load test for a web server | <p>I have to write python script to perform load test for thttpd server. i need to test like "wat happens if 500 users accesing the server at a time" . i'm in need of some input to implement this..</p>
| python | [7] |
1,901,231 | 1,901,232 | In Python, how do I check the size of a StringIO object? | <p>And get the bytes of that StringIO object?</p>
| python | [7] |
5,799,546 | 5,799,547 | Javascript alternative to document.write not innerHTML | <p>I modified a little js script which compares a date to today and calculates the difference. (I'm a novice)
However, it uses document.write, which I've been told is bad.
I don't know why it's bad, people just say it's bad and never explain why.
Anyway, I'm looking for an alternative. innerHTML doesn't seem to work... | javascript | [3] |
2,985,099 | 2,985,100 | PHP set data by var name | <p>I have class</p>
<pre><code>class User extends BaseModel{
public $id;
public $name;
}
class BaseModel{
function __construct($data=null){
if($data!=null)
//set $id and $name
}
}
</code></pre>
<p>I would like to set $id , $name and any other data that extends BaseModel by cal... | php | [2] |
5,858,607 | 5,858,608 | print out the content of a modified file | <p>I am having a problem with outputting a modified file in php, here is my code:</p>
<pre><code><?php
$content = file_get_contents("1.txt");
$items = explode("\n",$content);
$line = "";
foreach ($items as $item){
$values = explode(",",$item);
foreach ($values as &$value){
$key = array_search($value,$value... | php | [2] |
1,816,471 | 1,816,472 | Customizing the mobile for Blind in android | <p>i have developed some applications for blind which makes them to use basic mobile functionalities like making call, add contact,delete contact. but now i am in dilemma that how the blind can even unlock the mobile if he is given the android mobile and navigate through the menu to reach the specific application. So ... | android | [4] |
5,116,512 | 5,116,513 | Android synhronization of profile (mobile and web) | <p>I have profiles in my mobile app and in web project. We are currently thinking about how can we synchronize them. The point is, if person add something to mobile profile - we can just send a bundle of ids to webserver and server will add them as well. The same with removing items. But what is if person will removes ... | android | [4] |
2,536,713 | 2,536,714 | Replacing the nth location of the selected text using jQuery | <p>I've the following div:</p>
<pre><code><div id="target" >hello(first), hello(second), hello(third), hello(fourth)</div>
</code></pre>
<p>and following code based on this <a href="http://stackoverflow.com/questions/5765381/how-do-i-wrap-a-text-selection-from-window-getselection-getrangeat0-with-an-h">di... | jquery | [5] |
2,047,723 | 2,047,724 | access scope of variable in for loop | <p>I have searched the SO before I post this question here and hopefully
this is not a duplicated one.</p>
<pre><code>def print_me():
a_list = range(1, 10)
for idx, aa in enumerate(a_list):
pass
print(idx)
if __name__ == '__main__' : print_me()
</code></pre>
<p>Output is as follows:</p>
<blockqu... | python | [7] |
5,957,159 | 5,957,160 | NSTimer was not triggered | <p>I used the code below to wait for NSTimer triggered</p>
<pre><code> -(void)timer1Fired :(NSTimer *) timer
{
isTriggered=true;
}
//----------------------------------------------
isTriggered=false;
[NSTimer scheduledTimerWithTimeInterval:1
target:self... | iphone | [8] |
4,653,018 | 4,653,019 | remove a value from an int array c# | <p>I have an array of int values <code>int[] ids</code>.
I have a Datatable <code>DataTable dt</code>
I want to keep only those values in the array that are there in the Datatable column ids</p>
<p>Say <code>int[] ids</code> contain <code>[2,3,4,5]</code>
<code>dt</code> contains <code>[2,3,4,3,4]</code> ---<code>ids<... | c# | [0] |
5,582,234 | 5,582,235 | retrieving parameter from function | <p>I have 2 functions, one that gets a name and the other that is being set up to Delete from the list of name. There are no compliation errors, but my DeleteName doesn't display anything. Probally a simple fix, what did I overlook?</p>
<pre><code> public static List<string> GetName(List<string> aString... | c# | [0] |
2,291,355 | 2,291,356 | writeToFile fails on iphone but works on simulator | <p>NSString *myfile = [[NSBundle] mainBundle] pathForResource:@"fileName" ofType:@"plist"];</p>
<p>NSMutableArray *mydata= [[NSMutableArray alloc] initWithContentsOfFile:myfile];</p>
<p>/* code to modify mydata */</p>
<p>[mydata writeToFile:myfile atomically:YES]</p>
<p>In case of simulator 'fileName.plist' is modi... | iphone | [8] |
1,931,198 | 1,931,199 | Practical use of sender & EventArgs in Page_Load | <p>I am on the verge migrating all my asp.net WebForms skills to asp.net mvc. So far, I never felt a need to use <code>EventArgs</code> and <code>sender</code> argument, passed to <code>Page_Load</code>. </p>
<p>Can you please point me a couple of scenario, when you leverage theses parameters?</p>
| asp.net | [9] |
4,199,273 | 4,199,274 | Generic DateTime List Comparison in C# | <p>I have a Generic DateTime List</p>
<pre><code>List<DateTime> **PreviousDates** = //Some List of Dates
</code></pre>
<p>Now i want to Get all the Dates in the <strong>PreviousDates</strong> List whose Month and Year equals the GivenDate's Month & Year. no matter what the Day & Time are...</p>
<p>I Tr... | c# | [0] |
4,970,253 | 4,970,254 | Does PHP mail only work in windows? | <p>Is there any reason PHP would only work in windows?</p>
<p>I keep seeing 'windows only' in the documentation, but maybe I am confusing this with something else.</p>
<p>If it does only work in windows, why? And if not, why does all the documentation mention 'windows only' so frequently?..</p>
| php | [2] |
3,501,793 | 3,501,794 | Javascript function which does not return a value in every case | <p>If I have a javascript function, it is possible that I do not return a value from every code path, e.g:</p>
<pre><code>function f()
{
if (checkSomething())
{
return 42;
}
// no return statement here
}
</code></pre>
<p>Is this valid javascript or does it only work by chance (i.e. might there be problems... | javascript | [3] |
2,102,501 | 2,102,502 | add event once in jquery | <p><br/>How can I have something like this :</p>
<pre><code><input class="myClass" id="a" type="checkbox" other="x"/>
<input class="myClass" id="b" type="checkbox" other="x"/>
<input class="myClass" id="c" type="checkbox" other="x"/>
<input class="myClass" id="d" type="checkbox" other="y"/>
<... | jquery | [5] |
5,481,247 | 5,481,248 | Error when get value in javascript? | <p>I have a code js;</p>
<pre><code><script type="text/javascript">
init_test(500,100);
document.write(init_test[0]);
</script>
</code></pre>
<p>but output is wrong, it is not result is 500. How to fix ?</p>
| javascript | [3] |
4,883,724 | 4,883,725 | Is there a C# equivalent to the Java Selector class? | <p>Is there a C# equivalent to the Java Selector class? In the .Net framework or opensource.</p>
<p>This is the <a href="http://doc.java.sun.com/DocWeb/api/java.nio.channels.Selector" rel="nofollow">java.nio.channels.Selector</a> class.</p>
<p>Thanks</p>
| c# | [0] |
674,547 | 674,548 | Chaining a constructor with an object function call in PHP | <p>Does anyone know if the following expression will be possible in the next version(s) of PHP?</p>
<pre><code>(new A())->a(); // Causes a syntax error
</code></pre>
<p>I find very annoying that currently one must write 2 lines instead of 1:</p>
<pre><code>$c = new A();
$c->a();
</code></pre>
| php | [2] |
3,958,158 | 3,958,159 | Is it possible to resolve domain names to an IP address with PHP? | <p>Well, very simple question. So that's good news for you, I guess.</p>
<p>More thorough explanation:</p>
<p>I have a PHP script allowing me to add urls to a database. I want the script to resolve the url to an IP address as well, to store that, too. However, some of the URLs are like this:</p>
<p><code>http://111.... | php | [2] |
4,528,489 | 4,528,490 | How to return the specific page in jQuery Datatables paging? | <p>I have a datable and "Edit" button in each row. When I click that button, /edit/ url opens. Everything is Ok until now. But if I need to go back to the datatable, it starts from the first page. What can I do for that?</p>
<pre><code> $('#table').dataTable({
"sDom" : 'rtFip>',
'fnDrawCallback' : f... | jquery | [5] |
3,323,040 | 3,323,041 | Android: Specify String in different Package in Manifest | <p>Is it possible to specify that a @string value belongs to a different package via the Manifest?</p>
<p>i.e. android:text="@string/my_logo_text"</p>
<p>Implicitly specifies the value as belonging to the current package. Is there a way to fully qualify that this string belongs to another package?</p>
| android | [4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.