Unnamed: 0
int64 65
6.03M
| Id
int64 66
6.03M
| Title
stringlengths 10
191
| input
stringlengths 23
4.18k
| output
stringclasses 10
values | Tag_Number
stringclasses 10
values |
|---|---|---|---|---|---|
5,315,950
| 5,315,951
|
Implementing Code Behind Clickable TextViews
|
<p>I just started working with clickable TextViews in Eclipse. The line in the code below:</p>
<pre><code>t2.setOnClickListener(this); seems to be having a problem.
</code></pre>
<p>I have tried a variety of methods like setOnTouchListener etc. to handle the click events of a user clicking my TextViews but I am having trouble determining which method (if any) is appropriate behind clickable TextViews.</p>
<pre><code>public class Soundboard extends Activity implements OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.soundboard);
TextView t2 = (TextView) findViewById(R.id.textView5);
t2.setFocusable(true);
t2.setOnClickListener(this);
t2.setOnClickListener(new View.setOnClickListener() {
public void onClick(View view) {
mp.start();
}
});
}
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
}
</code></pre>
|
android
|
[4]
|
4,684,548
| 4,684,549
|
My php code is very slow and timeout error appears
|
<p>I have a soccer fantasy league script and every week I add a points to the users, using this code:</p>
<pre><code>$sql_user="select * from ".$prev."user ";
$re_user=mysql_query($sql_user);
while($d_user=mysql_fetch_array($re_user))
{
$userID=$d_user['id'];
$sql_addpointgroup="select * from ".$prev."addpoint group by weekno order by weekno";
$re_addpointgroup=mysql_query($sql_addpointgroup);
while($d_addpointgroup=mysql_fetch_array($re_addpointgroup))
{
$points=0;
$sql_addpoint="select * from ".$prev."addpoint where weekno='".$d_addpointgroup['weekno']."'";
$re_addpoint=mysql_query($sql_addpoint);
while($d_addpoint=mysql_fetch_array($re_addpoint))
{
$points=$d_addpoint['points'];
$sql_weekstatistic="select * from ".$prev."weekstatistic where weekno='".$d_addpointgroup['weekno']."' and userID='$userID' and playerID='".$d_addpoint['playerID']."'";
$re_weekstatistic=mysql_query($sql_weekstatistic);
if(mysql_num_rows($re_weekstatistic)>0)
{
$sql_update="update ".$prev."weekstatistic set points='$points' where weekno='".$d_addpointgroup['weekno']."' and userID='$userID' and playerID='".$d_addpoint['playerID']."'";
mysql_query($sql_update);
}
}
}
}
</code></pre>
<p>in the beginning this code was working fine, but after the number of registered users reached the 500 users, the updating process now is very slow and some times timeout error msg appears.</p>
<p>Is there any way to rewrite this code, so to do the updating process faster?</p>
<p>many thanks in advance,</p>
|
php
|
[2]
|
5,054,289
| 5,054,290
|
fputcsv force all values to have quotes or non at all
|
<p>i'm using <code>fputcsv</code> and its only putting input text type values into quotes. Is there a way to override this and either force all to have quotes or remove them all together? I tried <code>fputcsv($fp, $data, ',', '"');</code> but that didn't work</p>
<pre><code>$data = array_values($_POST);
if( $fp = fopen('data.csv', 'a+') ){
fputcsv($fp, $data);
}
fclose($fp);
</code></pre>
<p><strong>csv data example: "user","city",yes,no,10001</strong></p>
|
php
|
[2]
|
1,808,244
| 1,808,245
|
How to compare 2 different length arrays to eachother
|
<p>I'm trying to make a function that compares two different length arrays to each other and if they match then some actions are performed. Array1, cell1 compares to array2, cell1, cell2, cellN... Then Array1, cell2 compares to array2, cell1, cell2, cellN...</p>
<p>Something resembling this:</p>
<pre><code>if(array1[$i]==array2[])
{
// Some actions...
}
</code></pre>
<p>How can this be implemented?</p>
|
php
|
[2]
|
1,791,918
| 1,791,919
|
Android: different onStop conditions when overriding
|
<p>I have an activity that has a special <code>onStop</code> case: if the user stops the activity (only on <code>onBackPressed</code> called) it will gracefully stop and go back one level (the app has 3 levels of activities), if the user does <em>anything else</em> the activity will quit and go back to the first level. My problem is at the second level:</p>
<p>This is <code>MyActivity</code>, a class I use for different activities in my application:</p>
<pre><code>class MyActivity extends Activity {
@Override
protected void onStop() {
if(!isFinishing()) {
activityHandler.sendEmptyMessage(RESULT_CANCELED);
finish();
}
super.onStop();
}
@Override
public void onBackPressed() {
if(!isFinishing()) {
activityHandler.sendEmptyMessage(RESULT_OK);
finish();
}
super.onBackPressed();
}
}
</code></pre>
<p>Now there's my special class that should differentiate between 2 different stop conditions:</p>
<pre><code>class MySuperSpecialActivity extends MyActivity {
private boolean launchingAnotherActivity = false;
private void anotherActivity(String activity) {
launchingAnotherActivity = true;
Class<?> activityClass = Class.forName("com.bluetooth.activities." + activity);
startActivityForResult(new Intent(AnotherActivity.this, activityClass), ACTIVITY);
}
@Override
protected void onStop() {
// this is what I want to override
if(!isFinishing() && !launchingAnotherActivity) {
activityHandler.sendEmptyMessage(RESULT_CANCELED);
finish();
}
// this next thing will make my app stop anyway
super.onStop();
}
}
</code></pre>
<p>So the <code>super.onStop()</code> part will stop my activity no matter what since the MyActivity class doesn't have the <code>launchingAnotherActivity</code> condition... How could I override the <code>onStop</code> without it finishing my activity?</p>
|
android
|
[4]
|
2,385,470
| 2,385,471
|
What is the best way to stop multiple form submissions using PHP?
|
<p>I wanted to know what is the best way to stop multiple form submissions using PHP, can you please give an example.</p>
|
php
|
[2]
|
2,547,257
| 2,547,258
|
My code seems to do nothing
|
<p>Doesn't do anything, it doesn't even let me input when I call gets(), even my IDE is claiming "statement has no effect".</p>
<pre><code>#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
char userluv[800], fuusd[800], orig[800], key [51], priv [21];
int tempfussd[800], kint, pint, tint[5], c, lame;
//get the basic info
cout << "key? ";
cin >> key;
cout << "Second key? ";
cin >> priv;
cout << "Your lovely text?:\n";
gets(userluv);
for(c=0; c<=key[c]; c++){
kint += key[c];
}
for(c=0; c<=priv[c]; c++){
pint += priv[c];
}
//do stuff to your key
tint[0] = strlen(key) + strlen(priv);
tint[1] = tint[0] * tint[0];
//string to int then do stuff
for(c=0; c<=userluv[c]; c++){
tempfussd[c] = userluv[c];
tempfussd[c] + kint;
tempfussd[c] * pint;
tempfussd[c] * tint[1];
}
cout << "\n" << tempfussd[c] << "\n";
return 0;
}
</code></pre>
|
c++
|
[6]
|
1,325,929
| 1,325,930
|
How to find image name with imageview?
|
<pre><code>myImageView = [[UIImageView alloc] initWithImage:[imagearray objectAtIndex:j]];
[myImageView setUserInteractionEnabled:YES];
[myImageView setTag:i];
if (i==0||i==1) {
[UIImageView beginAnimations:nil context:NULL];
[UIImageView setAnimationDuration:1.5];
[UIImageView setAnimationRepeatCount:0];
myImageView.center=CGPointMake(42+t, 220+y);
[self.view addSubview:myImageView];
NSLog(@"my imageviw tag %d",myImageView.tag);
[myImageView release];
t=t+10;
y=y+10;
}
</code></pre>
|
iphone
|
[8]
|
2,901,439
| 2,901,440
|
Can I add data to an already serialized array?
|
<p>I am using ckeditor and would like to serialize the textarea data along with all of the other elements. Is this possible?</p>
<p>I would like to append the taData to vals if possible.</p>
<pre><code>var vals = $("#post").find('input,select').serialize();
var taData = CKEDITOR.instances.ta1.getData();
</code></pre>
|
jquery
|
[5]
|
467,646
| 467,647
|
Checking if number of objects is < 1 in PHP object array
|
<p>I am trying to check whether the number of items in an object is less than one like this:</p>
<pre><code>if ( count($trailhead_list->o < 1 ) )
</code></pre>
<p>It always returns true even if there is some items there.</p>
|
php
|
[2]
|
39,966
| 39,967
|
Find Even/Odd number without using mathematical/bitwise operator in Java
|
<p>How is it possible find Even/Odd number without using mathematical/bitwise operator?</p>
|
java
|
[1]
|
5,418,264
| 5,418,265
|
variable value to use as javascript code
|
<p>I have following code...</p>
<pre><code><script type="text/javascript">
var arr= new Array('10');
arr[0]='Need For Guru';
arr[1]='Qualities of a Guru';
arr[2]='Living Guru';
arr[3]='Who is a Satguru?';
arr[4]='Guru and Spiritual master';
arr[5]='Definition of discipleship';
arr[6]='Power of Faith';
arr[7]='Bad mouthing a Guru';
arr[8]='Fake Guru Shishya';
arr[9]='Pitfalls in the path of liberation';
var text='['+arr[0]+',\''+arr[1]+'\','+arr[2]+',\''+arr[3]+'\','+arr[4]+',\''+arr[5]+'\','+arr[6]+',\''+arr[7]+'\','+arr[8]+',\''+arr[9]+'\']';
document.write(text);
activatables('section', text );
</script>
</code></pre>
<p>My problem is that I want to use <code>value</code> of <code>text</code> as part of javascript code in line ---
<code>activatables('section', text );</code> .. so that code becomes like below</p>
<pre><code> activatables('section', ['Need For Guru','Qualities of a Guru',...]);
</code></pre>
<p>But I am not able to do the same.. .can anyone help in this?</p>
|
javascript
|
[3]
|
1,553,195
| 1,553,196
|
Javascript/jQuery positioning issue
|
<p>Here is the problematic part of my code:</p>
<pre><code>$('#chat-bar').prepend('<li id="chat-button-with-'+userid+'"><a href="#">'+username+'</a></li>');
$('#chat').prepend('<div class="chat-box" id="chat-box-with-'+userid+'"></div>');
parentright = $('body').width() - $('#chat-button-with-'+userid).offset().left;
$('#chat-box-with-'+userid).css({right:parentright, bottom:'24px'});
</code></pre>
<p>What I'm trying to do is line #chat-box-with-n up with its respective button, #chat-button-with-n</p>
<p>userid and username and so on are all set before this, so this is not the issue. In fact, after the page loads, if I set userid to 3 in the console and then do:</p>
<pre><code>parentright = $('body').width() - $('#chat-button-with-'+userid).offset().left;
</code></pre>
<p>I'll get the proper result. Yet it doesn't seem to be able to get this result after just appending it. What am I doing wrong?</p>
<p>If I put <code>alert(parentright)</code> just after the line, I'll just get the body width. So $('#chat-button-with-'+userid).offset().left seems to be 0 at that point. Do I need to do this some other way?</p>
|
jquery
|
[5]
|
4,447,300
| 4,447,301
|
Stop the query when clicked
|
<pre><code><script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#flip").click(function(){
$("#panel").slideToggle("1");
return false;
});
});
</script>
</code></pre>
<p>I am a newbie on this and I just copy some codes and learn from it on how they perform when I am testing it. I am using tumblr and they are working fine on what I wanted to have BUT when I click on the post or any link, it will return as normal again. Need to click on the button to slide/show the post again. </p>
<p>Any suggestions?</p>
|
jquery
|
[5]
|
2,686,964
| 2,686,965
|
Python space+time efficient Data Structure to store 2D Bit Arrays
|
<p>I want to create a 2D Binary (Bit) Array in Python in a space and time efficient way as my 2D bitarray would be around 1 Million(rows) * 50000(columns of 0's or 1's) and also I would be performing bitwise operations over these huge elements. My array would look something like:</p>
<pre><code>0 1 0 1
1 1 1 0
1 0 0 0
...
</code></pre>
<p>In C++ most efficient way (space) for me would be to create a kind of array of integers where each element represents 32 bits and then I can use the shift operators coupled with bit-wise operators to carry operations.</p>
<p>Now I know that there is a bitarray module in python. But I am unable to create a 2D structure using list of bit-arrays. How can I do this?</p>
<p>Another way I know in C++ would be to create a map something like <code>map<id, vector<int> ></code> where then I can manipulate the vector as I have mentioned above. Should I use the dictionary equivalent in python?</p>
<p>Even if you suggest me some way out to use bit array for this task it will be great If I can get to know whether I can have multiple threads operate on a splice of bitarray so that I can make it multithreaded. Thanks for the help!!</p>
<p>EDIT:</p>
<p>I can even go on creating my own data structure for this if the need be. However just wanted to check before reinventing the wheel.</p>
|
python
|
[7]
|
4,938,362
| 4,938,363
|
problems controlling a background-image with javascript during a mouse over effect within a thumbnail div
|
<p>I'm sorry if this is a fairly common question, but I assure you I've spent the last two days reading through to see if I can figure it out on my own, but alas I'm here at your feet hoping for some a advice. I'm still in the beginning stages of learning javascript. </p>
<p>Basically, I have a series of thumbnails contained by a div class that has a repeating background image giving it a subtle texture. I also have some java script that successfully highlights the individual div container blue while the mouse hovers over the thumbnail image. The problem I'm having is that the solid blue effect doesn't mesh too well with the existing background image I've chosen for the thumbnail div. I've been trying to toggle the background image on/off while the blue hover effect is taking place, but I've only been able to turn it off permanently after a single mouse over/hover.</p>
<p>Here's the javascript:</p>
<pre><code> // this controls the entire div tag and turns it blue
$('.pGrid div a').hover(
function(){
//this if-statement should toggle whether or not the striped background shows when the mouse is hovering
if ($('.pGrid div a').hover !=0) {
$('.pGrid div a').parent().css({ backgroundImage: "none" });
}
else {
$('.pGrid div a').parent().style({ backgroundImage: "url('../images/background_stripes_white.gif')" });
}
//mouse over turn div blue
$(this).parent().stop().animate({
backgroundColor: "#006699",
color: "#ffffff"
}, 350);
// this controls the word-highlight part
$(this).stop().animate({
backgroundColor: "#006699",
color: "#ffffff"
}, 350);
},
// mouse out
function(){
$(this).parent().stop().animate({
backgroundColor: "#d0d0d0",
color: "#000000"
}, 350);
$(this).stop().animate({
backgroundColor: "#d0d0d0",
color: "#006699"
}, 350);
});
</code></pre>
|
javascript
|
[3]
|
5,277,953
| 5,277,954
|
Null Pointer exception in JavaScript
|
<pre><code>var Obj = {
StateValues: ['AL','AK','AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA',
'KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND',
'OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'],
getItemRow: function(itemValue) {
var myPosition=-1
for (var i=0;i<Obj.StateValues.length;i++) {
if(Obj.StateValues[i]==itemValue) {
myPosition = i;
break;
}
}
return myPosition;
}
}
</code></pre>
<p>When i add the function in the code, i get <code>Null Pointer Expection</code>. This piece of code is in a sep file... somename.js and which i include</p>
<p>I am not even using this function anywhere in my other js file... like Obj.getItemRow()</p>
|
javascript
|
[3]
|
5,458,228
| 5,458,229
|
PHP object notation generator similar to json
|
<p>I have some data structure in PHP that I need to dump into a format that can be natively parsed as PHP code. Is there a tool for that?</p>
<p>In other words, is there a PHP data structure formatter that would output PHP object notation code, a sort of "PSON" for PHP similar to what JSON is for JavaScript?</p>
|
php
|
[2]
|
4,895,516
| 4,895,517
|
Understand Python Function
|
<p>I'm learning Python and wanted to see if anyone could help break down and understand what this function does step by step?</p>
<pre><code>def label(self, index, *args):
"""
Label each axes one at a time
args are of the form <label 1>,...,<label n>
APIPARAM: chxl
"""
self.data['labels'].append(
str('%s:|%s'%(index, '|'.join(map(str,args)) )).replace('None','')
)
return self.parent
</code></pre>
|
python
|
[7]
|
3,732,192
| 3,732,193
|
How to check whether a particular device supports 4G networks in Android?
|
<p>I want to check if <strong>a particular device has hardware support for 4G networks</strong>. </p>
<p>I will elaborate the issue...<br>
In the application we have a settings page where user can make selection and allow application to run only in selected networks.
Eg. User can select that app will run only in WiFi network or only in 3G network etc. </p>
<p>There are CheckBox preferences for all networks WiFi, 2G, 3G 4G etc.
Now if the device doesn't have the support for 4G network, I want to hide the 4G selection checkbox.<br>
All the remaining functionality is complete. I am struck on just this issue that how to detect if device support 4G or not?<br>
Please note that <strong>I want to detect hardware support for 4G</strong> on the device and NOT the 4G connection is connected or so.<br>
Any help is greatly appreciated.</p>
|
android
|
[4]
|
2,820,400
| 2,820,401
|
Settings required for remote connection
|
<p>I wanted to know what are the basic settings/configuration required by server so that other computer can connect to server only through event Viewer.
Also basic permissions required for user to connect to the server through event viewer.
NOTE: The user doesnt have an RDC to </p>
|
asp.net
|
[9]
|
4,081,310
| 4,081,311
|
setTimeout to print consecutive numbers: Closure
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5226285/settimeout-in-a-for-loop-and-pass-i-as-value">setTimeout in a for-loop and pass i as value</a> </p>
</blockquote>
<pre><code>for(i=0;i<5;i++){
setTimeout(
function(i){
console.log(this.i)
},1000);
}
</code></pre>
<p>This is printing 5 for 5 times. How to make this print 0,1,2,3,4?</p>
|
javascript
|
[3]
|
4,183,045
| 4,183,046
|
structure in template class
|
<p>sample code is as follow:</p>
<pre><code>struct TEMP
{
int j;
TEMP()
{
j = 0;
}
};
template<typename T>
class classA
{
struct strA
{
long i;
strA():i(0) {}
};
static strA obj_str;
classA();
};
template<typename T>
classA<T>::classA()
{}
template<typename T>
classA<TEMP>::strA classA<TEMP>::obj_str;
int main()
{
return 0;
}
</code></pre>
<p>while compiling this code, I am getting following error:</p>
<blockquote>
<p>test1.cpp:32: internal compiler error: in import_export_decl, at cp/decl2.c:1970
Please submit a full bug report,
with preprocessed source if appropriate.
See http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccUGE0GW.out file, please attach this to your bugreport.</p>
</blockquote>
<p>I am building this code at x86_64-redhat-linux machine, and gcc version is gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)</p>
<p>Please note this code was already built with gcc version 3.4.5 20051201 (Red Hat 3.4.5-2) at i386-redhat-linux machine.</p>
<p>Any idea why this is not able to build with gcc 4.1.2.</p>
<p>Thanks in advance.</p>
|
c++
|
[6]
|
3,400,916
| 3,400,917
|
Where to get NavUtil Class?
|
<p>I am looking to use <code>NavUtils (http://developer.android.com/reference/android/support/v4/app/NavUtils.html)</code> in the <code>v4 android compatibility libraries for Efficency Navigation</code>. It seems that the <strong>v4 jar does not contain this class</strong>. Further, it seems that NavUtils is not in the master branch of the android support project. </p>
<p>Can anyone tell me how to get NavUtils ? </p>
|
android
|
[4]
|
1,779,885
| 1,779,886
|
jQuery: How to get return value of function as value of id attribute?
|
<p>I'm trying to create a new tr element and set it's id attribute to the last id in the table of my MySQL db.</p>
<p>Here's what I have, but this does not set the id properly:</p>
<pre><code>$('<tr>').html(response)
.attr('id',function(){
var daId;
$.get(
'/getlastid.php',
null,
function(response){
daId = response;
alert(daId); //this shows correct id from db
});
return daId;
})
.prependTo('#table-id tbody'); //the tr does not have the id attribute set
</code></pre>
<p>How can I get this working right? The alert proves that my server side code is correct, it's just that the id attribute is not being created for the new row.</p>
|
jquery
|
[5]
|
1,187,426
| 1,187,427
|
how to change backgroundcolor of uibutton programatically
|
<p>I want to change the background color of a button to black.</p>
<p>i have tried so many codes. but didn't works fine.</p>
<p>how it is possible</p>
<p>Regards</p>
<p>K L BAIJU</p>
|
iphone
|
[8]
|
1,248,732
| 1,248,733
|
How to change system brightness?
|
<p>I want change the system brightness using my application. But as soon as i come out of that app. Brightness is again resetted to default value. What shud i do in order to make permanent change to brightness setting? I have tried few ways but all off them only work till my app is not closed. </p>
|
android
|
[4]
|
4,117,761
| 4,117,762
|
Efficient way to verify that records are unique in Python/PyTables
|
<p>I have a table in PyTables with ~50 million records. The combination of two fields (specifically userID and date) should be unique (i.e. a user should have at most one record per day), but I need to verify that this is indeed the case.</p>
<p>Illustratively, my table looks like this:</p>
<pre><code>userID | date
A | 1
A | 2
B | 1
B | 2
B | 2 <- bad! Problem with the data!
</code></pre>
<p>Additional details:</p>
<ul>
<li>The table is currently 'mostly' sorted.</li>
<li>I can just barely pull one column
into memory as a numpy array, but I
can't pull two into memory at the
same time.</li>
<li>Both userID and date are integers</li>
</ul>
|
python
|
[7]
|
5,672,455
| 5,672,456
|
BigInt with specificied bit length
|
<p>I have used "BigInteger" library which is downloaded from "http://projectdistributedsystems.googlecode.com/svn-history/r94/trunk/src/misc/BigInt".</p>
<p>I have to create a <code>bigInt</code> which is exactly 125 bits. (In java we use <code>new BigInteger(125, randomNumber)</code> which create a 125 bit BigInteger object).</p>
<p>In C++ i used </p>
<pre><code>BigUnsigned *no= new BigUnsigned(myBlocks, 1);
no->setBlock(3, randomNumber);
</code></pre>
<p>But it can't produce a BigUnsigned number with exact 125 bits.
Can anyone help create a BigUnsigned number with specified bits? </p>
<p>Thanks in advance.</p>
|
c++
|
[6]
|
2,519,254
| 2,519,255
|
How do I add another intent and how do I call this receiver in code?
|
<p>I have following receiver that listens to Boot_Completed </p>
<pre><code><receiver android:name=".receivers.ActionBootCompletedReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<category android:name="android.intent.category.HOME"/>
</intent-filter>
</receiver>
</code></pre>
<p>I want to add another intent-filter with my own custom action. And make it private to my app if possible. This is mostly for code reuse so I can run same code path as when BOOT_COMPLETED.</p>
<p>So, I need following (if it's even possible)
1. intent-filter and make it private to my app
2. Code to send that intent so my receiver get's it.</p>
<p>Thanks!</p>
|
android
|
[4]
|
4,396,965
| 4,396,966
|
PHP - How to Automatically Post Form in Another Website and Parse the Result
|
<p>I am planning to create a website like what <a href="http://dohop.com" rel="nofollow">http://dohop.com</a> is doing that will allow a user to pull the airlines price rate and date from the <a href="http://airasia.com" rel="nofollow">http://airasia.com</a> website. Currently the site will only allow the user to view the flight schedule for one day and if they wish to view x days ahead they need to repost the data.</p>
<p>I would like to collect the data in x days ahead and group them in table so that user can view all the flight prices & schedule variances in one screen without reposting.</p>
<p>I have checked the <code>AirAsia.com</code> site and they currently don't have any API support which would allow me to extract their data. While they are using 'aspx' for their website and POST method.</p>
<p>Can anyone give me some guidance on what is the method, approach or technique for me to harvest the data?</p>
|
php
|
[2]
|
3,826,586
| 3,826,587
|
Get install app information
|
<blockquote>
<p>How can I find all information of install for ex: if my mobile has “angry birld” then I >want to get appname, packagename, versionname, versionname, date ,icon etc… </p>
</blockquote>
|
android
|
[4]
|
1,288,568
| 1,288,569
|
When new a Form, will I get a process or thread?
|
<p>In C#, I have two Forms: mainForm and form1. </p>
<pre><code>class Form1; //...
class mainForm {
//...
void f() {
Form1 form1 = new Form1();
...
}
}
</code></pre>
<p>I want to wait for the form1 to exit and continue the following work in the mainForm. But I don't know the form1 is implemented as a process or a thread and how to get its ID.</p>
<p>Thanks.</p>
|
c#
|
[0]
|
228,165
| 228,166
|
Check if specific input file is empty
|
<p>In my form I have 3 input fields for file upload:</p>
<pre><code><input type=file name="cover_image">
<input type=file name="image1">
<input type=file name="image2">
</code></pre>
<p>How can I check if <code>cover_image</code> is empty - no file is put for upload?</p>
|
php
|
[2]
|
4,715,094
| 4,715,095
|
User control page_load event invoked before the Button click event of the aspx page
|
<p>I want to assign property value on button click in aspx page and want to pass the value to the usercontrol and than bind data according to the Property value.
But the problem is before button click event is fired the page_load of user control is invoved ? is the any way to call the page_load of user control again on button click or is there anyother alternative to do it ?
Thanks</p>
|
c#
|
[0]
|
5,050,195
| 5,050,196
|
check if compilator supports boost library
|
<p>i am using visual c++ 2010 and want to check if it supports boost library and if not how download it?can i do it?</p>
|
c++
|
[6]
|
1,993,421
| 1,993,422
|
Difference between innerHTML and .html() from jQuery
|
<p>Can somebody tell what is the difference between jquery .html() function and innerHTML?</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$('#test_link').click(function(){
//$('#div_test_out').html("<div width='250px' height='100px' id='div_test'><script language='javascript'>alert('insider');<\/script>asddsa</div>");
document.getElementById('div_test_out').innerHTML="<div width='250px' height='100px' id='div_test'><script language='javascript'>alert('insider');<\/script>asddsa</div>";
});
});
</script>
<a href="#" id="test_link" >TEST LINK :-)</a><br/><br/>
<div width="100px" height="100px" id="div_test_out"></div>
</code></pre>
<p>When I use first option, that is jQuery, script inside runs, and alert shows up, but if I use second option that with the innerHTML (which I though is the same and there is no difference between them), script is not working ;-(</p>
<p>What could be the cause?</p>
|
jquery
|
[5]
|
3,335,959
| 3,335,960
|
Implement a top level window from a broadcast receiver
|
<p>I have a broadcast receiver that listens for incoming calls, then displays a popup. The popup is a dialog type of theme and has FLAG_NOT_FOCUSABLE and FLAG_NOT_TOUCHABLE - basically, it's an informational window that goes away after x seconds, and is not meant to interfere or take focus over anything else.</p>
<p>The issue is that the incoming call intent, built into android, is getting the broadcast <em>after</em> my intent. This is causing that window to be stacked in front of mine. How to I get my window to always be on top?</p>
<p>Thanks! </p>
|
android
|
[4]
|
4,769,005
| 4,769,006
|
How to detect if a microphone is present in android?
|
<p>I have a voice recognition part in my application to capture users voice input.</p>
<p>This is what I do</p>
<pre><code>Intent voiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
startActivityForResult(voiceIntent, REQUEST_CODE);
</code></pre>
<p>This works fine on most of the devices but now since the tablets are getting popular and some of them do not have a mic, it throws an error</p>
<blockquote>
<p>W/dalvikvm( 408): threadid=1: thread
exiting with uncaught exception
(group=0x40015560) E/AndroidRuntime(
408): FATAL EXCEPTION: main
E/AndroidRuntime( 408):
android.content.ActivityNotFoundException:
No Activity found to handle Intent {
act=android.speech.action.RECOGNIZE_SPEECH
(has extras) } E/AndroidRuntime(
408): at
android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
.....</p>
</blockquote>
<p>So I want to detect if the microphone is present before I let the user access the voice input feature. How can I detect if a microphone is present on the device.</p>
<p>Thank you.</p>
|
android
|
[4]
|
1,802,300
| 1,802,301
|
jquery change img attribute name without loosing atribute values
|
<h2>Background</h2>
<p>I generate dynamic php gallery in which it is possible to drag images by using jquery UI.</p>
<p>All images has option to be cropped.</p>
<p>Image that are listed first in a gallery are the "title image" of the gallery and have a different crapping ratio as non "title images".</p>
<h2>Problem</h2>
<p>I echo out all images with attribute <code>'ondblclick="open_original=(21, 153)"'</code>.
I need to figure out how i can change <code>open_original</code> to <code>open_original_main</code> only for the first images of the gallery so they can have different cropping ratio.</p>
<p>If I use <code>.attr()</code> then i lose all my attribute values and i cant get them back. Is there any way to just replace their function names?</p>
<p>My jquery for this problem so far:</p>
<pre><code>$(".galOf .gallery_nav:first-child .img_thumb img").ready(function(){
$(this.ondblclick).replace("open_original","open_original_main");
});
</code></pre>
<p>I know <code>.replace()</code> is not a function, just read info....</p>
|
jquery
|
[5]
|
4,169,353
| 4,169,354
|
Python approach to dataset manipulation
|
<p>Folks, we have the following problem: we've got several objects containing table data that look something like this:</p>
<p><code>{'field1':'value1','field2':'value2', ...}</code></p>
<p>At some point during runtime we need to "select" data from these objects (tables) in the same way one were to query a DB (i.e. get records in this set that matches field1 == some_value and field2==some_other_value). We don't have access to the original RDBMS or db views. We fiddled with the idea of using an intermediary DB (like sqlite) and then query it for the data as needed. </p>
<p>But it felt "smelly" to add another moving part to the app just for dataset querying purposes. So, my question is: is there a pythonic way to approach this? Should we bite the bullet and push the data to a DB, query the DB, then delete? Thanks in advance for your opinion and input.</p>
<p>The data is a list of dictionaries.</p>
|
python
|
[7]
|
853,110
| 853,111
|
need to copy files on client system, is thr any possible way?
|
<p>dear frnds
I m developin an Online Examination System in C#.net and want to copy files on client machine as soon as exam starts, so that even if internet gets disconnected examinee can continue with test</p>
|
asp.net
|
[9]
|
3,549,888
| 3,549,889
|
Loading holding page before main content is displayed?
|
<p>I am creating a site that pulls various feeds from the web, while these feeds are being loaded I would like to display a holding page that says loading and then disappears presenting the loaded feeds, can anyone point me towards any tutorials for this or any advice on how to achieve this using jQuery?</p>
|
jquery
|
[5]
|
1,949,488
| 1,949,489
|
iphone memory management
|
<p>1.UIImageView *img1=[[UIImageView alloc]initwithImage:[UIImage imageNamed:@"1.png"]];</p>
<p>2.UIImageView *img2=[[UIImageView alloc]initwithImage:[UIImage imageNamed:@"2.png"]];</p>
<p>a) img1.image = [UIImage imageNamed:@"2.png"];</p>
<pre><code>b) [img1 setImage:img2];
</code></pre>
<p>which way utilizes minimum memory among a and b?why?</p>
<p>if i need to do this multiple times which way you suggest?</p>
|
iphone
|
[8]
|
504,949
| 504,950
|
Determine if a key is currently pressed
|
<p>I have a need to determine if a key is currently being pressed. I do not need an event to fire, I simply need to determine if a key is being pressed to decide a code path. I looked around and there are some great GlobalKeyHook classes however they are event based.</p>
<p>Little example, basically I need to determine if the user is holding a key down when my app starts and if so then the app does one thing, other wise it starts up as normal. Does anyone have any idea's? I am using C#.</p>
<p>Thanks
Patrick</p>
|
c#
|
[0]
|
1,337,251
| 1,337,252
|
PHP:I want to run a function every 30sec's without using a for loop
|
<p>php has header('refresh:30')</p>
<p>When i'm getting data from a form via post,the array resets on refresh(when i use header-refresh)</p>
<p>I was looking for a setTimeOut(in javascript) sorta tool in php or a way to persist a variable got from the user(form data) even after a refresh.</p>
<p>-- Php Beginner</p>
|
php
|
[2]
|
5,484,976
| 5,484,977
|
Can Array contain only a single key value pair?
|
<p>I have declared a method where it will dynamically create a database query string depending on the table my code is something like this.</p>
<pre><code>public function checkBeforeDelete($table = array(), $key , $value )
{
$tableCount = count($table);
$queryString = array();
for($i=0;$i<$tableCount;$i++)
{
$queryString[] = "(SELECT COUNT(*) FROM $table[$i] WHERE $key = $value)+";
}
/***********************************************************
Convert the array to a string using implode()
Remove all commas(,) using str_replace()
Remove the last character of string using substr_replace()
***********************************************************/
$queryString = substr_replace(str_replace(',','',implode(',',$queryString)),'',-2);
$queryString = 'SELECT ( '. $queryString . ' ) AS sum';
$sth = $this->dbh->prepare($queryString);
$sth->execute();
return $sth->fetchColumn() >= 1;
}
</code></pre>
<p>there are chances when $table array() will have only one single value for example </p>
<pre><code>$table = array('states');
</code></pre>
<p>does it still count to be an array. is it alright if an array contains only a single key value pair?</p>
|
php
|
[2]
|
1,434,592
| 1,434,593
|
Inheriting from std::vector
|
<p>There are many answers on here saying not to inherit from std::vector and alike such as <a href="http://stackoverflow.com/questions/10353954/potential-problems-with-inheriting-from-stdvector">this question</a>. I understand the reasons and agree with them. However in <a href="http://isocpp.org/files/papers/4-Tour-Algo-draft.pdf" rel="nofollow">here</a> Section 4.4.1.2 Bjarne Stroustrup himself inherits from std::vector to add range checking.</p>
<p>Is that a special case, or just something that's ok in that context or something that he really ought not be doing :P </p>
|
c++
|
[6]
|
4,328,992
| 4,328,993
|
How to assign an object function to a variable?
|
<pre><code>class example()
{
function shout($var)
{
echo 'shout'.$var;
}
function whisper($var, $bool)
{
if($bool)
{
echo $var;
}
}
}
$obj = new example();
if($var)
{
$func = $obj->shout();
}else
{
$func = $obj->whisper();
}
</code></pre>
<p>I want to prepare the function variable first for later use instead of putting conditions in a loop. Is there a possible way to do it?</p>
|
php
|
[2]
|
1,394,336
| 1,394,337
|
I obtain different results from dynamic_cast when using different compilers
|
<p>The assertion in the following program gives different results according to the compiler used: in GCC 4.4 the assertions fails, while in CLang does not. It looks like GCC does not like V being private in C. Is this a bug?</p>
<pre><code>#include <cassert>
class V {
public:
virtual ~V() { };
};
template<class T>
class C : public T, private V {
public:
static V* new_() {
return new C();
}
};
struct MyT {
};
typedef C<MyT> C_MyT;
int main(int argc, char** argv) {
V* o2 = C_MyT::new_();
assert(dynamic_cast<C_MyT*> (o2)); // failure in GCC, success in CLang
return 0;
}
</code></pre>
|
c++
|
[6]
|
4,069,964
| 4,069,965
|
looping over all member variables of a class in python
|
<p>How do you get a list of all variables in a class thats iteratable? Kind of like locals(), but for a class</p>
<pre><code>class Example(object):
bool143 = True
bool2 = True
blah = False
foo = True
foobar2000 = False
def as_list(self)
ret = []
for field in XXX:
if getattr(self, field):
ret.append(field)
return ",".join(ret)
</code></pre>
<p>this should return</p>
<pre><code>>>> e = Example()
>>> e.as_list()
bool143, bool2, foo
</code></pre>
|
python
|
[7]
|
2,986,830
| 2,986,831
|
Adding names to an array and outputting them to a table
|
<p>I'm having some trouble getting my code to work. This is what I have so far.</p>
<pre><code>function outputNamesAndTotal() {
var name;
var outputTable;
var inputForm;
var nameArray;
var outputDiv;
outputDiv = document.getElementById("outputDiv");
inputForm = document.getElementById("inputForm");
outputTable = document.getElementById("outputTable");
name = inputForm.name.value;
nameArray = [];
nameArray.push(name);
for (var i = 0; i > nameArray.length; i++) {
outputTable.innerHTML += "<tr>" + nameArray[i] + "</tr>";
}
inputForm.name.focus();
inputForm.name.select();
return false;
}
</code></pre>
<p>When I add the loop it breaks the code completely, but I can't figure out why.</p>
<p>What I'm trying to do is use an HTML form to get a name from the user. Once the user enters the name, the program adds the name to the array, and outputs each array entry to a row in a table.</p>
<p>It's pretty basic, but it's still giving me all kinds of trouble! </p>
|
javascript
|
[3]
|
841,360
| 841,361
|
Change z-index infinitely in jQuery
|
<p>I am a bit new to jQuery but I need to write a small custom image rotator. Basically I will have a small stack of .png images that look like Polaroids. The rotator will need to pull the top one off, move it to the right, set the Z-index lower than the other two, then move it back over...just like you would if you were looking through a stack of pictures.</p>
<p>Most of this I think I can do, but the problem I'm not quite getting is that I will need to continually swap the Z-index of these 3 images (move top image to right, reset z-index lower than the other two, move back)</p>
<p>In the HTML I have the following:</p>
<pre><code><img src="images/polariod_1.png" width="255" height="260" alt="Singer" class="headerrightgraphic">
<img src="images/polariod_2.png" width="255" height="260" alt="Singer" class="headerrightgraphic">
<img src="images/polariod_3.png" width="255" height="260" alt="Singer" class="headerrightgraphic">
</code></pre>
<p>Any leads on how I can change the z-index on these in an elegant way without hard coding it over and over?</p>
|
jquery
|
[5]
|
1,344,954
| 1,344,955
|
iPhone Contact Syncing
|
<p>Everytime I sync my iPhone, any contacts I have deleted from my iPhone reappear, like the old contacts are added back. New contacts remain.</p>
|
iphone
|
[8]
|
1,110,154
| 1,110,155
|
UITouch question. Is it possible to disable multiple tapping
|
<p>I would like to have each UITouch instance record a single tap. In other words, regardless of how close multiple taps occur in time, I would like them each to create a unique touch instance. Is this possible?</p>
<p>Thanks,
Doug</p>
|
iphone
|
[8]
|
1,326,063
| 1,326,064
|
Android on ubuntu with eclipse
|
<p>I got HTC Desire phone, and i want to be able to run my application (developing ob eclipse or netbeans) on it. But when i run my applications i see (in the list of running devices ??? in 'name' column and ??? in status column. So i can<code>t press OK button (it</code>s just disabled). Please tell me how can i make normal synchronization???</p>
|
android
|
[4]
|
1,188,389
| 1,188,390
|
How can I optimize my javascript code?
|
<p>I have created the following jquery toggle box show/hide function. But I know that I have redundant code, and I want to make it as short and effective as possible. This is just my attempt to learn to code <em>right</em> fron the start...</p>
<p>HTML:</p>
<pre><code><div>
<ul>
<li><a id="areaPta">Pretoria</a></li>
<li><a id="areaPotch">Potch</a></li>
<li><a id="areaJhb">JHB</a></li>
</ul>
</div>
<div>
<div class="hidden" id="pretoriaDetail">Pretoria Content</div>
<div class="hidden" id="potchDetail">Potch Content</div>
<div class="hidden" id="jhbDetail">JHB Content</div>
</div>
</code></pre>
<p>CSS:</p>
<pre><code>.hidden{
display: none;
}
</code></pre>
<p>JS:</p>
<pre><code>$(function() {
var p = $('#areaPta');
var po = $('#areaPotch');
var j = $('#areaJhb');
p.click(function (){
$('.hidden').hide(500);
$('#pretoriaDetail').show(500);
});
po.click(function (){
$('.hidden').hide(500);
$('#potchDetail').show(500);
});
j.click(function (){
$('.hidden').hide(500);
$('#jhbDetail').show(500);
});
});
</code></pre>
|
jquery
|
[5]
|
3,168,511
| 3,168,512
|
Display more than one images from drawable folder to view default imageviewer in android
|
<p>i want to display more than one images in android default imageviewer.i am view one image from sdcard to default android imageviewer.i want to display more than one images from drawable folder if it's not possible or how to view images from sdcard folder like if images folder contain more than one images to view all images in default imageview in android.</p>
<p>here's code for view image from sdcard to android default image viewer:</p>
<pre><code> Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + "/sdcard/slide-4.jpg"), "image/*");
startActivity(intent);
</code></pre>
<p>i want to show more than images from drawable folder or any sdcard folder or assets folder can help me greatly appreciated!</p>
<p>Thanks in Advance!</p>
|
android
|
[4]
|
2,010,958
| 2,010,959
|
... Pause button?
|
<p>I have an android game that relies on touching the major areas of the screen, so I had initially implemented a system for pausing that relied on physical keys/buttons (press "up" to pause). I knew this was a bad idea, but was unsure as to how I might implement a touchable pause "button." Ideas?</p>
<p>Here is the code (onKeyDown toggles Overlay [my pause screen] in the level class):</p>
<pre><code>@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ( event.getAction() == MotionEvent.ACTION_DOWN && (
keyCode == KeyEvent.KEYCODE_DPAD_UP ||
keyCode == KeyEvent.KEYCODE_MENU
) ) {
toggleOverlay();
return true;
} else
return super.onKeyDown(keyCode, event);
}
</code></pre>
|
android
|
[4]
|
793,502
| 793,503
|
Go back to default state if nothing is selected
|
<p>I have a results page with 2 columns: LEFT COLUMN contains a list of items that help the user filter his results. RIGHT COLUMN contains all the results. </p>
<p>By default, there are no items selected in the left column, hence, there are no results to show/filter on the right column. There are, however, some instructions that tell the visitor how to use the filters or items on the left column to see his results in the right column.</p>
<p>As of right now, I am capable of hiding the DIV that contains the results upon entering the page while having the instructions visible, and once the user clicks on an item in the left column, then hide the instructions and start showing the results.</p>
<p>My problem is that I don't know how to go back to the 'default' state if no items are selected. How do I show the instructions again once the user decides to clear all his filters?</p>
<p>Does this make sense? Let me know if you need me to explain more.</p>
<p><a href="http://www.jsfiddle.net/CDkcB/3/" rel="nofollow"><strong>- Live Demo here -</strong></a></p>
|
jquery
|
[5]
|
4,185,961
| 4,185,962
|
How to Separate the Profile Details
|
<p>I try to read education details from face book using JSON in IPhone.</p>
<p>I read all education details from Face book successfully.</p>
<p>But i get the whole details. I want to separate the school, college {PG and UG}. But the node having same name like school. and also the data wil be read first one school, and then read one college, then again read one school and read one college like that. somebody fill one school more than one college. somebody wil fill more than one school and one college, somebody wont fill school or college. some id having same number of schools and college. some id having different number of schools and college. So how to I identify the schools and college details separately. Please if anybody having any idea please share with me.</p>
<p>MY Doubt is how to identify the schools, and college and then print schools and college separately...</p>
<p>My sample output as follows..</p>
<p>"education":
[
{
"school":
{
"id":110402725649312,
"name":"10th class"
},
"year":
{
"id":102356633142124,
"name":"2001"
}
},
{
"school":
{
"id":111983532181734,
"name":"Bsc Maths"
},
"year":
{
"id":146950445337693,
"name":"2006"
},
},
{
"school":
{
"id":115980035092981,
"name":"+2"
},
"year":
{
"id":114786038555902,
"name":"2003"
}
},
{
"school":
{
"id":130814456944277,
"name":"mca"
},
"year":
{
"id":115598488468394,
"name":"2010"
},
}
}]</p>
<p>Thanks to all...</p>
|
iphone
|
[8]
|
4,902,793
| 4,902,794
|
how to assign the hover to 2 elements
|
<p>I am trying to assign hover event to 2 elements at the same time. Are there better ways to do this?</p>
<pre><code>//I want to assign hover to another element.
$element1=$('hi');
$element2=$('hi2');
//I need to assign element 1 and element 2 to the same hover function...
$element1.hover(function(e){
codes......
})
</code></pre>
<p>Thanks for any helps.</p>
|
jquery
|
[5]
|
3,123,963
| 3,123,964
|
add item to my stringarray
|
<p>I have my category_array(String array) in my String.xml file.
I use this string-array to populate a listview.</p>
<pre><code><string-array name="category_array">
<item >Airplane</item>
<item >Train</item>
<item >Taxi</item>
<item >Bus</item>
<item >Food</item>
<item >Drink</item>
<item >Meeting Entrata</item>
</string-array>
</code></pre>
<p>Can I add an item getted from an editText from my Activity, to my category_array??</p>
|
android
|
[4]
|
392,233
| 392,234
|
code to view current online users is not giving proper output
|
<p>i have written a code to view online users in asp.net(vb) but when page gets run it doesn't show proper output,it only shows 3 users online,if more pages are open then also it shows same.i have pasted the code below.please help me.</p>
<pre><code>Public Class Global_asax
Inherits System.Web.HttpApplication
Dim i As Integer
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
Application("hitcount") = 0
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
i = Application("hitcount")
Application.Lock()
i = i + 1
Application("hitcount") = Application("hitcount") + 1
Application.UnLock()
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
Application.Lock()
If Application("hitcount") > 0 Then
Application("hitcount") = Application("hitcount") - 1
Application.UnLock()
End If
End Sub
Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application ends
'Application.UnLock()
End Sub
End Class
</code></pre>
|
asp.net
|
[9]
|
760,490
| 760,491
|
PHP Converting GMT to IST
|
<p>Can i convert GMT to IST in PHP without using PEAR.</p>
<p>Here is how i get GMT <code>gmdate()</code>, now how do i convert it to IST.</p>
<p>Thanks</p>
|
php
|
[2]
|
1,783,315
| 1,783,316
|
operator precedence and associativity with Math.Floor(Math.Random())
|
<p>I understand how the code works, in terms of the results it gives. First, it gets a random number, and, second, using Math.floor() it rounds down the results of Math.Random. Therefore, it's moving from right to left through the code. </p>
<pre><code>Math.floor(Math.Random * num);
</code></pre>
<p>In the JavaScript Reference at this <a href="http://www.javascriptkit.com/jsref/precedence_operators.shtml" rel="nofollow">url</a> and shown in the image below
<img src="http://i.stack.imgur.com/Hgyks.png" alt="url"></p>
<p>it says that, for dot and parentheses, the associativity is "left to right". However, based on the code I excerpted above, I'd say it was "right to left." Please explain</p>
|
javascript
|
[3]
|
3,215,308
| 3,215,309
|
SDK for MediaTek
|
<p>How can we get (paying) the SDK for MediaTek 6223/6225/6235?</p>
<p>Regards,</p>
<p>Carlos Paz
lorgot at hotmail dot com</p>
|
iphone
|
[8]
|
2,521,620
| 2,521,621
|
Triggering jquery event function at page load
|
<p>Here's a little jQuery function that does what I want when a checkbox is clicked, but I have a basic gap in my knowledge: </p>
<p>How to register this so that it deals with checkboxes that are already clicked when the page loads? </p>
<p>(<strong>Edit:</strong> Sorry, to those who already answered the question, but i've edited this to make it more clear)</p>
<pre><code>$(document).ready(function() {
$('fieldset input:checkbox').click(function() {
if ($(this).attr('name') == 'foo') {
if ($(this).attr('checked')) {
// hide checkbox 'bar'
}
else {
// show checkbox 'bar'
}
}
}
});
</code></pre>
<p>If I use .trigger('click'), it clicks (or unclicks) all the boxes on page load.</p>
<p>I can think of a few ways to do this that would involve repeating portions of the code, but I just know that jQuery already has an elegant answer for this...</p>
|
jquery
|
[5]
|
2,092,146
| 2,092,147
|
Arrow icon missing back-to-top javascript?
|
<p>I have a problem with my website, <a href="http://www.gameamv.com" rel="nofollow">www.gameamv.com</a>.</p>
<p>Lower right corner, I had the back-to-top arrow icon called icon-chevron-up which looks like this ( ^ )</p>
<p>I did some CSS changing and cannot figure out why it disappeared? I've been back tracking for an hour and nothing. Can anyone help?</p>
|
javascript
|
[3]
|
3,071,899
| 3,071,900
|
Java Generic Types
|
<p>How to code a list that has a method, i.e. sum(), that returns the sum of the element(s) in the list if all element(s) in the list are integer or number, and returns the concatenation of string of characters if all element(s) in the list are string (type) using Java to implement the concept of polymorphism in Java? Thanks for helping.</p>
|
java
|
[1]
|
1,480,477
| 1,480,478
|
How to decode text?
|
<p>Hi guys I have a json response from server with such text:</p>
<pre><code><div class=\"profile-info\">\u0413\u043e\u0440\u043e\u0434: \u041a\u043e\u0432\u0440\u043e\u0432<\/div>
</code></pre>
<p>How to decode <code>\u0413\u043e\u0440\u043e\u0434: \u041a\u043e\u0432\u0440\u043e\u0432</code>?</p>
|
c#
|
[0]
|
5,712,684
| 5,712,685
|
Set running time limit on a method in java
|
<p>I have a method that returns a String, is it possible that after a certain time treshold is excedeed fot that method to return some specific string? </p>
|
java
|
[1]
|
4,514,350
| 4,514,351
|
How to access an array from within an object?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7027615/accessing-class-properties-with-spaces">Accessing Class Properties with Spaces</a> </p>
</blockquote>
<p>i have and object file and i cant get devices list, How to get <strong>devices</strong>?? how to call 2 wards like "Canon Camera" ?</p>
<pre><code> [Camera] => stdClass Object
(
[Canon Camera] => stdClass Object
(
[DEVICES] => Array
(
[0] => Canon EOS 30
[1] => Canon EOS 5D Mark II
[2] => Canon EOS 7D
[3] => Canon EOS A2
[4] => Canon EOS Digital Rebel (300D)
[5] => Canon EOS Rebel XS
[6] => Canon PowerShot 1200
[7] => Canon PowerShot A200
[8] => Canon PowerShot A520
[9] => Canon PowerShot A550
)
)
</code></pre>
|
php
|
[2]
|
5,624,322
| 5,624,323
|
Php validate with preg_match
|
<p>I try to validate fields. Three fields that may only contain numbers. The fields have the variable names $num1, $num2, $num3. I have put them in an array and then I run preg_match but it does not work. How should I do?</p>
<pre><code>$valnum = array (‘$num1’, ‘$num2’, ‘$num3’);
if (preg_match('/[0-9]/', $valnum)){
echo $mycost;
}
else {
echo 'You can only enter numbers';
}
</code></pre>
|
php
|
[2]
|
5,870,810
| 5,870,811
|
How to quote a string dynamically in Javascript?
|
<p>This kinda funny, i want to quote a string value for a function but javascript throws this error <code>Uncaught SyntaxError: Unexpected token }</code></p>
<p>This my code</p>
<pre><code>var val = "Testing String";
var table_row = "<tr><td><a href='#' onclick='test('"+val+"')'>Row1</a></td></tr>";
function test( val ){
alert( val );
}
</code></pre>
<p>The table row get created fine with the test function bound well with onClick event.
But when i click on the created link i get</p>
<pre><code>`Uncaught SyntaxError: Unexpected token }
</code></pre>
<p>The Value within the test function should be a quoted string.</p>
<p>Note: If i remove the concatenation of the val string, and pass is as a string like this </p>
<pre><code>table_row = "<tr><td><a href='#' onClick='test(\"Testing String\")' >Row1</a></td>";
</code></pre>
<p>... it works</p>
<p>Where am i goofing?</p>
<p>Gath.</p>
|
javascript
|
[3]
|
2,686,406
| 2,686,407
|
How to call Activity from a menu item in Android?
|
<p>I'm attempting to call startActivity(myIntent) from the click of a menu button but my application crashes at that point.</p>
<p>The same startActivity call works fine from a regular button click, so, I assume the menu button is missing information about the context? Or maybe I'm totally off the mark here.</p>
<p>So... what's the correct way to have a menu item take me to a specific Activity?</p>
<p>I've revised my code based on the initial set of advice. Still crashing in the same place. The debugger doesn't enter the exception clause, the app just dies. </p>
<p>[EDITED WITH CODE SNIPPET]</p>
<pre><code>public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
try{
switch (item.getItemId()) {
case R.id.menuItemLang:
startActivity(new Intent("com.my.project.SETTINGS"));
return true;
default:
return super.onOptionsItemSelected(item);
}
}catch(Exception e){
log(e);
}
}
</code></pre>
|
android
|
[4]
|
56,186
| 56,187
|
Library to translate using google or other service?
|
<p>Is there a PHP script or library or API to use google translate or other similar service?</p>
<p>I need to translate a few words stored in an array:</p>
<pre><code>$toTranslate = array(
'word1',
'word2',
'word3',
'word4'
);
</code></pre>
|
php
|
[2]
|
1,810,372
| 1,810,373
|
How to filter list using Predicate
|
<pre><code>private static class FilterByStringContains implements Predicate<String> {
private String filterString;
private FilterByStringContains(final String filterString) {
this.filterString = filterString;
}
@Override
public boolean apply(final String string) {
return string.contains(filterString);
}
}
</code></pre>
<p>I have a list of Strings, I want to filter it by the specified String so the returned value contains a list of only the specified strings. I was going to use a predicate as above but not sure how to apply this to filter a list</p>
|
java
|
[1]
|
586,638
| 586,639
|
keypress not working in ie7/8
|
<p>simple question - </p>
<p>This will not seem to work in ie7/8. <a href="http://jsfiddle.net/XvXpE/1/" rel="nofollow">http://jsfiddle.net/XvXpE/1/</a></p>
<p>Any idea why? Or what I can do to fix it?</p>
|
javascript
|
[3]
|
5,135,666
| 5,135,667
|
In Javascript, how to explain 0 == "" returning true?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7605011/why-is-0-true-in-javascript">Why is 0 == “” true in JavaScript</a> </p>
</blockquote>
<p>The following is done in Firebug:</p>
<pre><code>>>> 0 == ""
true
>>> "" == false
true
</code></pre>
<p>But how did the <code>""</code> get converted to <code>0</code>? I think the reason they both returned <code>true</code> was that <code>""</code> gets converted to <code>0</code>, and in the first case, it becames <code>0 == 0</code>, and in the second case, first to <code>"" == 0</code> and then <code>0 == 0</code> and so both cases returned true, but how did <code>""</code> get converted into <code>0</code>? The Javascript Definitive Guide says the string is converted to a number, but how specifically?</p>
|
javascript
|
[3]
|
5,449,736
| 5,449,737
|
Image Uploading
|
<p>i want to upload an image from the client's system, through javascript and store that image on the client side (local storage) not at the server side..and before uploading that image i want to preview that image also...any help will be awesome...
Regards: Zain</p>
|
javascript
|
[3]
|
1,629,503
| 1,629,504
|
Read HTML string
|
<p>How to read string in HTML? I need to read character by character until certain condition then
go to the next line.</p>
<p>I found the class <a href="http://msdn.microsoft.com/en-us/library/system.net.webclient%28v=vs.80%29.aspx" rel="nofollow">WebClient</a> </p>
<pre><code>client = new WebClient();
String htmlCode = client.DownloadString("http://localhost:6580/rfcode_zonemgr/zonemgr/api/taglist");
</code></pre>
|
c#
|
[0]
|
5,879,993
| 5,879,994
|
how to replace space with %20 in url in android in jsonparsing
|
<p>In my application i want to replace space with %20 in my string.I tried in this way,</p>
<pre><code>String flag1="http://74.208.194.142/admin/upload_image/1342594079_images (2).jpg";
flag1.replaceAll("", "%20");
</code></pre>
<p>But it is not working please help me.I am getting null pointer exception.</p>
|
java
|
[1]
|
4,217,715
| 4,217,716
|
How to Rename my asp.net web page
|
<p>I have a page name with XYZ.aspx</p>
<p>Now I want to change ABC.aspx how should I do it?</p>
<p>When i directly change it from solution explorer it gives me an error.</p>
<p>Can anyone help me on this?</p>
<p>Thank You </p>
<p>Smartdev</p>
|
asp.net
|
[9]
|
2,394,120
| 2,394,121
|
JavaScript delete confirm box
|
<p>My function is something like this:</p>
<pre><code>function delete(type, id){
if(id){
window.location.href = '/site/'+type+'/delete/'+id;
}
}
</code></pre>
<p>I'm calling it like this:</p>
<pre><code>onclick="delete('position', <?php echo $key;?>)
</code></pre>
<p>Where in the function should I put the Confirm option?</p>
|
javascript
|
[3]
|
3,280,014
| 3,280,015
|
Identity Property in Cayley Table
|
<p>I am working on a project which requires me to discern if the cayley tables in my text files, have identity, associative, inverse, and abelian properties.. I am currently working on the identity function, and while I believe I must use two nested for loops to cycle through the rows and columns of the tables. I am unable to find anything which may push me in the right direction, any help is appreciated. Thanks Jessica</p>
<p>Just wanted to add an update: This is what I finally came up with, posting just in case it could still use work. Many thanks. </p>
<pre><code>group_el Group::getIdentity()
{
for (int i=0; i<order; i++)
{
bool identIsi = true;
for (int j=0; j<order; j++)
{
if ((op(i,j)==i) && (op(j,i)==i)) //if i*j =i same as j*i = i then i is identity
{
return i;
}
else
{
identIsi = false;
}
}
}
</code></pre>
<p>return NO_IDENTITY;
} </p>
|
c++
|
[6]
|
301,051
| 301,052
|
why android emulators are very slow on my computer
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1554099/slow-android-emulator">Slow Android emulator</a> </p>
</blockquote>
<p>is it my computer's hardware limitation? it has 1024 megabytes of ram 2200 x 2 dual core amd cpu i can't develop any android. the emulators are heavy what can I do? i download old sdk and newer ones but it still the same.</p>
|
android
|
[4]
|
2,707,062
| 2,707,063
|
Find the contents of a directory
|
<p>Is it possible to get the contents of a directory with javascript?</p>
|
javascript
|
[3]
|
1,073,665
| 1,073,666
|
PHP load <option> data into <textarea>
|
<pre><code><select name="template" id="template">
<option value="none">Don't use template</option>
<option value="RWT">Report Abuse</option>
<option value="renew">Resend Email Codes</option>
</select><br/>
<textarea name="body" rows="10" id="content" value="<?php echo $body;?>"ondblclick="select_all('content');" cols="40"></textarea><br/>
</code></pre>
<p>....</p>
<pre><code>else if ($template == "renew") {
$body = "Dear $username,<br/></br/>";
$body .= "Here is your requested activation code: $activationID <br/><br/>";
$body .= "Thank you.<br/>";
}
</code></pre>
<p>When I select the option "renew" it doesn't load the data into my textarea. How can I load option data inside the textarea?</p>
|
php
|
[2]
|
86,760
| 86,761
|
Error: expected identifier, string or number
|
<p>I've been working on some javascript functionality for this site: <a href="http://bit.ly/e1oyVV" rel="nofollow">http://bit.ly/e1oyVV</a></p>
<p>Everything is o.k in all browsers except IE 6 and 7 where I'm getting the error: </p>
<p>Error: expected identifier, string or number on line 236, char 3</p>
<p>I have no idea where to start debugging this, Im still learning so the error might be something a bit noob..</p>
<p>The js is in the homeFunctions.js or you can view it in pastebin here: <a href="http://pastebin.com/LDzwKFDm" rel="nofollow">http://pastebin.com/LDzwKFDm</a></p>
<p>The debugger seems to be pointing to the line which closes the homeFunc object... :s</p>
<p>Any help would be greatly appreciated..</p>
|
javascript
|
[3]
|
5,947,000
| 5,947,001
|
How to uncheck a checkbox on unselection of a particular checkbox
|
<p>I want to uncheck checkbox based on unselection of another check box.
ex.</p>
<pre><code> <input id=isActive_1 type=checkbox />
<input id=isActive_2 type=checkbox />
<input id=isActive_3 type=checkbox />
<input id=publish_1 type=checkbox />
<input id=publish_2 type=checkbox />
<input id=publish_3 type=checkbox />
</code></pre>
<p>when i uncheck 'isActive_1' then 'publish_1' should be unchecked at this time.
Please help me out</p>
|
jquery
|
[5]
|
6,022,326
| 6,022,327
|
Assigning values from list to list excluding nulls
|
<p>Sorry for the title but I don't know other way of asking.</p>
<p>EDITED FOR EASY EXPLANATION</p>
<pre><code>public Dictionary<string, string>[] getValuesDB(DataSet ds)
{
Dictionary<string, string>[] info;
Dictionary<string, string>[] temp = new Dictionary<string, string>[ds.Tables[0].Rows.Count];
Dictionary<string, string> d;
string ciclo = "CICLO 02";
try
{
for (int c = 0; c < ds.Tables[0].Rows.Count; c++)
{
d = new Dictionary<string, string>();
OracleConn ora = OracleConn.getInstancia();
DataSet oraDs = ora.getClientByCycle(ds.Tables[0].Columns["IDCliente"].Table.Rows[c].ItemArray[1].ToString(), ciclo);
if (oraDs.Tables[0].Rows.Count > 0)
{
oraDs.Tables[0].Columns[5].Table.Rows[0].ToString();
d.Add("DomID", ds.Tables[0].Columns["DomID"].Table.Rows[c].ItemArray[0].ToString());
d.Add("ClientID", ds.Tables[0].Columns["ClientID"].Table.Rows[c].ItemArray[1].ToString());
d.Add("AccountType", ds.Tables[0].Columns["AccountType"].Table.Rows[c].ItemArray[2].ToString());
temp[c] = d;
}
}
}
catch (Exception eo)
{
}
int count = 0;
for (int i = 0; i < temp.Length; i++)
{
if (temp[i] != null)
count++;
}
info = new Dictionary<string, string>[count];
return info;
</code></pre>
<p><em><strong>NOW I need to get all the non-null values from 'temp' and put it in info</em></strong>
Any idea</p>
|
c#
|
[0]
|
3,922,970
| 3,922,971
|
Cannot access cookie in javascript
|
<p>I created a function to get the cookie in javascript :</p>
<pre><code> function getCookie() {
var arr = document.cookie.split(";");
for (i = 0; i < arr.length; i++) {
if (arr[i].substr(0, arr[i].indexOf("=")).replace(/^\s+|\s+$/g, "") == "taxibleC") {
return arr[i].substr(arr[i].indexOf("=") + 1);
}
}
}
var multipleVAT = 1;
</code></pre>
<p>And then I have another function to initialize the cookie :</p>
<pre><code> function ChangeVATValue()
{
if ($("#vatEnable").is(':checked')) {
multipleVAT = 1;
} else {
multipleVAT = 0;
}
document.cookie = "taxibleC=" + multipleVAT;
alert(getCookie());
}
</code></pre>
<p>When I used <code>alert(getCookie());</code>, It has the value 1.
But when I click to another page, the alert is 0. </p>
<p>Could anyone tell me, why I cannot access the session by using the <code>getCookie()</code> method in the view of my asp.net MVC 3.0 project.</p>
|
javascript
|
[3]
|
1,095,842
| 1,095,843
|
Set an event on item select CheckboxList
|
<p>How to fire an event based on selected item in Checkboxlist (ASP.net 3.5), the OnSelectedIndexChanged in Checkboxlist returns a list of all the selected items, where I need to know just the current selected item.</p>
|
asp.net
|
[9]
|
4,180,939
| 4,180,940
|
how to read a txt file containing matrix form of data into 2d array of same dimensions as in the file using java
|
<p>here is my code:</p>
<pre><code>import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class csvimport5 {
public static void main(String[] args) throws IOException {
double [][] data = new double [87][2];
File file = new File("buydata.txt");
int row = 0;
int col = 0;
BufferedReader bufRdr = new BufferedReader(new FileReader(file));
String line = null;
//read each line of text file
while((line = bufRdr.readLine()) != null && row < data.length)
{
StringTokenizer st = new StringTokenizer(line,",");
while (st.hasMoreTokens())
{
//get next token and store it in the array
data[row][col] = Double.parseDouble(st.nextToken());
col++;
}
col = 0;
row++;
}
System.out.println(" "+data[87][2]);
}
}
</code></pre>
<p>it shows error:-numberformatException :empty string </p>
<p>pls help me</p>
|
java
|
[1]
|
4,979,727
| 4,979,728
|
Simple java program can not be run
|
<p>I am trying to compile and run HelloWorld on linux machin with java version 1.6. I get it compiled but can not run it. I know that the program is at least correct. </p>
<p>Can anybody tell me how to get the silly program run?</p>
<p>I know even this problem had been metioned several times but nowhere found the fix of that problem. Compile command I used: <code>javac ExampleProgram.java</code>.
Run Command I used: <code>java ExampleProgram</code></p>
<pre><code>//A Very Simple Example
class ExampleProgram {
public static void main(String[] args){
System.out.println("I'm a Simple Program");
}
}
</code></pre>
<p>The error:</p>
<pre><code>java -classpath . ExampleProgram
Exception in thread "main" java.lang.UnsupportedClassVersionError: ExampleProgram : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: ExampleProgram. Program will exit.
</code></pre>
|
java
|
[1]
|
3,975,055
| 3,975,056
|
what should i put in this if statment to save the the current array value to a variable
|
<pre><code>if (preg_match('/^([0-9]( |-)?)?(\(?[0-9]{3}\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$/', $buffer, $matches));
{
$variable = ?;
}
</code></pre>
|
php
|
[2]
|
2,021,676
| 2,021,677
|
Android App using WAF
|
<p>I'm a new android app developer and I wanted to know if it's possible to create android apps using Web Application Framework?</p>
<p>if so, are there links for examples?</p>
|
android
|
[4]
|
4,915,438
| 4,915,439
|
How to create Downloading Bar to UIWebview
|
<p>I need to create downloading bar, when URL is loading on UIWebview to my application.</p>
<p>I need to following format when URL is loading time to my application.</p>
<p><img src="http://i.stack.imgur.com/OaOcA.jpg" alt="alt text"></p>
<p>If anybody know the solution for this, please help me.</p>
<p>Thanks.</p>
|
iphone
|
[8]
|
2,541,780
| 2,541,781
|
Synchronize two ListView positions when you scroll from both list views Android
|
<p>I have two ListViews. Is there any way to synchronize the position of ListViews when I scroll both the Lists</p>
|
android
|
[4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.