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,176,041 | 3,176,042 | JavaScript string replace. How to check if there was a match? | <p>Is there any other way to find out if were was a match in String.replace method then searching in it's result?
Or there is another method which give me that informations?
I need behavior similar to PHP's preg_replace, where i can add optional argument which will be filled with the number of replacements done.</p>
| javascript | [3] |
5,974,930 | 5,974,931 | how to change data already data in spinner | <p>I have four Spinner ,First spinner display data when user select on spinner item data then other spinner data is displayed .First time,i have loaded all data in spinner when user select first spinner then data should be changed to refresh to second Spinner</p>
<p>How data is changed in second spinner</p>
| android | [4] |
384,542 | 384,543 | jQuery First Column Select Problem | <p><strong>jQuery Code:</strong></p>
<pre><code>$("[id$=gridvv] tr").filter(function() {
return $('td', this).length && !$('table', this).length
}).click(function() {
Alert('test');
});
</code></pre>
<p>This code should select all <code><tr></code> but I need <code>.locked</code> click return all <code><tr></code>.</p>
<p><a href="http://jsbin.com/uheni3/edit" rel="nofollow">http://jsbin.com/uheni3/edit</a></p>
| jquery | [5] |
2,565,695 | 2,565,696 | C# overloading resolution? | <p>From the article <a href="http://www.artima.com/intv/nonvirtualP.html" rel="nofollow">Anders Hejsberg interview</a>, "the way we do overload resolution in C# is different from any other language"
Can somebody provide some examples with C# and Java? </p>
| c# | [0] |
2,971,094 | 2,971,095 | Do Jquery have any plugin for Date & Time pick | <p>I need a jquery datepicker in 24 hour pattern.</p>
<p>mm-dd-yy hh:mm:ss</p>
<p>08-20-2010 14:45:33</p>
<p>I found so many date pickers in jquery , but no one is giving time!!!</p>
<p>Any body know about both date and time picker.??
jquery jquery ui anything</p>
| jquery | [5] |
4,460,227 | 4,460,228 | Android - How to get TimeZone Value from milliseconds | <p>In Android how to get TimeZone value(GMT+8.00) from milliseconds long value.</p>
<p>Thanks</p>
| android | [4] |
4,080,266 | 4,080,267 | Android: NullpointerException at vibrate | <p>I am using the following code , but its giving the nullpointer exception at vibrate.</p>
<pre><code>public Server(DroidGap gap, WebView view) //constructor
{
mAppView = view;
mGap = gap;
}
public Server(Context context) //constructor
{
mcontext=context;
}
public void run() //run method
{
try {
InetAddress serveradd = InetAddress.getByName(serveraddress);
}
catch (UnknownHostException e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
DatagramPacket packet=new DatagramPacket(buf,buf.length);
try
{
c.socket.receive(packet);
dat=new String(packet.getData());
if(dat!=null)
{
((Vibrator)mGap.getSystemService(Context.VIBRATOR_SERVICE)).vibrate(800);
cordovaExample.activity.sendJavascript("displayreciever('"+dat+"')");
}
Log.d("UDP", "s: ReceivedJI: '" + new String(packet.getData()) + "'");
} //end of try block
catch (IOException e)
{
e.printStackTrace();
}
//end of catch block
} //end of run method
</code></pre>
<p>I am getting nullpointer Exception at the followingline</p>
<pre><code>((Vibrator)mGap.getSystemService(Context.VIBRATOR_SERVICE)).vibrate(800);
</code></pre>
<p>I am not able to find out the reason</p>
<p>Any help will be appreciated,</p>
| android | [4] |
2,992,678 | 2,992,679 | Inserting item into map, which holds 2 more map | <p>I am trying to insert an item, into a map, which holds two other map.</p>
<pre><code>map< map<int, int> , map<int, int> > GC;
map<int, int> A;
A.insert(pair<int,int>(1,1));
map<int, int>:: iterator p1 = A.begin();
map<int, int> B;
B.insert(pair<int,int>(2,3));
map<int, int>:: iterator p2 = B.begin();
GC.insert( pair< map<int,int>, map<int,int> > (*p1, *p2) );
</code></pre>
<p>Well, as presumed its not working.</p>
<p>How to do it?</p>
<p><strong>EDIT:</strong><br>
It gives the following error:</p>
<blockquote>
<p>E:\CB\test.cpp|20|error: no matching function for call to <code>'std::pair<std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > >, std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > > >::pair(std::pair<const int, int>&, std::pair<const int, int>&)'</code></p>
</blockquote>
| c++ | [6] |
4,097,485 | 4,097,486 | Back button to relaunch Camera Activity | <p>I have a camera activity. I want to make it looks like the default android camera when the user press the back button after taking a picture, the preview is gone and the camera is back again. He can repeat this as many times as he likes. Of course, if the user did not take any pictures, pressing the back button will bring him back to the previous view. How can I achieve that? Thanks.</p>
<pre><code> @Override
public void onBackPressed() {
}
</code></pre>
| android | [4] |
4,123,980 | 4,123,981 | jQuery variables for multiple events | <p>I'd like to be able to define the variable which I can then use for other events, such as mouseout, mouseenter, click etc.</p>
<p>This is the current code:</p>
<pre><code> $('a div')
// Get the width an height of the image
//var $img_width = $(this).children('img').width();
//var $img_height = $(this).children('img').height();
.mouseenter(function() {
alert($img_width)
})
.mouseleave(function() { // Animate the image back to it's original size
alert($img_width);
})
.each(function(index) {
alert($img_width);
});
</code></pre>
| jquery | [5] |
1,543,355 | 1,543,356 | Generating Fibonacci sequence | <pre><code>var x=0,
var y=1;
var z;
fib[0] = 0;
fib[1] = 1;
for(i=2; i<=10; i++)
{
alert(x+y);
fib[i]=x+y;
x=y;
z=y;
}
</code></pre>
<p>I'm trying to get to generate a simple Fibonacci sequence but there no output. Can anybody let me know what's wrong?</p>
| javascript | [3] |
90,736 | 90,737 | removing single quote from end of a string in C# | <p>i am using the following code :</p>
<pre><code> importTabs.Add(row["TABLE_NAME"].ToString().TrimEnd('$')
</code></pre>
<p>to remove a dollar from string stored in importTabs Array list. how do i pass a parameter along with '$' so that it removes a single quote (') from the beginning ans well the end of the string?</p>
| c# | [0] |
2,778,198 | 2,778,199 | Cannot use a leading .. to exit above the top directory error | <p>"Cannot use a leading .. to exit above the top directory"
I am Using windows authentication in my project,when i set a form as a startpage i get th above error.please suggest</p>
<pre><code><%@ Page Title="" Language="C#" MasterPageFile="~/TravelsMaster.master" AutoEventWireup="true"
CodeBehind="AgentMaster.aspx.cs" Inherits="TravelsManagementSystem.Forms.Master.AgentMst.AgentMaster" %>
</code></pre>
| asp.net | [9] |
5,096,984 | 5,096,985 | Is it possible to place image in expandable list? | <p>I am new to android application. I need to know whether is it possible to place image in expandable list view as a child for one parent alone. remaining child can be text..</p>
<p>Please help me..</p>
| android | [4] |
1,505,562 | 1,505,563 | How do access to element by name in javascript? | <p>A page has elements without id - only with names. How to access them by javascript like this?</p>
<pre><code>document.getElementById('id').value := "...";
</code></pre>
<p><strong>UPDATED:</strong></p>
<p>Thanks to all! Is it possible to access then to element with specified value (radiobutton)?</p>
<pre><code><nobr><label><input style="vertical-align:middle" type="radio" name="name" value="value1" checked="checked"/><span style="vertical-align:middle" class="label">value1</span></label></nobr><br/>
<nobr><label><input style="vertical-align:middle" type="radio" name="name" value="value2"/><span style="vertical-align:middle" class="label">value2</span></label></nobr><br/>
</code></pre>
| javascript | [3] |
1,629,018 | 1,629,019 | App seems to stop working when the screen goes to sleep | <p>I have a CPU intensive long-running operation (a few hours) that I am using AsyncTask to perform. As it continues, it updates a progressbar on the screen to show what percentage of the task is done.</p>
<p>I discovered that when my screen goes to sleep (time-out) the task seems to stop. Not sure whether this is happing because the AsyncTask stops or it gets stuck at trying to update the screen (latter I am thinking).</p>
<p>Other than never letting the screen sleep, how else can I prevent my AsyncTask to stop executing? And if that is the only way, then how do I make sure that the screen doesn't sleep?</p>
<p><strong>EDIT</strong>: I must add that I know this sounds like a non-user-friendly app as commented by someone below. This does a very specialized task (processes thousands of image files to compare processing on different systems) and <strong>is to be used by a few users internally, not for public release.</strong></p>
| android | [4] |
1,535,127 | 1,535,128 | Wordpress WP_Query() Not working properly | <p>I would like to know why we get an error when we implement this code in our <code>sidebar.php</code>:</p>
<pre><code>$categories = get_categories();
foreach($categories as $category)
{
printf('<h2>%s</h2><ul>', $category->cat_name);
$posts = new WP_Query('cat='.$category->cat_ID);
while($posts->have_posts())
{
$posts->the_post();
echo '<li>', the_title(), '</li>';
}
print '</ul>';
}
</code></pre>
<p>The error we are getting is:</p>
<blockquote>
<p>Fatal error: Cannot use object of type WP_Query as array in C:\xampp\htdocs\wordpress\wp-includes\query.php on line 2374</p>
</blockquote>
| php | [2] |
1,027,984 | 1,027,985 | Why is mcrypt_encrypt giving errors? | <p>I got the code below from this site. When I run it, I get</p>
<pre><code>Warning: mcrypt_encrypt(): Attempt to use an empty IV, which is NOT recommend in C:\web\apache\htdocs\dev\encrypt.php on line 7
</code></pre>
<p>What wrong am I doing here and how do I get this right?</p>
<pre><code>//Key
$key = 'SuperSecretKey';
//To Encrypt:
$encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, 'I want to encrypt this', MCRYPT_MODE_CFB);
//To Decrypt:
$decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_CFB);
echo $encrypted;
echo "<br>";
echo $decrypted;
</code></pre>
| php | [2] |
5,899,901 | 5,899,902 | jquery find out whether user is typing or not | <p>My web page need some hotkeys, just single hotkey. So I need to find out whether user is typing or not to apply hotkeys.</p>
| jquery | [5] |
4,250,332 | 4,250,333 | Use method from another Class in Object from ArrayList | <pre><code> ListIterator litr = PuntenLijst.listIterator();
while(litr.hasNext()){
Object Punt = litr.next();
Punt.print();
}
</code></pre>
<p>PuntenLijst is an ArrayList that contains object instances from another Class.</p>
<p>Now I have made a method print() that prints out something from that object (of the other class).</p>
<p>With this loop I try to loop through the ArrayList, and then use the print() method from the other class, but it doesn't not seem to be working.</p>
<p>Can anybody help me out?</p>
| java | [1] |
3,011,188 | 3,011,189 | How do I combine undefined with booleans in JavaScript? | <p>For example suppose I have</p>
<pre><code>var myVar;
</code></pre>
<p>If I do</p>
<pre><code>console.log((myVar != undefined) && true);
</code></pre>
<p>It returns false as expected. Is it possible to do something closer to</p>
<pre><code>console.log(myVar && true);
</code></pre>
<p>It's much less verbose. At the moment the above returns undefined I would like false.</p>
| javascript | [3] |
1,898,333 | 1,898,334 | GPS to work inside building | <p>How to work with GPS, when no signal is available.
I want to get latitude and longitude when there is no signal like inside building.
How to use internet or SIM (network) to get latitude n logitude inside building. </p>
| android | [4] |
841,856 | 841,857 | Python Dictionary w/ 2 Keys? | <p>Can I have a python dictionary with 2 same keys, but with different elements?</p>
| python | [7] |
2,551,469 | 2,551,470 | converting date format from 0000-00-00 to timestamp | <p>I have a date picker that returns date in the format 0000-00-00 with </p>
<pre><code>$startT = isset($_POST["startT"]) ? $_POST["startT"] : "";
</code></pre>
<p>how do I convert this formatted date into a timestamp?
Thanks</p>
| php | [2] |
4,142,497 | 4,142,498 | Add content to sibling div | <p>In the example below what's the simplest addContent function that will put some content into the child div?</p>
<pre><code><div>
<a href="javascript:addContent();">My Link</a>
<div/>
</div>
</code></pre>
<p>Clicking the link should result in:</p>
<pre><code><div>
<a href="javascript:addContent();">My Link</a>
<div>Added Content</div>
</div>
</code></pre>
| javascript | [3] |
5,216,959 | 5,216,960 | Complexity of *in* operator in python | <p>What is the complexity of <strong><em>in</em></strong> operator in python? is it theta(n)?<br>
Is it the same as</p>
<pre><code>def find(L, x)
for e in L:
if e == x:
return True
return False
</code></pre>
<p>?
L is a list</p>
| python | [7] |
5,715,338 | 5,715,339 | Send variable to another server and get result with PHP | <p>OK I want to send a PHP variable to another server, this is my code, the php variable is an ip address.</p>
<pre><code> header("Location: http://www.domainname.com/bean/data.php?ip=$ip");
</code></pre>
<p>Basically the other server will get the ip address and return a variable called Description what i am unclear on is the best way to return the description variable back to the server.</p>
<p>code on data.php page </p>
<pre><code> $ip =$_GET['ip'];
include("ipology.class.php");
$ipology = new ipology( array($ip) );
$out = $ipology->out();
foreach( $out as $ip ) {
if( is_array( $ip ) ) {
$address = implode( ", ", (array)
$ip['address'] );
$descr = implode( ", ", (array) $ip['descr'] );
echo "$descr";
} }
</code></pre>
| php | [2] |
4,284,428 | 4,284,429 | Dose am kill-all influence malloc? | <p>Recently, I wrote a c-file and make it so that it run on my phone.</p>
<p>But if when I run am kill-all, this may influence the memory that I malloced.</p>
<p>How?</p>
<p>Thanks.</p>
<p>James.</p>
| android | [4] |
589,229 | 589,230 | Use Excel file as a Resource file for Java Program | <p>Is it possible to Use Excel file as a resource bundle for java program?</p>
| java | [1] |
2,822,394 | 2,822,395 | calling a 2-dimensional matrix in a function call | <p>while calling and defining a function how to use a 2-dimensional matrix in that function?</p>
| c++ | [6] |
5,830,394 | 5,830,395 | jQuery Determine if a matched class has a given id | <p>What is jQuery has id equivalent of the following statement?</p>
<pre><code>$('#mydiv').hasClass('foo')
</code></pre>
<p>so you could give a class name and check that it contains a supplied id.</p>
<p>something like:</p>
<pre><code>$('.mydiv').hasId('foo')
</code></pre>
| jquery | [5] |
4,286,995 | 4,286,996 | Substring Counting in Python and Adding 2 Numbers From One Line of Input | <p>I'm following a python website for my schoolwork. It's really neat, it gives you tasks to complete and compiles the code in the browser. Anyway, I came to a challenge that I'm not really sure how to go about.</p>
<p>One of the questions was:</p>
<blockquote>
<p>The same substring may occur several times inside the same string: for example "assesses" has the substring "sses" 2 times, and
"trans-Panamanian banana" has the substring "an" 6 times. Write a
program that takes two lines of input, we call the first needle and
the second haystack. Print the number of times that needle occurs as a
substring of haystack.</p>
</blockquote>
<p>I'm not too sure how I should start this, I know I have to compare the two strings but how? I used the <code>count</code> method, but it didn't recognize the second occurrence of <code>sses</code> in <code>assesses</code>.</p>
<p>My second question is one I solved but I cheated a little.</p>
<p>The question was:</p>
<blockquote>
<p>Write a program that takes a single input line of the form «number1»+«number2», where both of these represent positive integers,
and outputs the sum of the two numbers. For example on input 5+12 the
output should be 17.</p>
</blockquote>
<p>I used the <code>eval()</code> method and it worked, I just think that this wasn't what the grader had in mind for this.</p>
<p>Any insight would be greatly appreciated.</p>
<p><strong>EDIT:</strong> Second question was solved.</p>
| python | [7] |
2,659,799 | 2,659,800 | passing value to javascript | <p>hello please help me out regarding this dunction
i want to pass value from the textbox to javascript function and over there i want to store it for other text box . here is the sample code '</p>
<pre><code><input type="button" value="Add" onClick="addRowToTable(<?php echo $data['pno'];?>);" />
</code></pre>
<p>here is the javascript function </p>
<pre><code>function addRowToTable(var a)
{
........................
.......................
b.type = 'text';
b.value ='over here how can i get this value of a ';
}
</code></pre>
<p>Thanks</p>
| javascript | [3] |
4,017,927 | 4,017,928 | how to create Image slideshow for android? | <p>I want to develop a image slideshow or animation like Gif animation for android. 3 or 4 images will be there and each image will display alternately.</p>
| android | [4] |
2,534,271 | 2,534,272 | Using Primitive Wrapper Classes in Java | <p>Is there any difference between declaring the Integer below two ways</p>
<pre><code>Integer Age = 25;
Integer Age = new Integer(25);
</code></pre>
<p>Thanks in Advance </p>
| java | [1] |
2,473,779 | 2,473,780 | how to check wether a document is completed in web control | <p>i m using webbrowser control in my c# application but the document_completed fun is called for three times and i implemented my logics in this function.i want to check wether a document is loaded or not load in webbrowser control how can i check it or can i call this function from another function.</p>
| c# | [0] |
5,282,377 | 5,282,378 | Dynamic form field validation using jquery | <p>Hi am generating input boxes dynamically base on database keys.</p>
<pre><code> <input type="text" id="101" name="101">
<input type="text" id="302" name="302">
<input type="text" id="501" name="501">
<input type="text" id="601" name="601">
</code></pre>
<p>i want to make it mandatory fields + max length validation check
using jquery </p>
| jquery | [5] |
3,613,447 | 3,613,448 | Coverting an ereg_replace to preg_replace | <p>I have to convert an <code>ereg_replace</code> to <code>preg_replace</code></p>
<p>The ereg_replace code is:-</p>
<pre><code>ereg_replace( '\$([0-9])', '&#36;\1', $value );
</code></pre>
<p>As preg is denoted by a start and end backslash I assume the conversion is:-</p>
<pre><code>preg_replace( '\\$([0-9])\', '&#36;\1', $value );
</code></pre>
<p>As I don't have a good knowledge of regex I'm not sure if the above is the correct method to use?</p>
| php | [2] |
5,628,544 | 5,628,545 | Finding an element of a class inside a previous <li> | <p>I have this code that should trigger mouseover and mouseout on a picture when I hover over it's comment, but it's not working as expected. </p>
<pre><code>$(document).ready(function(){
$("li.description").mouseout(function(){
$(this).prev().find(".design").trigger('mouseout');
});
$("li.description").mouseenter(function(){
$(this).prev().find(".design").trigger('mouseover');
});
});
</code></pre>
<p>This is part of the structure of the table:</p>
<pre><code><li>
<img class="photography" src="PHOTO/boat.jpg" alt="Boat on sea." />
</li>
<li>
<div id="description" class="description">
<p>BOAT</p>
<p>ITALY</p>
</div>
</li>
</code></pre>
<p>I have a bunch of images and descriptions in my table.</p>
<p>Can someone help me?</p>
| jquery | [5] |
2,942,421 | 2,942,422 | Question in inheriting and hiding methods & classes | <p>I have questions about inheriting(extending) methods from classes and hiding some classes and methods from the main :)</p>
<p>Assume that I have class A & class B. Class B has method 1. and I need to use that method(method 1) in class A, but in the same time I need to hide that class(Class B with its methods) from the main.</p>
<p>I mean I want to deal with method 1 only from class A(or any other additional class, let's say Class C) I don't want it to be seen in the main. I don't want to give the possibility for the main to create an instance from Class B to use method 1. I need to do that, because when I create a jar file for my classes, there are classes that have methods that I don't want them to be shown. These classes I used them only when I did create the jar file.</p>
<p>How I can hide these classes and methods ?? I hope my explanation is clear...</p>
<p>Please don't tell me to do these things, because I thought of it, and it doesn't works : :)</p>
<p>1) to use private for the methods that I don't want them to be shown, because I can't do that. since, it's a separated classes not in the same class, and when I put private near the function , I can't use it at all, only it will works with the same class.</p>
<p>Also, </p>
<p>2) To put all the functions in the same class, Because I need to organize my code with classes with a separated files :)</p>
<p>Thanks alot Guys ....</p>
| java | [1] |
170,865 | 170,866 | How in the real world I/O file strreams are used | <p>Hi I am a student do any body know were in real world I/O file streams are used?</p>
| c# | [0] |
1,171,212 | 1,171,213 | push delievery system -fake web page prevention | <p>can anyone explain push delievery system for fake web page prevention ?</p>
| javascript | [3] |
1,151,245 | 1,151,246 | How to pass a variable into a setTimeout function? | <p>I'm trying to set five staggered function calls (happening one second apart). That part works fine. What doesn't work is, I can't pass values 0 through 4 into the callback function. It just passes '5' each time. I can't seem to figure out why and how to fix it.</p>
<p>Code:</p>
<pre><code>function callback(num)
{
console.log(num);
}
for (var i = 0, loadDelay = 1000; i < 5; ++ i, loadDelay += 1000)
setTimeout(function() { callback(i); }, loadDelay);
</code></pre>
<p>Result:</p>
<pre><code>5
5
5
5
5
</code></pre>
<p>Desired result:</p>
<pre><code>0
1
2
3
4
</code></pre>
| javascript | [3] |
2,345,258 | 2,345,259 | prettyCheckboxes make parent div clickable? | <p>I am using prettyCheckboxes and I want to change it so that the div wrapper can also be clicked as well as the radio button. The currently JS for the radio button/label is</p>
<pre><code> $label = $('label[for="'+$(this).attr('id')+'"]');
// Add the checkbox holder to the label
$label.prepend("<span class='holderWrap'><span class='holder'></span></span>");
// If the checkbox is checked, display it as checked
if($(this).is(':checked')) { $label.addClass('checked'); };
// Assign the class on the label
$label.addClass(settings.className).addClass($(this).attr('type')).addClass(settings.display);
// Assign the dimensions to the checkbox display
$label.find('span.holderWrap').width(settings.checkboxWidth).height(settings.checkboxHeight);
$label.find('span.holder').width(settings.checkboxWidth);
// Hide the checkbox
$(this).addClass('hiddenCheckbox');
// Associate the click event
$label.bind('click',function(){
$('input#' + $(this).attr('for')).triggerHandler('click');
if($('input#' + $(this).attr('for')).is(':checkbox')){
$(this).toggleClass('checked');
$('input#' + $(this).attr('for')).checked = true;
$(this).find('span.holder').css('top',0);
}else{
$toCheck = $('input#' + $(this).attr('for'));
// Uncheck all radio
$('input[name="'+$toCheck.attr('name')+'"]').each(function(){
$('label[for="' + $(this).attr('id')+'"]').removeClass('checked');
});
$(this).addClass('checked');
$toCheck.checked = true;
};
});
</code></pre>
<p>and I want to make it so the $(this).parent() also calls the click function.</p>
<p>Any ideas how I could do this?</p>
| jquery | [5] |
4,061,587 | 4,061,588 | some predefined classes in Java | <p>I need some pre-defined classes(in library) in Java that they have a function which calls another function in another predifined class.</p>
| java | [1] |
5,126,518 | 5,126,519 | android app has to be created through camera interface | <p>how can i write sample app that takes a photo with camera or selects from gallery, puts photo into a TableLayout and allows for adding subsequent photos pre-pending to the TableLayout .</p>
| android | [4] |
4,346,993 | 4,346,994 | Align textview in a block | <p>I wat to create an app like this, I use textview to preview number</p>
<pre><code> <TextView
android:id="@+id/generatenumber1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/generatenumber2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
</code></pre>
<p>How to align and color them like this, <a href="http://s24.postimg.org/sr53ezhtd/sdsd.png" rel="nofollow">http://s24.postimg.org/sr53ezhtd/sdsd.png</a> ?
I tried <code>android:layout_gravity="center_vertical|right</code> but not work.</p>
| android | [4] |
1,698,044 | 1,698,045 | Why won't this jQuery work in WordPress? | <p>THIS WORKS: </p>
<pre><code><script type="text/javascript">
function fadeReview() {
jQuery(".reviewPanel .reviewPanel2:hidden:first").fadeIn(500).delay(3000).fadeOut(500, function() {
jQuery(this).appendTo(jQuery(this).parent());
fadeReview();
});
}
fadeReview();
</script>
</code></pre>
<p>BUT, THIS DOES NOT WORK:</p>
<pre><code><script type="text/javascript">
function fadeReview() {
jQuery(".reviewPanel .reviewPanel2:hidden:first").fadeIn(500).delay(3000).fadeOut(500, function() {
jQuery(this).appendTo(jQuery(this).parent());
fadeReview();
});
}
fadeReview();
function fadeReviewName() {
jQuery(".reviewName .reviewName2:hidden:first").fadeIn(500).delay(3000).fadeOut(500, function() {
jQuery(this).appendTo(jQuery(this).parent());
fadeReviewName();
});
}
fadeReviewName();
</script>
</code></pre>
<p>Does it have to do with running two functions? It works ok in this <A HREF="http://jsfiddle.net/carsonmehl/VxhY6/1/" rel="nofollow">fiddle</a>. </p>
| jquery | [5] |
4,931,151 | 4,931,152 | C++ : Implicit type conversion | <p>I am bit confused about implicit type conversion. Given the following program </p>
<pre><code> float x = 4.23423451;
double y = 4.23423451;
float z = 101.9876;
float res1 = x * z;
float res2 = y * z;
std::cout << "res1 & res2 " << res1 << " & " << res2 << std::endl;
std::cout << "equality " << (res1 == res2) << std::endl;
</code></pre>
<p>The output was</p>
<pre><code> res1 & res2 431.839 & 431.839
equality 1
</code></pre>
<p>My question is "Will the equality be always true for any value of x, y & z (x = y) and also for any compiler?"</p>
<p>In </p>
<blockquote>
<p>res2 = y * z;</p>
</blockquote>
<p>Will the variable "y" be type-casted to float or variable "z" be type-casted to double?</p>
| c++ | [6] |
3,051,402 | 3,051,403 | iphone SDK: How to get the date out of a UIDatePicker? | <p>I need to retrieve the date from a UIDatePicker (Preferably I would also like to be specify the format as well. For example, mmdd would output the string 1209. Any string that reasonably parsed would work as well.</p>
<p>Thanks in advance.</p>
| iphone | [8] |
4,664,478 | 4,664,479 | How to access variables within another function | <p>I'm writing code for a blackjack game and have run into some problems. I have written two functions: one for the initial deal and one for each consecutive hit. this is the deal function:</p>
<pre><code>var deck = [1,2,3,4,5,6,7,8,9,10,"Jack","Queen","King","Ace"];
function deal() {
var card1_val = Math.floor(Math.random() * deck.length);
var card2_val = Math.floor(Math.random() * deck.length);
var card1 = deck[card1_val];
var card2 = deck[card2_val];
var hand = card1 + ", " + card2;
{//card1 Conditionals
if (card1 == "Jack") {
card1_val = 10;
}
else if (card1 == "Queen") {
card1_val = 10;
}
else if (card1 == "King") {
card1_val = 10;
}
else if (card1 == "Ace") {
card1_val = 11;
}
}
{//card2 Conditionals
if (card2 == "Jack") {
card2_val = 10;
}
else if (card2 == "Queen") {
card2_val = 10;
}
else if (card2 == "King") {
card2_val = 10;
}
else if (card2 == "Ace") {
card2_val = 11;
}
}
var res = card1_val + card2_val;
document.getElementById("result").innerHTML = hand;
//document.getElementById("test").innerHTML = card1_val + ", " + card2_val;
if (res > 21) {
alert("Blackjack!");
}
}
</code></pre>
<p>This is the hit function:</p>
<pre><code>function hit() {
var card_val = Math.floor(Math.random() * deck.length);
var nhand = deck[card_val];
bucket = hand + nhand
}
</code></pre>
<p>If you look at hit() I am using the var hand from deal(). I can't make it global because I need the value to be a fresh random each time. How do I access this same variable without rewriting lines of code? Any help would be appreciated.</p>
| javascript | [3] |
3,283,537 | 3,283,538 | writing javascript div in html | <p>i have put in my source code to show live twitter search result on my webpage.</p>
<p>Although it shows the search result but when i open the source code of my webpage it don't shows the tweets text in my source code.iT DYNAMICALLY LOADS IT I GUESS.</p>
<p>iS there a way out to fetch the content of div and write it with some functions like document.write or etc.</p>
| jquery | [5] |
4,994,272 | 4,994,273 | How to pass array between javascript and php mvc action | <p>I am new in php and want to pass the array from javascript to php. On jquery side it should be like this:</p>
<pre><code>var a= [];
a[0] = 'a';
a[1] = 'b';
$.ajax({
type: "POST",
data: {myarray:a},
url: "index.php",
success: function(msg){
$('.answer').html(msg);
}
});
</code></pre>
<p>which type on the server should I select?</p>
| jquery | [5] |
200,792 | 200,793 | Running Android apps in Linux | <p>I have a Red Hat Linux (RHL) system on which I'd like to run Android apps. How would I do this? Is there an open-source port of the Android Runtime for linux? Kind of like a VM?
If not, what steps will I need to follow to port the runtime to RHL (with the Dalvik VM etc) so that I can run the android apps built by all android developers?
I am new to android so I am trying to understand if there is an application virtualization support for it from anyone. Thanks in advance!</p>
| android | [4] |
628,043 | 628,044 | Multiple jQuery Sliding Content Boxes | <p>jQuery beginner here.</p>
<p>I'm working on a site with with two links. Each link slides out content a div with content below. The problem I'm having is that I can't figure out how to toggle between both when the user clicks the other link.</p>
<p>So when the user clicks LINK-A it slides out CONTENT-A, while CONTENT-A is showing if the user clicks LINK-B CONTENT-A should slide back before CONTENT-B slides out.</p>
<p>Hope this makes sense, really hope someone can help me!</p>
| jquery | [5] |
5,787,153 | 5,787,154 | Why does `$(item).width()` return `0` even though elements exist? | <p>With this code, I am trying to center an item depending width:</p>
<pre><code>var name_ = 'Random name';
$('.arrow .text').text(name_);
$('.arrow .text').css({'marginLeft':'-'+$('.arrow .text').width()/2+'px'});
console.log($('.arrow .text').length +' '+ $('.arrow .text').width() );
</code></pre>
<p>HTML</p>
<pre><code><div style="float:left;">
<div class="map">
<div class="arrow">
<img src="http://www.discoverdartmouth.com/images/map.point.png" />
<div class="text"></div>
</div>
<img src="http://www.freepik.es/foto-gratis/mapa-del-mundo_17-903095345.jpg" id="img1" />
<br/>
<br/>
<span class="spain mPointer">Spain</span> <span class="australia mPointer">Australia</span>
</div>
</div>
</code></pre>
<p>The line setting margin is not working and the console log is outputting <code>"1 0"</code>, so the item exists but has no width.</p>
<p>What am I missing here?</p>
| jquery | [5] |
1,104,164 | 1,104,165 | How to create XML editor for iPhone? | <p>I want to create a XML editor (form view type) for iphone. Can anyone suggest me how to proceed in this regard. I know how to parse an XML document but I am having trouble in editing the contents of the file dynamically. This editor should be such that, a new node can be added or a node can be deleted, it can also edit the values.</p>
<p>Please help...</p>
| iphone | [8] |
5,931,790 | 5,931,791 | Manipulating multidimensional array in PHP? | <pre><code>array(2) {
[0]=>
object(stdClass)#144 (2) {
["id"]=>
string(1) "2"
["name"]=>
string(5) "name1"
}
[1]=>
object(stdClass)#145 (2) {
["id"]=>
string(1) "4"
["name"]=>
string(5) "name2"
}
}
</code></pre>
<p>I want to add key and value (for example [distance] = 100;) to the objects in the array. After this I want to sort on the distance values. How can I achieve this?</p>
| php | [2] |
3,832,492 | 3,832,493 | Get Media player to get MP3 path adress from MySQL | <p>My uni project website can now play a music file from a url but what I need it to do now is to get the url address
from the mysql database. The url references the mp3 file's location on the server.
I am not sure where to insert the PHP within the media player plugin code (or whether it is possible at all).
Any advice would be appreciated.</p>
<pre><code><a href="#" onclick="toggle_visibility('player');"><img src="play.png" width="22" height="22"/></a>
<div id="player" style='display:none;>
<?php
$conn = mysql_connect("localhost", "ooze", "phu7eStu");
mysql_select_db ("ooze");
$query = ("select * from music where music_ID=1");
$result = mysql_query($query) or die(mysql_error()." ".$query);
while($row = mysql_fetch_array($result))
{
echo '<embed type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" flashvars="audiourl='$row[content]'" width="400" height="27" quality="best"></embed>';
}
mysql_close($conn);
?>
</div>
</code></pre>
| php | [2] |
1,089,271 | 1,089,272 | Add/Delete dynamic rows to HTML Table | <p>I am creating dynamic accordion pane and each pane has dynamic table with different id and buttons, in some pane i wanted to add dynamic rows to html table, i am using below code to perform this activity, </p>
<p>$('#myTable tr:last').after('1a');</p>
<p>i am not able to add any rows, my problem is how do i link this with dynamic button and dynamic table.</p>
<p>any suggestion or valuable comment would be appreciated.</p>
<p>Thanks in advance</p>
| asp.net | [9] |
422,009 | 422,010 | Execute some operation on new element adition using jQuery | <p>I have a couple of search controls in the page. Now I am using jQuery to perform some initialization on the controls available on the page. For the controls added by ajax, after the page was loaded, I have written a function to complete this initialization by passing the newly created ids to the function. But is there a better solution for this problem something like events where we can use on (live) in case of elements added after the page was loaded ?</p>
| jquery | [5] |
1,761,816 | 1,761,817 | Briefcode Needed? | <p>It is said that <code>Code that will be executed by the event handling thread should be relatively brief.</code> <strong>Any specific reason?</strong></p>
<p>This is question talks about the event handling thread in GUI</p>
| java | [1] |
73,526 | 73,527 | PHP: How to dump all local variables in an exception handler | <p>I'm looking for a method of having my exception handler dump the local variables of the function which the exception was raised in. Is this possible?</p>
| php | [2] |
2,593,351 | 2,593,352 | how can i prevent clients of my web site send curses and dirty words? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/24515/bad-words-filter">“bad words” filter</a> </p>
</blockquote>
<p>In my web application i have a section which gets input from the user and posting it on the main page.</p>
<p>i would like to prevent post in dirty language. </p>
<p>Is there any research about it or a library in php that detects most of the curses and dirty expressions in English.</p>
<p>shortly speaking i would like to test the input in that manner;</p>
<pre><code>if the input in the set of the unwanted patterns
dob't publish it
else
publish it on the main wall
</code></pre>
| php | [2] |
6,006,148 | 6,006,149 | how do i modify the way in wich readdir() lists files | <p>I have a script that creates a <code>zip</code> package daily in a directory. After this is done another script deletes the 'last' file in the directory so I always have just the latest x days.</p>
<pre><code>while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
echo "$file";
echo '<br>';
//count files
$file_count = $file_count + 1;
}
}
</code></pre>
<p>However suddenly <code>readdir()</code> is returning the list of files like this:</p>
<pre><code>March_16_2011.zip
March_12_2011.zip
March_13_2011.zip
March_14_2011.zip
March_15_2011.zip
</code></pre>
<p>So of course rather than the oldest file being removed the newest one is.</p>
<p>When I look at the files in FTP they are all dated correctly.</p>
<p>Why is <code>readdir()</code> returning them out of order in this case? How do I force it to order them in a way I want? (By date)</p>
| php | [2] |
709,295 | 709,296 | How do I determine if a class library is running in a Windows Service? | <p>I have a class library. How do I determine if it is running in a Windows Service versus something else? For example a console application, WPF, ASP.NET, WinForms? </p>
| c# | [0] |
1,980,519 | 1,980,520 | Best solution for an StringToInt function in C# | <p>I were asked to do an StringToInt / Int.parse function on the white board in an job interview last week and did not perform very good but I came up with some sort of solution. Later when back home I made one in Visual Studion and I wonder if there are any better solution than mine below. </p>
<p>Have not bothred with any more error handling except checking that the string only contains digits.</p>
<pre><code> private int StrToInt(string tmpString)
{
int tmpResult = 0;
System.Text.Encoding ascii = System.Text.Encoding.ASCII;
byte[] tmpByte = ascii.GetBytes(tmpString);
for (int i = 0; i <= tmpString.Length-1; i++)
{
// Check whatever the Character is an valid digit
if (tmpByte[i] > 47 && tmpByte[i] <= 58)
// Here I'm using the lenght-1 of the string to set the power and multiply this to the value
tmpResult += (tmpByte[i] - 48) * ((int)Math.Pow(10, (tmpString.Length-i)-1));
else
throw new Exception("Non valid character in string");
}
return tmpResult;
}
</code></pre>
| c# | [0] |
835,980 | 835,981 | What using statement must be added to use the Backup class in c# | <p>I want to use the <code>Backup</code> class to make a backup of my database. </p>
<p><code>Backup backup =new Backup();</code></p>
<p>However, I do not know what namespace this class is found in.</p>
<hr>
<p>I added Microsoft.SqlServer.SmoExtended.dll And Microsoft.SqlServer.Smo.dll</p>
<p>Now its Work !</p>
<p>Thanks all</p>
| c# | [0] |
5,650,024 | 5,650,025 | Why is this PHP error script not emailing me for fatal errors? | <p>I am using the following script from nettuts:</p>
<pre><code>// Our custom error handler
function error_engine($number, $message, $file, $line, $vars)
{
$email = "
<p>An error ($number) occurred on line
<strong>$line</strong> and in the <strong>file: $file.</strong>
<p> $message </p>";
$email .= "<pre>" . print_r($vars, 1) . "</pre>";
$headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Email the error to someone...
error_log($email, 1, '[email protected]', $headers);
if ( ($number !== E_NOTICE) && ($number < 2048) ) {
die("There was an error. Please try again later.");
}
}
// We should use our custom function to handle errors.
set_error_handler('error_engine');
</code></pre>
<p>It works fine for notices and warnings and such, but when I purposely break my script, say by changing "mysqli_connect" to "mysqy_connct" I get the fatal error printing out on the screen and no email!</p>
<p>Is an error like that beyond the scope of this type of error logging/reporting?</p>
<p>What am I doing wrong? </p>
| php | [2] |
33,756 | 33,757 | Half Width and Full Width | <p>i want to do a software for japan.
it has a reqirment to control the full width and half width in a textbox.</p>
<p>if i set the control's width is full width, whatever typed text is "full-width".
and if i set the control's width is half width, whatever typed text is half-width".</p>
<p>how can i implement it?</p>
<p>thanks! </p>
| c# | [0] |
357,705 | 357,706 | C# windows application set up on different machines and all work on one SQL Server 2008 database | <p>I have created a desktop application with SQL Server 2008 as backend. I want to use this database from my application that is installed on a number of machines.</p>
<p>What are the requirements for that application to connect to the centralized database.?</p>
| c# | [0] |
5,495,655 | 5,495,656 | Why we need declare parcelable object in AIDL file? | <p>If we have a class that would like to send from one process to another through an IPC interface, we have to create a class that support parcelable protocol (implements Parcelable).</p>
<p><strong>In addition, we have to create an .aidl file which declares that parcelable class.
Since this .aidl file will not generate a .java file as usual,I wonder the reason why we need to do it.</strong></p>
| android | [4] |
4,504,175 | 4,504,176 | An analog of C++ FQA for C# | <p>I have found <a href="http://yosefk.com/c++fqa/" rel="nofollow">C++ FQA Lite</a> very edificatory and would like to read more criticism. Could you recommend me something similar but concerning C#, please?</p>
<p>Thanks.</p>
| c# | [0] |
5,918,265 | 5,918,266 | What is the Android widget type used in e.g. the Settings menu? | <p>The Android settings menu is a list of options, each with some subtext (in the vanilla Google implementation; not in Sense UI) and an image (a down arrow in vanilla, custom icons in Sense UI). They are selectable and open a sub menu (Activity?) when clicked, like a button.</p>
<p>What is this widget? Is it available in the <code>android.widget</code> package somewhere? Is there a way to simulate it?</p>
| android | [4] |
4,861,541 | 4,861,542 | number of hash buckets | <p>In the <a href="http://docs.oracle.com/javase/7/docs/api/java/util/HashMap.html" rel="nofollow">HashMap</a> documentation, it is mentioned that:</p>
<ul>
<li>the <strong>initial capacity</strong> is simply the capacity at the time the hash table is created </li>
<li>the <strong>capacity</strong> is the number of buckets in the hash table.</li>
</ul>
<p>Now suppose we have intial capacity of 16 (default), and if we keep adding elements to 100 nos, the capacity of hashmap is 100 * loadfactor.</p>
<p>Will the number of hash buckets is 100 or 16?</p>
| java | [1] |
201,934 | 201,935 | downcast problem in c++ | <pre><code>#include <iostream>
using std::cout;
using std::endl;
class Base
{
public :
void f();
void g();
int mBaseData1;
};
class Derived : public Base
{
public :
int mDerivedData1;
};
void main()
{
Base* base = new Base();
Derived* derived = (Derived*)(base); // DownCast
derived->mDerivedData1 = 6;
cout<< derived->mDerivedData1<<endl; // Result = 6;
}
</code></pre>
<p>in this code <code>new base()</code> allocate memory in heap </p>
<p>and <code>Derived* derived = (Derived*)(base)</code> cast base to derived </p>
<p>how we can use mDerivedData1? i cant find where we allocate memory for mDerivedData1 or when we call constructor of Derived for allocate mDerivedData1 ?</p>
| c++ | [6] |
2,479,870 | 2,479,871 | Iteration over an object | <ul>
<li>I need some help please regarding PDOStatement::commit (from phpnet manual) </li>
<li><p>I don't understand Example #1, because of this part of the code: </p>
<pre><code>foreach ($fruits as $fruit) {
$sth->execute(array(
$fruit->name,
$fruit->colour,
$fruit->calories,
)
);
</code></pre></li>
</ul>
<p>1#<br>
- Does it iterate over an object, array or what?<br>
- I've tried both ... and of course, both give errors<br>
- Definitely, the -> operator tells me that it's an object, but I still don't understand the syntax.
- It is possible to iterate/acces simultaneously more than one property of an object?<br>
2#<br>
- When it is said "Insert multiple records...", I understand "more than one row", am I wrong? </p>
<ul>
<li>Thank you.</li>
</ul>
| php | [2] |
2,354,751 | 2,354,752 | PHP error: Warning: ociparse() expects parameter 2 to be string | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2973202/mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given-in-select">mysql_fetch_array() expects parameter 1 to be resource, boolean given in select</a> </p>
</blockquote>
<p>Getting this error when trying to display data from the database. </p>
<pre><code>Warning: ociparse() expects parameter 2 to be string, resource given in /home/sjrem/public_html/SIT104_3/order.php on line 29
An error occurred in parsing the sql string.
</code></pre>
<p>line 29 : <code>$stmt = OCIParse($connect, $query);</code> </p>
| php | [2] |
5,299,906 | 5,299,907 | get parameter value from cookie | <p>Hi I have a small problem. Currently I have 2 parameters saved in the browser cookie which are ADV and LOC... Now I have a page with a form and the form got two hidden fields :</p>
<pre><code><input type="hidden" name="adv" value="" />
<input type="hidden" name="loc" value="" />
</code></pre>
<p>I need to get the values of adv and loc from the cookie and save them in the hidden form fields... How can i do this please? Thanks</p>
| javascript | [3] |
1,460,862 | 1,460,863 | python one line function definition | <p>This must be simple, but as an only occasional python user, fighting some syntax.
This works:</p>
<pre><code>def perms (xs):
for x in itertools.permutations(xs): yield list(x)
</code></pre>
<p>But this won't parse:</p>
<pre><code>def perms (xs): for x in itertools.permutations(xs): yield list(x)
</code></pre>
<p>Is there some restriction on the one-line function syntax?
The body definition (for...) can be either two or one line by itself, and the def: can be one or two lines with a simple body, but combining the two fails.
Is there a syntax rule that excludes this?</p>
| python | [7] |
2,034,361 | 2,034,362 | Why it cannot open this shared object in php? | <blockquote>
<p>PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib64/php53/modules/mailparse.so' -
/usr/lib64/php53/modules/mailparse.so: cannot open shared object file:
No such file or directory in Unknown on line 0</p>
</blockquote>
<p>How can we fix this this issue</p>
<p>Thanks</p>
| php | [2] |
3,057,420 | 3,057,421 | references in C++ | <p>Once I read in a statement that</p>
<blockquote>
<p>The language feature that "sealed the
deal" to include references is
operator overloading.</p>
</blockquote>
<p>Why are references needed to effectively support operator overloading?? Any good explanation?</p>
| c++ | [6] |
3,266,643 | 3,266,644 | Android Action Bar add all icon to overflow | <p>I am updating my apps to have action bars, as Google seems to want developers to do now, and I am trying to get all the options of one app to all be in the overflow menu. I have searched far and wide but I can't seem to find anything that would make them do that. I'm pretty sure it would be something in the xml that defines the menu items. Do any of you guys know how to make all the menu options be in the overflow menu?</p>
| android | [4] |
1,366,100 | 1,366,101 | following a hyperlink inside div | <p>I have several divs like this:</p>
<pre><code><div class="MenuList"><a class="SiteLink" href="page.aspx">My Link</a></div>
</code></pre>
<p>The problem is that if the user clicks on the div but not on the text, the link won't trigger. This is what I have so far:</p>
<pre><code> $('#TopMenuBar .MenuList').click(function () {
//alert($(this).next('SiteLink').html());
});
</code></pre>
<p>What I'd like to do is extract the link from the anchor and go to the page.</p>
<p>Thanks for your suggestions.</p>
| jquery | [5] |
4,621,415 | 4,621,416 | What is the purpose of java.math.MutableBigInteger? | <p>java.math.MutableBigInteger is only available from inside the package. It inherits from java.lang.Object and there is only one subclass (SignedMutableBigInteger) which is only availible from inside the package.</p>
| java | [1] |
101,588 | 101,589 | how to add background color for checkbox in gridview | <p>hi
i have a gridview with 5 checkbox. i need to add for eack checkbox different backgound color that is </p>
<p>i totally have 5 rows in gridview with 5 checkbox for each row i need to add different color</p>
<pre><code>chececkbox1-red color
chececkbox2-green color
chececkbox3-blue color
chececkbox4-black color
chececkbox5-brown color
</code></pre>
<p>how can i get achived this one
any help would be great thank you </p>
| asp.net | [9] |
1,531,567 | 1,531,568 | C++ Calling Private Data Members in a Vector Class | <p>I'm looking to create a class that's in the form of a standard vector. I've been writing some programs with classes that have implemented Sets and not vectors, so I'm a little confused.</p>
<p>Here's my class: </p>
<pre><code>class Employee
{
private:
Struct Data
{
unsigned Identification_Number;
// Current capacity of the set
unsigned Department_Code;
// Department Code of employee
unsigned Salary;
// Salary of employee
str Name;
// Name of employee
}
</code></pre>
<p>If I want to call the private data members later on, can I just do the following? </p>
<pre><code>vector<Employee> Example;
//Assume there's data in Example
cout << Example[0].Identification_Number;
cout << Example[3].Salary;
</code></pre>
<p>If not, what would be an apprpriate container? Would a list of a list be better for handling this set of data?</p>
| c++ | [6] |
3,133,469 | 3,133,470 | INSTALL_FAILED_MISSING_SHARED_LIBRARY on installing apk (No Google APIs) | <p>I have a problem installing my android app with a custom library: hessian-3.1.5.jar. My IDE is: intellij idea 11</p>
<p>This library is in the project structure's library and in AndroidManifest.xml I have the line: <code><uses-library android:name="com.caucho.hessian.client" /></code></p>
<p>But it says: <code>Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]</code></p>
<p>Any ideas?</p>
| android | [4] |
4,724,197 | 4,724,198 | Adding new Custom Field of specific MIME type in Contacts App | <p>Thanx for snippet you provided it helped me a lot.</p>
<p>I have successed regarding storing of Custom field in Contact database, i also viewed my data through LogCat by printing it using "Cursor".</p>
<p>Thanx for your snippet it helped me a lot. </p>
<p>Can we view our Custom field from Main Contacts Application?</p>
| android | [4] |
3,465,027 | 3,465,028 | Python Error: AttributeError: IR instance has no attribute 'xySinglePos' | <p>These are my files:</p>
<pre><code>#IRClass.py
from VideoCapture import Device
import Image
from ctypes import *
class IR:
def __init__(self):
self.cam = Device()
self.user = windll.user32 #Handle for the mouse
rp = self.cam.getImage()
self.res = (rp.size[0],rp.size[1])
def irSingle(self,im):
imxy = im.getprojection()
imx = imxy[0] #x coordinates
imy = imxy[1] #y coordinates
x = imx.index(1) #try to find a 1
y = imy.index(1) #which is really our IR dot
return (x,y)
def xySinglePos(self, scale=(1440,900)):
try:
im = self.cam.getImage()
im.resize(scale)
x,y = IR.irSingle(self,im)
return (x,y)
except ValueError:
pass
def setPos(self,x,y):
self.user.SetCursorPos(x,y)
#IRtest.py
import IRClass
ir = IRClass.IR()
while 1:
x,y = ir.xySinglePos(scale=(1440,900))
ir.user.SetCursorPos(x,y)
</code></pre>
<p><a href="http://kbcarte.wordpress.com/2010/07/21/hello-world/#comment-75" rel="nofollow">http://kbcarte.wordpress.com/2010/07/21/hello-world/#comment-75</a></p>
| python | [7] |
4,678,952 | 4,678,953 | Escape hyperlink with exclamation marks in php.ini | <p>I have a config file that takes text warnings like follows:</p>
<pre><code>warnings.1 = Please check the date
</code></pre>
<p>These are presented to the user as HTML. I need to embed a hyperlink like the following:</p>
<pre><code>warnings.1 = <a href="http://foo.com/!FOO!/">check with foo</a>
</code></pre>
<p>I can't for the life of me figure out how to escape this such that parse_ini_file() can read it and get that string the way I want.</p>
| php | [2] |
643,323 | 643,324 | jQuery Select first and second td | <p>How can I add a class to the first and second td in each tr?</p>
<pre><code><div class='location'>
<table>
<tbody>
<tr>
<td>THIS ONE</td>
<td>THIS ONE</td>
<td>else</td>
<td>here</td>
</tr>
<tr>
<td>THIS ONE</td>
<td>THIS ONE</td>
<td>else</td>
<td>here</td>
</tr>
</tbody>
</table>
</div>
</code></pre>
<p>For the first td, this does nothing?</p>
<pre><code>$(".location table tbody tr td:first-child").addClass("black");
</code></pre>
<p>Can I also use second-child?</p>
| jquery | [5] |
5,482,368 | 5,482,369 | NSHost problem | <p>NSHost doesnot support to iphone... When i run this in simulator it works fine... But when i want to run in device means its give an NSHost.h error....</p>
<p>I want do this in device also..
How could i fix this
Thanks in advance</p>
| iphone | [8] |
2,002,326 | 2,002,327 | Javascript : resize window not working in Firefox | <p>I am trying to resize the window . This is working fine on IE , but not working on Firefox and Chrome . Can you'll please help </p>
<pre><code><html>
<head>
<script LANGUAGE=javascript>
<!--
function orientWindow(){`
`window.resizeTo(200,300)
window.moveTo(400,400)
}
//-->
</SCRIPT>
</head>
<BODY onLoad="javascript:orientWindow()">
</body>
</html>
</code></pre>
| javascript | [3] |
5,387,270 | 5,387,271 | How does the GMail app implement its selection summary in ActionBar? | <p>When an email is selected for deletion in the GMail app, the ActionBar looks like so:</p>
<p><img src="http://i.stack.imgur.com/TcYpX.png" alt="enter image description here"></p>
<p>There is a check mark and selection count displayed, with a subtle entry and exit animation. It appears it's an overlay that's on top of the ActionBar or replaces it.</p>
<p>Since I don't know the name of this widget I have trouble finding info about it. </p>
<ul>
<li>Is it part of the API? Google Calendar has a similar overlay when creating an event, which makes me think it's possibly part of the API.</li>
<li>If it is, what is it called?</li>
<li>How is the ActionBar updated with the row selection count? (No need for code, just a brief explanation would be helpful on how to write content to the the ActionBar overlay shown in the image).</li>
</ul>
| android | [4] |
3,137,989 | 3,137,990 | Android custom scoller area | <p>I am developing a map that can be scrolling left right and top bottom.
What is the best View for that?</p>
<p>I dont want to use WebView. I'd like to use some scroller View wirh a bitmap that is MATCH_PARENT.</p>
| android | [4] |
454,408 | 454,409 | Line of code missing ";" error | <p>I am getting an error on line 49 below is line of code</p>
<p>Exact error</p>
<p>Parse error: syntax error, unexpected T_NEW, expecting ',' or ';' in /home/banking/onlinebanking/processdeposit.php on line 49</p>
<pre><code>enter code here
<?php
require_once('../header.inc.php');
require_once('../class/database.class.php');
require_once('../class/person.class.php');
require_once('../websiteconfig.inc.php');
require_once('../class/bankaccount.class.php');
/*Start Session*/
session_start();
$currentMember = unserialzed($_SESSION['currentMember']);
/*Initialize variables*/
$depositamount = $_POST['depositamount_dollars'] . '.' . $_POST['depositamount_cent'];
$account = $_POST['account'];
$errors[]=array();
/*Error Handling*/
if($depositamount_dollars==''){
$errors[] = 'Please enter a valid dollars amount for your deposit.';
}
/*Error Handling*/
if($depositamount_cents==''){
$errors[] = 'Please enter a valid cents amount for your deposit.';
}
if($account==0){
$errors[] = 'Please select an account.';
}
/*Check if errors exist*/
$db = new Database;
$bankaccount = new Bankaccount;
$bankaccount->connection =$db->connection;
/*Process Deposit*/
$newbalance = $bankaccount->deposit($currentMember->memberid, $account, $depositamount);
echo '<h3>Deposit Completed</h3>' . "\n";
</code></pre>
<p>Below is line 49</p>
<pre><code>echo '<p>A deposit of ' .money_format('%i' , $depositamount) . 'to Account #' .$account . ' .The new balance is: ' . money_format('%i' , $newbalance) . '.</p>';
} else {
echo '<h1>Deposit Errors!</h1>' . "\n";
echo '<ul id="error_list">' . "\n";
foreach($errors As $errors) {
}
echo '</ul>';
}
?>
</code></pre>
| php | [2] |
2,144,400 | 2,144,401 | Why cant we initialize Const and reference varibales inside the constructor braces({ }) and is always done via initialization list | <p>Why cant we initialize Const and reference varibales inside the constructor braces({ }) and is always done via initialization list</p>
<p>Thanks,
Sandeep</p>
| c++ | [6] |
5,699,753 | 5,699,754 | UVA 3n + 1 challenge | <p>I made this programm to solve the <a href="http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=3&problem=36&mosmsg=Submission%20received%20with%20ID%2010484879" rel="nofollow">Uva problem</a>. </p>
<p>I tried the examples and the output was correct, but I get Wrong Answer. Here is my code: <a href="http://pastebin.com/bvQQ8UC7" rel="nofollow">http://pastebin.com/bvQQ8UC7</a></p>
| java | [1] |
3,260,898 | 3,260,899 | Retain textbox values on page refresh | <p>I have a textbox in a user control uc1. I have embedded this uc1 in a page called default.aspx. My issue is after running the application and entering some data in the textbox, when refresh the page i would like to show the values that i have entered in the textbox and not clear the textbox. I would like help with code on how to achive this. Thanks in advance for your help.</p>
| asp.net | [9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.