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,256,629
| 5,256,630
|
BroadcastReceiver + SMS_RECEIVED
|
<p>I'd like my app to catch incoming SMS messages. There are a few examples of this around. Looks like we just need to do this:</p>
<pre><code>// AndroidManifest.xml
<receiver android:name=".SMSReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
// SMSReceiver.java
public class SMSReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "SMS received.");
....
}
}
</code></pre>
<p>is this correct? I'm sending my phone some sms messages, but the log statement never gets printed. I do have some other SMS applications installed on the phone, which display a popup when the sms is received - are they somehow blocking the intent from getting passed down to my app, they are just consuming it completely?</p>
<p>Thanks</p>
|
android
|
[4]
|
4,495,981
| 4,495,982
|
JavaScript problem: getElementsByName() doesn't work for me
|
<p>Just trying to alert the value entered in the phone field, but it alerts undefined:</p>
<pre><code><script type="text/javascript">
function foo() {
alert(document.getElementsByName("phone").value);
return false;
}
</script>
<form action="foo.php" method="post" onsubmit="return foo()">
<label>Name:</label>
<input type="text" name="name" />
<label>Phone:</label>
<input type="text" name="phone" />
<label>Email:</label>
<input type="text" name="email" />
<label>Message:</label>
<textarea name="message"></textarea>
<input type="submit" value="Submit" name="submit" />
</form>
</code></pre>
<p>How to get it to work? Also, I read that getElementsByName is supported in all major browsers, is that true?</p>
|
javascript
|
[3]
|
3,816,302
| 3,816,303
|
Z-order-curve coordinates
|
<p>How could i access data which is being stored using Z-order with O(1) time complexity in array? I need fast access to each of element by their coordinates. I there any faster way to access this data than using while to shift bits?</p>
<p>One way would be using lookup tables (i have static size of data)</p>
<p><strong>EDIT:</strong></p>
<p>One idea i had right now is to store leaves in sequence using y*SIZE+x</p>
<p><strong>EDIT 2.:</strong></p>
<p>I am storying bits in quad tree in std::bitset. I am trying to do checks if some data is available. in matrices of size 128*128. So i can skip bruteforce matrix search for empty data.</p>
|
c++
|
[6]
|
5,580,440
| 5,580,441
|
Login system with shopping cart
|
<p>For exmaple, we've got site that sells car's wheels. I'm not registered there and add wheel to shopping cart (it's stored in <code>cookie</code>). After I login, I get this wheel in my account shopping list. </p>
<p>What seems wrong: what if someone else has added another wheel from my computer and I'll get it in my shopping list after login.</p>
<p>Can't understand, how to solve this situation.</p>
|
php
|
[2]
|
3,460,193
| 3,460,194
|
what are all the web application present which is similar to jquery?
|
<p>Hi
I am looking for some web application which is similar to jquery is there any</p>
|
jquery
|
[5]
|
4,343,004
| 4,343,005
|
Monitoring Android activity life-cycle callbacks
|
<p>I want to be able to launch an arbitrary app from a program (e.g. by executing the command "am start ", then have the program be notified in some way when the life-cycle callbacks (e.g. onStart, onStop) in the app's activity are called.</p>
<p>The problem is that I can not rely on having the app's source code, so can not modify it to add code to the app's implementations of those callbacks.</p>
<p>Is there any way to do this without modifying the Android activity manager, or writing a custom activity manager?</p>
|
android
|
[4]
|
2,929,422
| 2,929,423
|
Android SDK and fresh install
|
<p>I'm looking into buying an Android phone and I'd like to do some development on it as well. Is it possible to perform a fresh clean install on any Android device via the SDK? In other words, is it possible to remove the preloaded OS (i.e. with additional provider software) and install the standard Android OS?</p>
<p>Thanks</p>
|
android
|
[4]
|
3,956,050
| 3,956,051
|
How to create dynamic text?
|
<p>What i have to do to display text dynamic?</p>
<p><code>Some text [-]</code> to go <code>Some text [|]</code> and then back to <code>Some text [-]</code>.</p>
<p>Is there a way to do this without clearing whole screen?</p>
|
python
|
[7]
|
2,693,319
| 2,693,320
|
How to remove last character from a string inside a loop
|
<p>I am trying to print the different category's selected in a single line in xml,
like</p>
<pre><code><cat_name>meeting, food and drinks, sports</cat_name>
</code></pre>
<p>The output I am getting:</p>
<pre><code><cat_name>meeting, food and drinks, sports,</cat_name>
</code></pre>
<p>I want to remove only the last comma.</p>
<p>The code I have written so far is:</p>
<pre><code>$sq="
select category_main.cat_name
from category_main
join category
on(category.cat_id=category_main.cat_id)
where category.event_id='$event_id'
";
$e=mysql_query($sq);
$xml ='<cat_name>';
while($row=mysql_fetch_array($e))
{
$res=$row['cat_name'];
//$new = substr($val,0,-1);
$xml .="$res, ";
}
$xml .='</cat_name>';
echo $xml;
</code></pre>
|
php
|
[2]
|
4,893,269
| 4,893,270
|
Get traveled distance using GPS
|
<p>I would like to track my traveled distance with my car.
It would start recording when my speed would be greater than 0 in KM/H</p>
<p>I got my speed with this code : speed = location.getSpeed() * 3.6;</p>
<p>Would like to do this:</p>
<p>if (speed > 0)
//track my distance.</p>
<p>I only found how to calculate distance betwen two points.
Thank you for helping.</p>
|
android
|
[4]
|
3,494,388
| 3,494,389
|
Linking installed apps to android market
|
<p>How to link manually installed apps to android market?<br>
<a href="https://play.google.com/store/apps/details?id=com.keramidas.TitaniumBackupPro" rel="nofollow">Titanium Backup Pro</a> and <a href="https://play.google.com/store/apps/details?id=com.rerware.android.MyBackupPro" rel="nofollow">MyBackup Pro</a> provide this feature.</p>
|
android
|
[4]
|
5,685,700
| 5,685,701
|
Java - Count number of symbols in string
|
<p>Let's say I have this string:</p>
<pre><code>String helloWorld = "One,Two,Three,Four!";
</code></pre>
<p>How can I make it so it counts the number of commas in <code>String helloWorld</code>?</p>
|
java
|
[1]
|
2,784,927
| 2,784,928
|
Javascript: separate place values of a number
|
<p>I want a function that can take a number (say 1000.43) and return the tens, hundreds, thousands, and decimal part. So in 1000.43, it would maybe return an array with <code>[1000, 0, 0, .43]</code>. I know it sounds hard but how would I do that. Maybe you can give me some advice on how to do that or can supply me with the code. Either way is greatly appreciated.</p>
|
javascript
|
[3]
|
933,393
| 933,394
|
Pass name of global var to function that alters var?
|
<p>I encountered a strange problem today. </p>
<p>The good: I successfully changed a global var value from within a function(in other words the below example works fine when "passedVarName" is substituted with "a").</p>
<p>The bad: When trying to pass the global var name "a" (rather than putting it directly in the function) it fails to work.</p>
<p>Below is what I can't seem to get working:</p>
<p>(on click document should write "2" but instead writes "NaN" ?)</p>
<p>Javascript:</p>
<p></p>
<pre><code> var a = 1;
function click(passedVarName){
passedVarName ++;
document.write(passedVarName)
};
</code></pre>
<p></p>
<p>HTML:</p>
<pre><code><a href="javascript:click('a')">Click this Button to alter global var "a".</a>
</code></pre>
|
javascript
|
[3]
|
1,041,333
| 1,041,334
|
How to know which button was pressed on Android application download window
|
<p>Is there a way to know programmatically which button the user pressed (Install or Cancel) on android application download/install window? I had some luck finding information how to know if aplication was installed but no success if cancel button was pressed.</p>
|
android
|
[4]
|
2,171,972
| 2,171,973
|
Start a .py file in windows command line
|
<p>Here is my situation:</p>
<pre><code>D:\Python27\python.exe
D:\Python27\search\file.py
</code></pre>
<p>But <code>file.py</code> takes some arguments to start</p>
<pre><code>file.py -a searchFunction=dfs
</code></pre>
<p>How can I open this file?</p>
|
python
|
[7]
|
6,008,770
| 6,008,771
|
how to break a large image into 8 equal parts in android
|
<p><br>
i just want to break a large image into some equal parts like 4, 6 or 8.
can we do it?
actually i want to store every parts of image as a separate image in my
drawable folder for future use.</p>
<p>can any one help me?</p>
<p>Thanks in advance
sunit</p>
|
android
|
[4]
|
5,630,088
| 5,630,089
|
Creating prepopulated set in Java
|
<p>In Java, how do I create a final Set that's populated at construction? I want to do something like the following:</p>
<pre><code>static final Set<Integer> NECESSARY_PERMISSIONS
= new HashSet<Integer>([1,2,3,6]);
</code></pre>
<p>but I don't know the proper syntax in Java.</p>
|
java
|
[1]
|
4,027,494
| 4,027,495
|
How to add a button widget to a rectangle canvas in Android?
|
<p>Hi, I want to develop a form on a rectangle. </p>
<p>I have designed a rectangle using a bitmap and an image, but how do I add edit texts and buttons onto that? </p>
<p>Please provide some good guidelines.</p>
|
android
|
[4]
|
2,037,790
| 2,037,791
|
How can i provide multi language and multi currency facility to my php Project?
|
<p>I need to provide <strong>multi language</strong> and <strong>multi currency</strong> facility to my project. My team don't want to use Google language converter. How can i achieve this task. My project is related to hotel bookings and i'm developing this project using php. Please help me.</p>
|
php
|
[2]
|
4,151,762
| 4,151,763
|
Example code that handles the full game lifecyle properly
|
<p>I am attempting to write an android game involving a class which extends SurfaceView and implements SurfaceHolder.CallBack. The class then creates its own thread which may need to be paused/unpaused appropriately. I wanted to use the example Lunar Landeras a reference, but this seems not to implement all sorts of essential things and it will occasionally crash on my phone.</p>
<p>What I am looking for is the <strong>simplest possible</strong> game which employs SurfaceView's, SurfaceHolder.CallBack's Threads and clearly handles all the game lifecycle events like onPause, onStop, onRestart etc - and without ever crashing.</p>
<p>Does such an example game exist?</p>
|
android
|
[4]
|
3,321,393
| 3,321,394
|
Battery level for playing video in android
|
<p>At which battery level video cannot played by videoview in android?</p>
<p>The level which is received by broadcast from</p>
<pre><code>Intent.ACTION_BATTERY_CHANGED
</code></pre>
<p>This intent will return battery level like 1,2....</p>
<p>Thanks in advance</p>
|
android
|
[4]
|
750,021
| 750,022
|
In Android, how to have bi-directional scroll AND show both scroll bars?
|
<p>It seems that Android ScrollView does not support bi-directional scroll. Although, a HorizontalScrollView can be placed inside a ScrollView, which effectively provides bi-directional scrolling (as below). </p>
<p>However, the horizontal scrollbar is now "at the bottom of" the vertical scroll view. So, if I scroll all the way to the bottom of the vertical scroll view, and then drag left to right, the horizontal scrollbar will show. Otherwise, the horizontal scrollbar doesn't show, because it is "off the screen". </p>
<p>Any advice?</p>
<pre><code><ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/horizontalscrollview"
android:fadingEdge="none"
android:padding="0dip"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout
android:id="@+id/pagepane"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
</LinearLayout>
</HorizontalScrollView>
</ScrollView>
</code></pre>
|
android
|
[4]
|
3,351,257
| 3,351,258
|
how to Access individual characters in a textbox in javascript?
|
<pre><code><script type="text/javascript">
function change()
{
var a = $("#bb").text(); /// bb-> textbox id
b = a.substr(0, 1);
alert(b);
}
</script>
</code></pre>
|
javascript
|
[3]
|
2,720,079
| 2,720,080
|
How to move a image using buttons(up,down,left ,right)
|
<p>Hi I have app where i can move the image left,right,up,bottom.i have created four buttons and implemented onclick listener on four buttons now i don't know code how move the image.When i click on left button it should move towards left and click on right it should towards right.can any one help please help me </p>
|
android
|
[4]
|
1,185,717
| 1,185,718
|
How to implement int in/out params in java
|
<p>Apologies for asking such a primitive question. </p>
<p>I wrote a function which took one parameter; this parameter was supposed to be an in/out parameter. </p>
<p>After debugging, I realized, since there are no explicit reference types in java, I should probably use Integer object (instead of int primitive) as the parameter type. So I changed my function:</p>
<pre><code>boolean getNextFoo(int currentFoo) {
currentFoo = currentFoo + 1;
}
</code></pre>
<p>to:</p>
<pre><code>boolean getNextFoo(Integer currentFoo) {
currentFoo = currentFoo + 1;
}
</code></pre>
<p>After checking the execution in the debugger, I realized this has the same results as the previous. That is, the object that I'm passing into <code>getNextFoo()</code> does not change. </p>
<p><strong>Question 1</strong>: How to I achieve in/out parameters with Java (more specifically for primitive types). I thought (pardon me) that objects are always passed by reference.</p>
<p><strong>Question 2</strong>: I was checking on the internet for answers and read that Integer is immutable. I understand immutable means constant. If so, why doesn't the compiler (interpreter?) complain when I do <code>currentFoo = currentFoo + 1</code> within the <code>getNextFoo</code> function?</p>
<p><strong>PS</strong>: I see in the debugger that Integer object is actually not being passed to <code>getNextFoo</code>, instead the value of <code>Integer.valueOf</code> is being passed into <code>getNextFoo</code> which is leaving me even more confused.</p>
|
java
|
[1]
|
5,056,319
| 5,056,320
|
How to append to the dictionary?
|
<p>I have a dictionary defined.</p>
<pre><code>Dictionary<string, string> dataSource;
</code></pre>
<p>There is a function defined in such a way that this Dictionary will get filled atleast ones.</p>
<pre><code>dataSource = l2ListText
.Zip(l2ListValue, (lText, lValue) => new { lText, lValue })
.ToDictionary(x => x.lValue, x => x.lText);
</code></pre>
<p><code>l2ListText</code> and <code>l2ListValue</code> are <code>List<String></code>
This filled in <code>datasource</code> dictionary serves as a datasource for a listbox.</p>
<p>And second time round, it checks if a listbox is empty, and when it is NOT empty, I want to append values to this <code>dataSource</code> and re-assign it as a datasource to the listbox again.</p>
<p>I am finding it difficult to achieve this, please help. </p>
|
c#
|
[0]
|
4,475,725
| 4,475,726
|
C# static vs instance methods
|
<p>I'm risking it this might be a newb question but here goes. I'm tempted to add a method to a class that could possible have thousands and thousands of instances in memory at a given time. Now, the other option is creating a static class with a static method, and just create the [static] method there, instead of an instance method in the class. Something like so:</p>
<p>This:</p>
<pre><code>public static class PetOwner
{
public static void RenamePet(Pet pet, string newName)
{
pet.Name = newName;
}
}
</code></pre>
<p>Instead of this:</p>
<pre><code>public class Pet
{
public string Name { get; set; }
public void Rename(string newName)
{
this.Name = newName;
}
}
</code></pre>
<p>I'm just wondering if the static class alternative would take considerably less memory.</p>
<p>Thanks!</p>
|
c#
|
[0]
|
1,197,372
| 1,197,373
|
Provisioning profiles handling in Xcode 4
|
<p>I have : adhoc_myApp.mobileprovision, i would like to submit my .ipa with mail to the tester.
I have done like this : Product/ Archive, and i have got the error :</p>
<pre><code>Code Sign error: The identity 'iPhone Distribution' doesn't match any identity in any profile
</code></pre>
<ol>
<li><p>i think that, i should add my adhoc_myApp.mobileprovision to xcode, but how i can do it in xcode 4 ??</p></li>
<li><p>And how i can shre the ipa?</p></li>
</ol>
<p>thanks for your answers</p>
|
iphone
|
[8]
|
1,122,750
| 1,122,751
|
When to load an image to use the Javascript function drawImage()?
|
<p>I would like to use the drawImage() function to load an image in a Javascript animation, but the image does not load with my current code. I think I need to specifically ask for the image to be loaded at some point, but I'm not sure when or how. The idea is to make a cloud that goes across the canvas. Thank you for your help.</p>
<pre><code>function draw(x,y){
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
x += 2;
if(x>1000){
x=0;
}
var cloud = new image();
cloud.src='small_cloud.png';
ctx.drawImage(cloud,x,0);
var loopTimer = setTimeout('draw('+x+','+y+')',20);
}
</code></pre>
|
javascript
|
[3]
|
3,992,875
| 3,992,876
|
Why can't I cast to B*?
|
<p>I'm trying to cast to B* using operators but it's not working. Why? Thanks.</p>
<pre><code>struct B;
struct A {
A() = default;
operator (B *)() {
return new B();
}
};
struct B { B() = default; };
int main() {
A a;
B *b = a;
}
</code></pre>
<p>I get the error: <code>cannot convert 'A' to 'B*' in initialization</code></p>
|
c++
|
[6]
|
501,044
| 501,045
|
about activities in android
|
<p>please give me the solution</p>
<pre><code>public class Calc extends Activity implements OnClickListener
{
private Button clr;
clr=(Button)findViewById(R.id.Button01);
}
public void onClick(View v)
{
case R.id.Button01:
tv1.setText("REF");
if( ref_flg==true)
{
final AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle("Reset...");
alertDialog.setMessage("REF was already entered");
alertDialog.setButton2("OK", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which) {
// here you can add functions
dialog.dismiss();
}
});
alertDialog.setIcon(R.drawable.icon);
alertDialog.show();
}
}
</code></pre>
<p>so my question is that how i can write the code in case button01 in another activity and get the result from it.</p>
|
android
|
[4]
|
279,236
| 279,237
|
Can't access HyperLinkField text in a GridView
|
<p>I have a HyperLinkField defined as follows:</p>
<pre><code><asp:GridView ID="gvNotifications" runat="Server" AutoGenerateColumns="false" EnableViewState="true" CssClass="tableWhole" AlternatingRowStyle-CssClass="tableAlt">
<Columns>
<asp:HyperLinkField HeaderText="Item#" DataTextField="sku"
DataNavigateUrlFormatString="/store/item/{0}/"
DataNavigateUrlFields="sku" ItemStyle-CssClass="itemNo" />
</code></pre>
<p>In my code-behind, I'm attempting to access the Text property like this:</p>
<pre><code> For Each gvRow In gvNotifications.Rows
processItem(gvRow.Cells(0).Text.ToString)
Next
</code></pre>
<p>This code worked when it was defined as a BoundField, like this:</p>
<pre><code><asp:BoundField HeaderText="Item #" DataField="sku" ItemStyle-CssClass="itemNo" />
</code></pre>
<p>How can I access the Text property on a HyperLinkField in a GridView.Row.Cells?</p>
|
asp.net
|
[9]
|
5,631,030
| 5,631,031
|
best method of processing dynamic amount of _POST or _GET variables
|
<p>I am building a simple scheduling program for week long scheduling: Sunday - Saturday.</p>
<p>Under each day when the schedule is saved there will be a variable amount of employees working and the data for their shift and job code.</p>
<p>For example:</p>
<p>Sunday:
Bob - Kitchen - Opening Shift
Sam - Kitchen - Closing Shift
Amy - Bar - Opening Shift
Billy - Bar - Closing Shift</p>
<p>Monday:
Bob - Kitchen - Opening Shift
Sam - Kitchen - Opening Shift
Amy - Bar - Opening Shift</p>
<p>And so on... Thus when the form is submitted I made need to process data for 2 employees. Or 0 employees or 10..</p>
<p>What is the best way to read a dynamic amount of _GET or _POST variables in this situation?</p>
|
php
|
[2]
|
5,144,276
| 5,144,277
|
How to invoke a method at runtime from a jar file
|
<p>I have multiple jar files at a specific location.Based on some calculation ,i need to load different jar files and invoke a certain method inside the jar.
The jar file contains methods that act as a client to web services.
When i invoke the method using reflection, it throws an error Wrapper class not found.Have you run APT to generate them?</p>
<p>Please help me with the solution for this issue.</p>
<p>Thanks</p>
|
java
|
[1]
|
480,103
| 480,104
|
Running a line in 1 hour intervals in python
|
<p>I'm trying to create a espeak based talking clock completely in python</p>
<p>I want to know how to run</p>
<pre><code>spk.speak('It is now <time>')
</code></pre>
<p>Each time the system hits time's like 12:00 1:00 etc</p>
|
python
|
[7]
|
3,688,705
| 3,688,706
|
How to add custom message box
|
<p>I am new to the iPhone. After running my application if I click a menu button I would like it to display About or Help, just like an alert message. If they select the about it will open the a webpage. When help is selected it will display some text. </p>
|
iphone
|
[8]
|
399,215
| 399,216
|
php, how to calculate the sum from an while loop?
|
<p>i have a while loop that returns some values:</p>
<pre><code>while ($get_keywords3 = mysql_fetch_array($keywords2)){
?>
<tr>
<td><span style="margin: 0 3px;"><?php echo $get_keywords3['grand_total'];?></span></td>
</tr>
<?php }
</code></pre>
<p>this returns back:</p>
<pre><code>123
234
345
456
...
</code></pre>
<p>what i want is to add those together: <code>123 + 234 + 345 + ...</code></p>
<p>any ideas?</p>
<p>thanks</p>
|
php
|
[2]
|
3,908,029
| 3,908,030
|
Need Solution to reduce object creation, used spring - but have a problem , method explained in detail
|
<p>I am using spring to reduce new objects creation, for the number of resultset available, I will create a row object inside and add the row object in a rowset object, which maintains a list of rows.</p>
<p>My code goes like this.</p>
<pre><code> while(rs.next()) {
Row r = new Row();
//Logic
rowset.addRow(r);
}
</code></pre>
<p>My rs will have atleast a minimum of 3000 rows, so there will be a 3000 row object injected, so to avoid it, I used spring injection like</p>
<pre><code> while(rs.next()) {
Row r = (Row)getApplicationContext().getBean("row");
//Logic
rowset.addRow(r);
}
</code></pre>
<p>but the problem here is when the second row object is added to the rowset, the first row object's values are overriden with second row object and when last row is added , all the 1 to last-1 row objects values are updated as last row object values. </p>
<p>This is my rowset calss</p>
<pre><code>public class RowSet {
private ArrayList m_alRow;
public RowSet() {
m_alRow = new ArrayList();
}
public void addRow(Row row) {
m_alRow.add(row);
}
}
</code></pre>
<p>I need a solution , such that the new row object creation is avoided inside the while loop with the same logic involved.</p>
|
java
|
[1]
|
4,905,575
| 4,905,576
|
how to read pdf and doc file from asset into webview in android?
|
<pre><code>File file=new File("file:///android_asset"+filename);
if (file.exists()) {
Uri targetUri = Uri.fromFile(file);
Intent intent1 = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(targetUri, "application/pdf");
try {
startActivity(intent1);
}
catch (ActivityNotFoundException e) {
Toast.makeText(FileWebView.this,
"No Application Available to View PDF",
Toast.LENGTH_SHORT).show();
}
</code></pre>
|
android
|
[4]
|
1,034,206
| 1,034,207
|
how does SCListener work?
|
<p>How would I go about using Stephen Celis' fantastic SCListener singleton? </p>
<p>(<a href="http://stephencelis.com/2009/03/02/now-i-just-need-an-audience.html" rel="nofollow">http://stephencelis.com/2009/03/02/now-i-just-need-an-audience.html</a>)</p>
<p>I would like to start with something incredibly simple.. like display the input volume in a textview or just display a UIImage when the listener detects something. </p>
<p>Any help would be greatly appreciated!</p>
<p>Thanks!</p>
|
iphone
|
[8]
|
4,242,605
| 4,242,606
|
replace anything other than a-z,A-Z,0-9 or a space with nothing
|
<p>I am making a registration form. When a user is selecting a username I want jquery to replace anything other than <code>a-z,A-Z,0-9</code> or a space with nothing. </p>
<p>So on keyup the form field with the id of username will only allow <code>a-z,A-Z,0-9</code> or a space and replace anything else with nothing "".</p>
<p>How could I do that?</p>
|
jquery
|
[5]
|
3,323,961
| 3,323,962
|
Check if a program exists from a python script
|
<p>How do I check if a program exists from a python script?</p>
<p>Let's say you want to check if <code>wget</code> or <code>curl</code> are available. We'll assume that they should be in path.</p>
<p>It would be the best to see a multiplatform solution but for the moment, Linux is enough.</p>
<p>Hints: </p>
<ul>
<li>running the command and checking for return code is not always enough as some tools do return non 0 result even when you try <code>--version</code>. </li>
<li>nothing should be visible on screen when checking for the command</li>
</ul>
<p>Also, I would appreciate a solution that that is more general, like <code>is_tool(name)</code></p>
|
python
|
[7]
|
1,000,128
| 1,000,129
|
Javascript weird syntax
|
<p>So I was programming some stuff in Javascript and some time later I saw I made a typo in the following piece of code:</p>
<pre><code>(function() {
var someEl = document.getElementById('id-of-some-el'),l <-----
someOtherEl = document.getElementById('some-other-el');
someEl.onclick = function() {
...
};
})();
</code></pre>
<p>Notice how the <code>l</code> isn't supposed to be there. I've only tested this in Firefox but, why didn't I get a syntax error?</p>
|
javascript
|
[3]
|
5,405,792
| 5,405,793
|
Java Signed Right Shift
|
<p>I have seen this in a java code.</p>
<pre><code>int n = 300 //passed through a function
size = (n + 31) >> 5 //size = 10
</code></pre>
<p>what could be the significance of <code>5</code>?
What is the significance of <code>31</code> //should something to do with int size (31 bit + 1 sign)</p>
<p>Thanks</p>
|
java
|
[1]
|
1,958,297
| 1,958,298
|
How do I call a function using a function name generated from a string variable
|
<p>In the process of automating some code, I am looking to call upon a function based on what a string is. </p>
<p>For example, I have a variable <code>$somevar</code> which is set to the string "This". Now I want to run a function <code>doThis();</code></p>
<p>So, I was hoping I could write <code>do.$somevar($var,$var2)</code> . I want it to run <code>doThis($var1,$var2)</code>.</p>
<p>Is this possible?</p>
|
php
|
[2]
|
552,077
| 552,078
|
Replacing carets in Javascript
|
<p>I'm trying to replace multiple carets (^) in a string with spaces in Javascript. Following the w3schools entry on replace(), I used this code:</p>
<pre><code>var str = "Salt^Lake^City, UT";
var result = str.replace(/^/g, " ");
</code></pre>
<p>However, value of <code>result</code> is " Salt^Lake^City, UT". One caret is replaced when I run this code:</p>
<pre><code>var result = str.replace("^", " ");
</code></pre>
<p>but I want to replace all of an arbitrary number of carets. Is there something obvious I'm missing about globally replacing in Javascript? I could write a function using <code>str.replace("^", " ");</code> to remove all the carets, but I'd rather use the built-in global replace.</p>
|
javascript
|
[3]
|
3,801,146
| 3,801,147
|
adding only odd numbers
|
<p>So the question I'm trying to solve the user is supposed to enter any positive number. Then I'm trying to write a program that adds only the odd numbers up to the number the user enters and displays the total. So for example if the user enters 4 my program should add four odd numbers. 1 + 3 + 5 + 7 = 16. <br/> The only tools I have available are for statement, if, if/else if,while loop and println. <br/></p>
<p>I can only figure out how to print out the odd numbers. I know I want to create a variable named total to store the value of adding up all the odd numbers but I don't know how that fits into the program. </p>
<pre><code>import acm.program.*;
public class AddingOddNumbers extends ConsoleProgram {
public void run() {
int n = readInt("enter a positive nunber: ");
int total = 0;
for (int i = 0; i < n; i++) {
if (n == 1) {
println(1);
} else {
println((i * 2) + 1);
}
}
}
}
</code></pre>
|
java
|
[1]
|
3,171,206
| 3,171,207
|
copying and fading HTML over to another spot on the page on hover
|
<p>I am trying to copy the HTML from the title and description spans within each li into the info div below. Preferably appending h2 tags around the title whilst fading it in. If another li is hovered the current selection should fade out and the new one fade in...</p>
<p>HTML</p>
<pre><code> <li>
<a class="sales1" href="#"><img alt="Sales" src="sample.png">
<span class="drinkTitle">Test Title<span>
<span class="drinkDesc">A test Description</span></span></a>
</li>
<div id="drinksInfo"></div>
</code></pre>
<p>JQUERY</p>
<pre><code>$('#drinksList ul li img').hover(function () {
var str = $(this).siblings('.drinksTitle').text();
$('#drinksInfo').html(str).fadein();
});
</code></pre>
<p>Any help would be appreciated.</p>
|
jquery
|
[5]
|
3,564,081
| 3,564,082
|
How to make a working img src from a local img src - PHP
|
<p>I am using cURL to get the img srcs of all the img tags used in a website. But the website has many names specified without host names, like:</p>
<pre><code><img src="/images/look.jpg" />
<img src="i4.ytimg.com/vi/OmliBRZUxnk/maxresdefault.jpg?feature=og" title="youtube pic" />
</code></pre>
<p>So how do I determine which of the src's will render the pic without any manipulation of them, and which one will need to be prepended with the site's host name (steekcoders.com).</p>
<p>Currently I'm trying this:</p>
<pre><code>$url = 'http://www.steekcoders.com'; $parse='http://'.parse_url($url, PHP_URL_HOST).'/'; $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
foreach($imgArray as $src)
{
$src=ltrim($src,"/"); if(empty($src)){ continue; }
if(!preg_match($reg_exUrl, $src))
{
$clipouts[]=$src; $req="http://".$src; $extra=$parse.$src;
$clipouts[] = $extra; $clipouts[] = $req;
}
else{ $clipouts[]=$src; {
}
</code></pre>
<p>But it is not working out very well. How can I go about this?</p>
|
php
|
[2]
|
2,187,486
| 2,187,487
|
way to get exact below format of current date
|
<p>Is there any way to get exact below format of current date- 18 Aug 2010.
I tried -</p>
<pre><code> string dt = DateTime.Now.ToShortDateString().ToString();
dt = dt.Replace("-", " ");//return 18 Aug 10.
</code></pre>
<p>But I want the exact format: <code>18 Aug 2010</code></p>
<p>Thanks</p>
|
c#
|
[0]
|
1,892,615
| 1,892,616
|
Call to undefined function recaptcha_get_html() How to fix?
|
<p>Hello all im getting the following error. I tried putting the files everywhere i can and no fix. is there something else i have to do to make this work? thanks here is the error</p>
<pre><code>Fatal error: Call to undefined function recaptcha_get_html() in /home/folder/public_html/site/views/users/register.php on line 75
</code></pre>
|
php
|
[2]
|
22,522
| 22,523
|
Creating Local Android Service
|
<p>I created a local android service.
When user selects the start button then a service is started and an inner class which extends from Activity and implements the runnable and SensorEventListener is created.</p>
<p>I would like to get the x,y,z coordinates of the mobile device before and after the device is locked (screen monitor becomes off and black and the device is locked). How do I do this task?</p>
<p>Thanks,
Eyall</p>
|
android
|
[4]
|
3,917,681
| 3,917,682
|
iOS 4 - How to add table view to a tab bar application
|
<p>I am new to iPhone programming and am having a really hard time trying to figure out how to add a table view to a tab bar application. There are not many tutorials on this for iOS SDK 4 and the Apple documentation is very light on details. Since I am new I would really like some tutorial that has screenshots (or at least clear instructions) when it comes to things being done in Interface Builder (like making connections between the objects and File Owner, etc), usually lot of tutorials/blogs gloss out these details.
What I am trying to do is create a tab bar based application with 3 tabs (this I am able to do). The first tab needs to display a table view with the header having 2 buttons (one on right and other on left, with the title in middle).The title is actually today's date, obtained from the phone. Clicking either of the header buttons should take you to another table and the title should be yesterday's date (if left button is clicked) and tomorrow's date if right button is clicked.
Can some one please suggest me a good tutorial for this. I am thoroughly confused by the Interface Builder (especially how to create connections).</p>
|
iphone
|
[8]
|
565,558
| 565,559
|
Find and replace a word in several text files with Java?
|
<p>How can I find and replace a word in several text files, using Java?</p>
<p>Here's how I do it for a single <code>String</code>...</p>
<pre><code>public class ReplaceAll {
public static void main(String[] args) {
String str = "We want replace replace word from this string";
str = str.replaceAll("replace", "Done");
System.out.println(str);
}
}
</code></pre>
|
java
|
[1]
|
3,825,175
| 3,825,176
|
can't use javaScript setInterval method
|
<p>i cant use setInterval mehod, i don't know why.
what's wrong with this script, after clicking on stop it doesn't show the result of counter i in the text field.</p>
<pre><code><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test_setInterval</title>
<script type="text/javascript">
var i = 0;
var interval;
function start ()
{
interval = document.setInterval("i++", 1000);
}
function stop ()
{
document.clearInterval(interval);
output.value = i;
}
</script>
</head>
<body>
<input id="output" type="text" />
<input id="start" type="button" value="start" onclick="start()" />
<input id="stop" type="button" value="stop" onclick="stop()" />
</body>
</html>
</code></pre>
|
javascript
|
[3]
|
5,576,955
| 5,576,956
|
Instantiating classes with identical properties and methods
|
<p>I have 2 classes that manage the operation of 2 different brands of net cam, each have exactly the same public members, but very different private members. One or the other of them is docked inside of a Pane class ( which type is decided at run time). The Pane class provides additional display functionality plus control of whichever camera is docked. When an application instantiates the Pane class, and specifies the type of camera is to be docked, I would like to have the Pane instantiate the proper camera class so that it can call on that class.</p>
<p>My issue is illustrated in the last line of this example code... camera doesn't have a .Start() method because camera is of type Object not of one of the two CameraType types.</p>
<p>How do I get 'object camera' to expose at design time the members of the assigned class so that Pane.Start() winds up calling the Start() method of the class assigned in the switch/case block?</p>
<p>Thank you for your time,
Dave</p>
<pre><code>public class CameraType1 //not to be used directly
{
public CameraType1()
{
Stuff specific to this type of camera
}
public void Start()
{
// Stuff specific to starting a stream to this type
}
}
public class CameraType2 //not to be used directly
{
public CameraType2()
{
// Stuff specific to this type of camera
}
public void Start()
{
// Stuff specific to starting a stream to this type
}
}
public class Pane
{
object camera;
public Pane(string CameraTypeToDeploy)
{
switch (CameraTypeToDeploy)
{
case "Type1":
camera = new CameraType1();
break;
case "Type2":
camera = new CameraType2();
break;
}
}
public void Start()
{
camera.Start(); //wrong... camera doesn't have a Start() method
}
}
</code></pre>
|
c#
|
[0]
|
1,530,284
| 1,530,285
|
How to Create 2D list View
|
<p>hi <br>
I am writing an Android App, in which I need to display a List, Clicking on any list item should show another list besides that list item. Can anyone help me how can this be implemented in Android.</p>
<p>Thanks in Advancem</p>
|
android
|
[4]
|
4,114,793
| 4,114,794
|
int (*p) [4]?
|
<pre><code>int (*p) [4] ;
</code></pre>
<p>Is "p" pointer to array of 4 integers ?? or what ?? </p>
<p>and How can I call "new" for this pointer ?? </p>
|
c++
|
[6]
|
4,219,648
| 4,219,649
|
Defining constant as function result in header = bad idea?
|
<p>In a widely used include file in one of our projects we have these convenience constants:</p>
<pre><code>const double kPi = asin(1.0) * 2.0;
const double kPiHalf = asin(1.0);
const double kDeg2Rad = asin(1.0) / 90.0;
const double kRad2Deg = 90.0 / asin(1.0);
</code></pre>
<p>Is it a bad idea to use function results to calculate (precise) constants once at runtime?</p>
<p>Some recent crash dumps (on OS X) we've received look dodgy - they've got a stack frame with the address of the <code>const double kRad2Deg</code> line at a deep level though the crash occurs somewhere in the app way up the stack trace. Weird.</p>
<p>Does calling the math functions very early during the startup phase possibly screw up things?</p>
<p>I know we could just replace the function calls with constants but I'd like to understand the problem (if there is any) in general.</p>
|
c++
|
[6]
|
2,491,939
| 2,491,940
|
Javascript accessing methods with brackets?
|
<p>I saw this in some code:</p>
<p><code>var _0xdf50x7 = document['createElement']('form');</code></p>
<p>How does this work? Does this mean that an object's methods can be accessed like the elements of an array?</p>
|
javascript
|
[3]
|
418,297
| 418,298
|
Inserting audio clips into an android app
|
<p>I plan on making an app for a church, and it's pretty much a relatively simple one, it's just going to have a menu in the main xml which will contain an about section contact and a clips section. now when the user clicks on clips they will be redirected to an xml file listing all the audio clips for the services of prior weeks which the user can then click to listen to. i was just planning on creating a raw folder and placing all clips inside that folder and then accessing the audio files through the mediaplayer class with a raw. method, but would that really be the best way of doing it? I have several questions here. If i do it that way would I have to modify the code all of the time because i would have to insert the newest clips? if so what is a better way of doing this so i don't have to continuously have to change my code each week since i plan on inserting the newest audio clip from that weeks service?</p>
|
android
|
[4]
|
632,957
| 632,958
|
jQuery custom function throwing error when no selected elements exist
|
<p>I have a custom function which disables text selection for the selected elements. The custom function is structured like this:</p>
<pre><code>$.fn.DisableTextSelect = function() {
return this.each(function() {
// do things to 'this' element
// ...
});
};
</code></pre>
<p>I call it like this, for example:</p>
<pre><code>$("label").DisableTextSelect();
</code></pre>
<p>Problem is, when there are no elements to operate on, instead of just doing nothing, an error is thrown, which Firebug shows as <code>$("label") is null</code> pointing to the line above.</p>
<p><img src="http://i.stack.imgur.com/3I5M8.gif" alt="enter image description here"></p>
<p>Have I written the function incorrectly? If there are no elements found, I thought it would simply return; ie. not perform the each() loop.</p>
|
jquery
|
[5]
|
5,811,236
| 5,811,237
|
run php script automatically
|
<p>i have a php script that should be run automatically every day.
as the php script is run on a request,how can i do it?
is there any way else using cronjob task?</p>
|
php
|
[2]
|
4,577,450
| 4,577,451
|
using ternary operator in javascript to invoke two functions?
|
<p>So can this be done in Javascript?</p>
<pre><code>type == 1 ? function1() : function2();
</code></pre>
|
javascript
|
[3]
|
3,333,212
| 3,333,213
|
c# can't close application
|
<p>I'm developing a c# application and when the user clicks on the X the application gets minimized inside a trayicon. Like so:</p>
<pre><code>private void frmChat_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
Hide();
}
</code></pre>
<p>The application is really simple (only one form) the problem is that I can't managet to close properly the application. When the user rights clicks on the tray icon and he chooses "exit" he should be able to close the application, the problem is that even if the tray icon gets unloaded and the form closed the application still shows in the task manager as an active application. I'm closing the app like this:</p>
<pre><code>private void chiudiToolStripMenuItem_Click(object sender, EventArgs e)
{
trayIcon.Dispose();
this.Close();
Application.Exit();
}
</code></pre>
<p>What am I missing here?</p>
<p>Thanks</p>
|
c#
|
[0]
|
2,340,184
| 2,340,185
|
Create instance of class or superclass from generic type
|
<p>I'm new in Java.
I'm developing program for Android similar to app for iOS.
One of the purposes of app - is get data from server.
Data often is <strong>array</strong> with <strong>dictionaries</strong> like "id = 1", "name = SomeName".
I've class</p>
<pre><code>class BaseArrayList<Type extends BaseItem> extends BaseItem {
public void processObject(Map<?,?> map) {
//......
//Some loop body
Type item = (Type) Type.create();
item.processObject(map);
//.....
}
</code></pre>
<p>Also BaseItem have method create():</p>
<pre><code>public static BaseItem create() {
return new BaseItem();
}
</code></pre>
<p>It works, but for sublass of BaseItem -it doesn't work.
I found that static methods are not overriding.</p>
<p>So, how I can resolve this task: create custom class in array with just creating custom instances of BaseArrayList such as:</p>
<pre><code>new BaseArrayList<SomeSublassOfBaseItem>
</code></pre>
<p>This issue resolved in ObjC like this - </p>
<pre><code>[[memberClass alloc] init];
</code></pre>
|
java
|
[1]
|
5,442,484
| 5,442,485
|
Only grab completed files
|
<p>I'm making a real simple "backend" (PHP5) for two flash/air-applications. One of them will upload a photo, the backend will save it to a folder, and the second app will poll the backend for new photo's and show them. </p>
<p>I don't got any access to a database, so the backend has to be pure PHP5 and nothing more. That's why I chose to save the images to a folder (with a timestamp in their names) and use readdir() to get them back. </p>
<p>This all works like a charm. Nevertheless, I would really like to make sure the backend only returns photo's that are completely uploaded, preventing the second app to try to load an unfinished image. Are there any methods/tricks that I can use to validate a file?</p>
|
php
|
[2]
|
4,354,444
| 4,354,445
|
retrieve file line one by one using C#?
|
<p>I have a file name <strong>abc.txt</strong>. On that file have some lines like this:<br></p>
<blockquote>
<p>jani<br> 50,south carolina,USA<br>
karim<br> 16,roam,Italy<br> fara<br>
52,sydny,Australia<br></p>
</blockquote>
<p>First line is name and second line is address. Now I need the info name on a string let's say <strong>nameString</strong> and address is let's say <strong>addressString</strong>. How can I do it using C#?
I write a code in PHP its working smoothly. I need the same thing in C#. For yours clarification here is the php code:</p>
<pre><code>$file=file_get_contents('abc.txt');
$arr=explode("\n",$file);
for ($i=0;$i<count($arr);$i=$i+2)
{
$name=$arr[$i];
$address=$arr[$i+1];
echo $name ."<br/>";
echo $address. "<br/>";
}
</code></pre>
<p>How can I do the same thing in C#????
Another question: Is there any function in C# as like as explode in php?</p>
<p>Thanks in advance <br>
riad</p>
|
c#
|
[0]
|
795,343
| 795,344
|
No newlines in template file
|
<p>So i am writing an open source software written in PHP and i am going to use a template system. The templates will be stored on the hard drive.</p>
<p>I tried this method, however all the html that is in the files gets displayed in just one line, while in the files itself it is on a few lines.</p>
<p>Why is that?</p>
|
php
|
[2]
|
3,600,427
| 3,600,428
|
how to explode array within array in php
|
<p>i have an array contain value like :</p>
<pre><code>Check_Value ('level_codes', '1000', '1001','(1000,1002,1004)', 'DO ', '1')==1
</code></pre>
<p>i want to get values and store into an other parametrs like :</p>
<pre><code>$codes = level_codes;
$first_value = 1000;
$second_value = 1001;
$list_values = (1000,1002,1004);
$action = DO;
$timer = 1;
$case = ==;
$status = 1;
</code></pre>
<p>is there any one please help me to do this work...!</p>
|
php
|
[2]
|
2,507,503
| 2,507,504
|
How to select folder using ASP.NET
|
<p>i want select folder using asp.net , when i click browse button it will open file selection dialog. </p>
|
asp.net
|
[9]
|
4,607,079
| 4,607,080
|
jquery delete table row
|
<p>I have a table</p>
<pre><code><table id="favoriteFoodTable">
<th>
Food Name:
</th>
<th>
Restaurant Name:
</th>
<th>
</th>
<?php while ($row = $foods->fetch()) {
?>
<tr>
<td>
<?php echo $row['foodName']; ?>
</td>
<td>
<?php echo $row['restaurantName']; ?>
</td>
<td>
<a class="deleteLink" href="" >delete</a>
</td>
</tr>
<?php } ?>
</table>
</code></pre>
<p>i use this jquery function so when a user click on delete , the background of the row will change and the row then will delete</p>
<pre><code>$(document).ready(function() {
$("#favoriteFoodTable .deleteLink").on("click",function() {
var td = $(this).parent();
var tr = td.parent();
//change the background color to red before removing
tr.css("background-color","#FF3700");
tr.fadeOut(400, function(){
tr.remove();
});
});
});
</code></pre>
<p>just the backgound is changing but the row is not deleted, why pelase?how to solve </p>
|
jquery
|
[5]
|
5,428,334
| 5,428,335
|
Definition of ONE asp.net application?
|
<p>How do you define <strong>ONE</strong> asp.net application? Does it have to be built under one solution or does it have to be deployed under one application under IIS? </p>
<p>Can multiple web projects be deployed under one IIS application (so that they have access to each other's session, cache etc) ?</p>
<p>This is just a theoretical question.</p>
<p><strong>Update:</strong> What I am stressing on is what makes it <strong>ONE</strong> application. </p>
|
asp.net
|
[9]
|
4,991,284
| 4,991,285
|
What is the proper selector on an thumbnail image using Jquery on nested DIVs in a gallery?
|
<p>When each image is clicked, the main image is supposed to change. I am having trouble accessing the correct selector. I have tried .parent and many different variations of the selector (i.e. img.redCarpet, redCarpet.img, etc.).</p>
<h2>JQUERY</h2>
<pre><code>$('img.redCarpet').click(function () {
var src = $(this).attr('src');
$('#photoSpotImage').attr('src', src.replace(/-thumb/, ''));
});
</code></pre>
<h2>HTML</h2>
<pre><code><div id="photoSpot"><img id="photoSpotImage"src="Images/photos/1/1.jpg" alt=""/></div>
<div class="thumbnailOverlay">
<div class="thumbnailStyles">
<div id="redCarpetCarousel">
<div class="redCarpet">
<img src="Images/photos/1-thumbs/1.jpg" alt="" />&nbsp;&nbsp;
<img src="Images/photos/1-thumbs/10.jpg" alt="" />&nbsp;&nbsp;
<img src="Images/photos/1-thumbs/100.jpg" alt="" />&nbsp;&nbsp;
<img src="Images/photos/1-thumbs/101.jpg" alt="" />&nbsp;&nbsp;
<img src="Images/photos/1-thumbs/102.jpg" alt="" />&nbsp;&nbsp;
</div>
</div>
</div>
</div>
</code></pre>
<p>Thanks!</p>
|
jquery
|
[5]
|
5,949,054
| 5,949,055
|
jquery $.postMessage is not a function
|
<p>I have a site that is loading several versions of jQuery.
Will that possibly cause the "is not a function" error?</p>
<pre><code> TypeError: $.postMessage is not a function
.postMessage( { if_height: $('body').outerHeight( true ) }, parent_url, parent )
</code></pre>
<p>I know that I should not load several versions but in this case I have no choice.</p>
<p>edit:
This is what is getting loaded (and order)...</p>
<pre><code>http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
my.js (contains jQuery 1.7.2 and the jQuery postMessage plugin, http://benalman.com/projects/jquery-postmessage-plugin/)
https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js
</code></pre>
<p>...this is such a mess haha.. sometimes you just want to shoot bad devs ;)</p>
|
jquery
|
[5]
|
3,666,604
| 3,666,605
|
How to use CalendarContract class in API Level 8
|
<p>After the launch of android 4, <code>CalendarContract</code> class is introduce to write event in device calendar. But if i have created my app using API level 8 and Now i want to use this <code>CalendarContract</code> class in my project done using API level 8, because in API level 8 i have use undocumented API to write event in device calendar and this code doen't work for android 4. So is it possible to use <code>CalendarContract</code> class in my project without changing the sdk version in manifest file, because if i change the sdk version to 14 then it allow me to use <code>CalendarContract</code> class and by which i can solve the issue for android 4. But on doing so my app not started running in api 8 -13, and which i dont want to do because my app is live on market. So is there any possible way to solve this problem. Please explain me with an example </p>
|
android
|
[4]
|
5,160,065
| 5,160,066
|
Send sms via usb 3g
|
<p><em>Hi all,</em></p>
<p>I want to use usb 3G to send sms to a phone number every 30 minutes from a computer.</p>
<p>How could i do that? Please somebody help me.</p>
<p>Thanks very much !!!</p>
|
java
|
[1]
|
2,784,151
| 2,784,152
|
Getting a file from directory
|
<p>I have to develop a service in which my 1st task is </p>
<p>->CSV files get put into a directory</p>
<p>directory is in the form of \servername\DirectoryName\<em></em>.csv.</p>
<p>can any one help me out how to do this because I am a absolute beginner in programming.</p>
|
c#
|
[0]
|
4,055,828
| 4,055,829
|
How to check if selected index of dropdownlist is not 0 or -1 using jquery
|
<p>How to check if selected index of dropdownlist is not 0 or -1 using jquery?</p>
|
jquery
|
[5]
|
4,061,072
| 4,061,073
|
Sorting div class with jQuery
|
<p>I created jQuery plugin to sort class with <code>class="apple"</code> and <code>class="tree"</code> but how do I create a sort with displaying all of the above <code>class="apple"</code> ?</p>
<pre><code><ul>
<li class="apple">APPLE</li>
<li class="tree">TREE</li>
<li class="all">ALL</li>
</ul>
<div>
<div class="apple">APPLE</div>
<div class="tree">TREE</div>
<div class="apple">APPLE</div>
<div class="tree">TREE</div>
<div class="apple">APPLE</div>
<div class="tree">TREE</div>
</div>
<script src="/js/jquery.min.js"></script>
<script type="text/javascript">
$("ul li").click(function() {
visibleClasses = $(this).attr("class").split(" ");
$("div div").hide(); // or slideUp / fadeOut
for(i in visibleClasses) {
$("div div."+visibleClasses[i]).fadeIn(500); // or slideDown / show
}
});
</script>
</code></pre>
|
jquery
|
[5]
|
438,420
| 438,421
|
Pass parameter from 1 page to another using post method
|
<p>I have a page "Demo.aspx". I need to set some parameters using post method and redirect the page to "DemoTest.aspx".</p>
<p>Is there any way to set parameters in post method in asp.net? I don't want to set "Querystring" due to security propose.</p>
<p>Also I need server side code for this. I am not able to use "Javascript" or "Jquery" for the same.
Here is some more description for the same.</p>
<p>Right now I am using Response.Redirect("www.ABC.Com/DemoTest.aspx?P1=2"). So the page is simply redirect to the given URL.</p>
<p>Now I don't want to pass that "P1" in "Querystring". Instead of query string I want to use Post method.</p>
<p>Please note that redirection page is not in my own application. So I cant maintain session or "Viewstate".</p>
<p>Thanks in advance.</p>
|
asp.net
|
[9]
|
2,271,657
| 2,271,658
|
Compilation Error in g++ 4.3.4 compiler
|
<pre><code>#include <iostream>
#include <string.h>
char* basename(const char* filname);
int main()
{
return 0;
}
char *basename(const char* filename)
{
char* base = (char *)filename;
return base ;
}
</code></pre>
<p>compiling on g++ 4.1.2 20070115 (SUSE 10): No issue</p>
<p>compiling on g++ 4.3.4 (SUSE 11) gives following error</p>
<p>fileName : 9 :error:declaration of char* basename(const char*) throws different exception</p>
<p>fileName:3:error: from previous declaration char* basename(const char*) throw () .</p>
<p>Kindly tell me why this is happening , Is there is any Interface changed in g++ between these two release (if I remove inclusion of string.h then compilation success on both version of g++ ,Is any Interface change in string.h).</p>
|
c++
|
[6]
|
4,157,185
| 4,157,186
|
How to improve NSXMLParser performance
|
<p>I am developing an application where I use <code>NSXMLParser</code> to parse an XML file. At the moment this takes 8 seconds. But my requirement is to do the parsing within 5 seconds. How can I improve the performance of my parser?</p>
|
iphone
|
[8]
|
3,730,397
| 3,730,398
|
how to show gridview row in zoom
|
<p>work on asp.net vs05.i want to set mouse event on gridview</p>
<p>Then based on the event type if event is mouseover it zoom the row else if the event is mouseout it changes the row’s zoom back to its original before the event occurred.</p>
<p>if (e.Row.RowType == DataControlRowType.DataRow )</p>
<pre><code>{
e.Row.Attributes.Add("onmouseover","MouseEvents(this, event)");
e.Row.Attributes.Add("onmouseout", "MouseEvents(this, event)");
}
<script type = "text/javascript">
function MouseEvents(objRef, evt)
{
if (evt.type == "mouseover")
{
objRef.style.height = "100%";
objRef.style.width = "100%";
}
</script>
</code></pre>
<p>the above code does not act in this way,Whatever i want .<strong>I want zoom in and zoom out?</strong></p>
|
javascript
|
[3]
|
936,067
| 936,068
|
How to get html tags?
|
<p>Say I have a text file like this:</p>
<pre><code><html><head>Headline<html><head>more words
</script>even more words</script>
<html><head>Headline<html><head>more words
</script>even more words</script>
</code></pre>
<p>How would I get just the tags into a list like this:</p>
<pre><code><html>
<head>
<html>
<head>
</script>
</script>
<html>
<head>
<html>
<head>
</script>
</script>
</code></pre>
|
python
|
[7]
|
3,756,716
| 3,756,717
|
Do spaces/comments slow Javascript down?
|
<p>I was wondering, do whitespaces and comments slow down JavaScript? I'm doing a brute force attack which takes some time (30 seconds). Removing whitespaces does not show a significant growth in speed, but I think the browser just does have to parse more.</p>
<p>So, is it of any use to remove unnecessary whitespaces and comments to speed the whole up?</p>
|
javascript
|
[3]
|
4,141,021
| 4,141,022
|
Select All Checkboxes On Click using Jquery
|
<p>I have following HTML:</p>
<pre><code><label><input type="checkbox" value="12" name="Cevent[]" /> Yoga</label>
<label><input type="checkbox" value="12" name="Cevent[]" /> Yoga 1</label>
<label><input type="checkbox" value="12" name="Cevent[]" /> Yoga 2</label>
<label><input type="checkbox" value="12" name="Cevent[]" /> Yoga 3</label>
<label><input type="checkbox" id="selectAllEventList" name="selectAllE"> Select All</label>
</code></pre>
<p>and Following Jquery:</p>
<pre><code>$(document).ready(function (){
$('#selectAllEventList').click (function () {
$('input[name=Cevent[]]').each(function(){
$(this).prop('checked', status);
});
});
});
</code></pre>
<p>But i am getting Syntax error:</p>
<pre><code>Error: Syntax error, unrecognized expression: [name=Cevent[]]
</code></pre>
<p>I think i am writing wrong Selector at <code>input[name=Cevent[]]</code> what is the problem how can i write it correctly because i must have to send it as a array so i have to write it as Cevent[].</p>
|
jquery
|
[5]
|
4,583,542
| 4,583,543
|
Java new Date with time stamp in date format
|
<p>I have used the following </p>
<pre><code>SimpleDateFormat df = new SimpleDateFormat("dd-mm-yyyy hh:mm:ss zzz");
Date date = new Date();
String formattedDate= df.format(date);
Date dateWithTime = df.parse(formattedDate);
</code></pre>
<p>i got the formatted date as string when i conver this into date i got error like </p>
<pre><code>java.text.ParseException: Unparseable date: "Tue Feb 26 11:45:43 IST 2013"
</code></pre>
<p>How would convert to date or how i format a current date and get as date?</p>
|
java
|
[1]
|
3,336,979
| 3,336,980
|
Should in generic class fields be initialized to their default values using default(T) or...?
|
<blockquote>
<p>With generics Default can be used to
set a type parameter to its default
value. This is clearly helpful given
that a generic type does not know the
actual placeholders up front and
therefore cannot safely assume what
the default value will be</p>
</blockquote>
<p>When should in a generic class field be initialized via <code>default(T)</code> and when should we let the compiler set a field to its default value, or is it simply a matter of preference:</p>
<pre><code>public class myType<T>
{
public T _unkonwType1 = default(T);
public T _unknownType2;
}
</code></pre>
<p>thanx</p>
|
c#
|
[0]
|
1,555,191
| 1,555,192
|
How to access iphone method from javascript/HTML5?
|
<p>I want to access a method written in objective C when I click any event in HTML5/javascript. I do not know javascript and HTML too much/ So please some one suggest me with some sample code and tutorial. thanx in advance.</p>
|
iphone
|
[8]
|
5,073,851
| 5,073,852
|
PHP Image not uploaded to website
|
<p>On my website I have 2 separate places for users to upload an image. The first works perfectly. The second doesn't. As far as I can see, they are exactly the same. To test, I used the same image on both, with it working on the first, but not the second. Here is the code from the non-working one:</p>
<pre><code><?php
include('cn.php');
$name = $_FILES['image']['name'];
$type = $_FILES['image']['type'];
$size = $_FILES['image']['size'];
$temp = $_FILES['image']['tmp_name'];
$error = $_FILES['image']['error'];
echo $name; //Doesnt echo anything
$rand_num = rand(1, 1000000000);
$name = $rand_num . "_" . $name;
echo $name; //Echos just the random number followed by _
if ($error > 0) {
die("Error uploading file! Go back to the <a href='gallery.php'>gallery</a> page and try again.");
} else {
$sql = "INSERT INTO gallery (image) VALUES ('".$name."')"; //Inserts the random number to the database
$query = mysql_query($sql) or die(mysql_error());
echo $sql;
move_uploaded_file($temp, "gallery_pics/$name"); //Doesn't move the file. gallery_pics exists, if that matters
echo "Upload complete! Go back to the <a href='gallery.php'>album</a>.";
}
?>
</code></pre>
<p>If someone could please help me out here. I am sure it is something simple, but I have yet to find anything that helped. Thanks!</p>
<p>EDIT: There are two lines above the code that won't show up properly. One starts the php and the other opens the database.</p>
|
php
|
[2]
|
4,149,009
| 4,149,010
|
Lifecycle of a widget provider
|
<p>I am having hard time finding documentation on this. For the provider of an android widget, what is the life cycle of that particular provider object?
I noticed that if I start off a async test then look for the object at a later time, it's gone.
(by observation I can call onUpdate from onReceive, and I can tell the received will be alive until onUpdate is done)</p>
|
android
|
[4]
|
509,066
| 509,067
|
Decompiling of .apk files
|
<p>How to decode the .apk files, I followed <a href="http://dedexer.sourceforge.net/" rel="nofollow">http://dedexer.sourceforge.net/</a> but ddx.jar didnot produce any output file.</p>
|
android
|
[4]
|
2,445,734
| 2,445,735
|
How to display sqlite contents
|
<p>I'm not that experienced so I may have missed something obvious. What I am trying to achieve is a search feature for the database.</p>
<p>The two methods I'm thinking of are either an edittext and a listview and everytime the edittext changed a query is run and the listview is updated. Or populating the listview with all the data and then filtering it.</p>
<p>If I went for the second option I'm guessing it is less demanding on memory plus could I hide all the contents while the edittext is empty?</p>
<p>Any examples of implementation would be helpful too.</p>
<p>Thanks</p>
|
android
|
[4]
|
3,619
| 3,620
|
Execute event when iphone application is not active
|
<p>I want a timer to keep executing in background even when the application is not active. And depending upon some conditions I want to fire a local push notification. How can I achieve this? </p>
<p>Thanks
Pankaj</p>
|
iphone
|
[8]
|
2,960,005
| 2,960,006
|
Is it "legal" for C++ runtime to call terminate() when the C++ code is used inside some non-C++ program?
|
<p>In certain cases - especially when an exception escapes a destructor during stack unwinding - C++ runtime calls <code>terminate()</code> which must do something reasonable post-mortem and then exit the program. When a question "why so harsh" arises the answer is usually "there's nothing more reasonable to do in such error situations". That sounds reasonable if the whole program is in C++.</p>
<p>Now what if the C++ code is in a library and the program that uses the library is not in C++? This happens quite often - for example I might have a native C++ COM component consumed by a .NET program. Once <code>terminate()</code> is called inside the component code the .NET program suddenly ends abnormally. The program author will first of all think "I don't care of C++, why the hell is this library make my program exit?"</p>
<p>How do I handle the latter scenario when developing libraries in C++? Is it reasonable that <code>terminate()</code> unexpectedly ends the program? Is there a better way to handle such situations?</p>
|
c++
|
[6]
|
3,243,447
| 3,243,448
|
If statement doesn't seem to work correctly
|
<p>I may be doing it wrong but take a peek. If I hardcode the logic, it works but not if I try to use it as a variable.</p>
<pre><code>if($range <= 50) {
$operator = "<=";
} else {
$operator = ">=";
}
foreach($cursor as $s) {
$data = round($this->distance($zip_lat, $zip_lon, $s["lat"],$s["lon"]), 2);
if ($data .$operator. $range) {
$zipcodes[] = "$s[zipcode]";
}
}
</code></pre>
<p>I mean, I could add the if/else inside the foreach but wasn't sure if it adds any "overhead."</p>
|
php
|
[2]
|
3,596,841
| 3,596,842
|
What's the best way to set a path to an audio file to an id dynamically?
|
<p>What's the best way to set a path to an audio file to an id dynamically? And to have the app remember the newly set path for the future? (I guess we can't reset the xml files dynamically?) </p>
|
android
|
[4]
|
3,061,372
| 3,061,373
|
js get by tag name not working
|
<p>i want to resize all the images inside div test but its not working here the script and html</p>
<pre><code><script type="text/javascript">
function x(){
var yourdiv = document.getElementById('test');
var yourImg = decoument.getElementsByTagName('img');
yourImg.style.height = '400px';
yourImg.style.width = '300px';
}
</script>
<div id="test">
<img alt='' src='imges/book1.jpg' />
<img alt='' src='imges/book2.jpg' />
</div>
</code></pre>
|
javascript
|
[3]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.