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 |
---|---|---|---|---|---|
2,616,325 | 2,616,326 |
Unable to get values from input fields by ID
|
<p>I have form fields like this:</p>
<pre><code><input name='task_complete_percentage[]' value='' onchange='' class='percent' id='task_complete_percentage[]' style='width:40px;' type='text' />
<input name='task_complete_percentage[]' value='' onchange='' class='percent' id='task_complete_percentage1" + counter + "' style='width:40px;' type='text' />
<input name='task_complete_percentage[]' value='' onchange='' class='percent' id='task_complete_percentage2" + counter + "' style='width:40px;' type='text' />
<input name='task_complete_percentage[]' value='' onchange='' class='percent' id='task_complete_percentage3" + counter + "' style='width:40px;' type='text' />
</code></pre>
<p>Fields are added dynamically and I want to sum all values. </p>
<pre><code> $('[id *= "task_complete_percentage"]').change(function(){
$('[id *= "task_complete_percentage"]').each( function () {
console.log('test');
});
});
</code></pre>
<p>But only first field is working, but if do like this I can see all values. What I'm doing wrong?</p>
<pre><code> $("#addElement").click(function(){
$('[id *= "task_complete_percentage"]').each( function () {
console.log('test');
});
});
</code></pre>
|
jquery
|
[5]
|
3,335,038 | 3,335,039 |
NameError: name 'Wordpresspost' is not defined
|
<p>I am using the following wordpress xmlrpc module written in python .<a href="http://pypi.python.org/pypi/python-wordpress-xmlrpc/1.4" rel="nofollow">http://pypi.python.org/pypi/python-wordpress-xmlrpc/1.4</a></p>
<p>But when I try running the program I get the following error..Can you guys help me solve it?</p>
<pre><code>Traceback (most recent call last):
File "<pyshell#23>", line 1, in <module>
post=Wordpresspost()
NameError: name 'Wordpresspost' is not defined
</code></pre>
|
python
|
[7]
|
241,851 | 241,852 |
Get string length after append name
|
<p>If i add a value to a string name i want to get the length of the string not the length of the string name.</p>
<pre><code>var wordlist3 = "ABC";
var xc = 3;
var num_words = ('wordlist' + xc).length;
</code></pre>
<p>With the above code i get wordlist3.length as 9 when it should be 3. How do i append a string name so it references the length of the string in wordlist3, without making it a global var?</p>
<p>Im expecting the answer:</p>
<pre><code>num_words = 3
</code></pre>
<p>not</p>
<pre><code>num_words = 9
</code></pre>
|
javascript
|
[3]
|
4,005,387 | 4,005,388 |
Question about Android Tasker variables
|
<p>Tasker is an app in the app-market that enables one to define simple automation tasks.</p>
<p>I'm writing a task that announces the location coordinates.</p>
<p>However, the location is a built-in variable that is defined to about a dozen decimal places.</p>
<p>I want to round off the value before having it announced.</p>
<p>Any suggestions?</p>
|
android
|
[4]
|
5,424,047 | 5,424,048 |
Jquery, how: click anywhere outside of the div, the div fades out
|
<p>In Jquery how would i make it so that if i had a div, with different elements inside of it, a select, a search input, etc, that when i click outside of the div, on the page, the div fades out, but i can click on the select and type in the search input and not have it fade? any help is appreciated.
-nick</p>
|
jquery
|
[5]
|
5,366,401 | 5,366,402 |
Returning to previous screen after receiver activity
|
<p>I have a app that has a activity that can be started from the start
menu and a activity that is started by a broadcast receiver.</p>
<p><img src="http://i.stack.imgur.com/iTQZi.jpg" alt="enter image description here"></p>
<p>Now on boot , if the receiver is called , the "event viewer" activity is
started...after backing out of this activity user returns to previous
screen (could be homescreen or whatever user was doing) .. this is how it
should be.</p>
<p>But if i start the "main" activity from the main launcher, and press
the home button to go back to the home screen..the problem begins.
Now if the receiver is called the "event viewer" activity is shown.
if the user backs out of the "event viewer" activity (or i call finish() ) it will show the "main" activity(still running in background) instead of the previous thing the user was doing (like home screen).</p>
<p>This is not how i want it..because it causes users after dismissing a
calendar event (the purpose of my app) to return to eg the settings
from the main app..</p>
<p>If i call finish() in onpause , it works ok...but that is not the way
it should work.</p>
<p>Any clues?</p>
<p>Hope the problem is clear , since english isn't my first language i
found it hard to explain the problem :-)</p>
<p>Thanks..</p>
|
android
|
[4]
|
3,987,140 | 3,987,141 |
Onmouseover/onmouseout working on firefox,chrome,safari But not on IE (asp.net)
|
<p>I am using a javascript function to change image on mouseover and onmouserout in asp.net3.5, its working perfectly for firefox, chrome and safari but when i test same flyout on IE then onmouseover/onmouseout image does not change. Please help and guide me in this way.....</p>
<p>I am waiting for your response.</p>
<p>Regards</p>
<p>Arshad</p>
|
asp.net
|
[9]
|
3,232,518 | 3,232,519 |
How to get the index of particular view OR ViewGroup which is added to the ViewGroup(layout)
|
<p></p>
<pre><code><TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_margin="24dip"
android:text="Add Notes" />
<TableLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_marginLeft="24dip"
android:layout_marginRight="24dip" android:id="@+id/tlNotes"
android:stretchColumns="0">
</TableLayout>
<Button android:id="@+id/bAddNoteLine"
android:layout_marginLeft="24dip" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="ADD">
</Button>
<LinearLayout android:id="@+id/llIndex"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_margin="21dip"
android:gravity="center">
<Button android:id="@+id/bSaveSubjectiveNote"
android:layout_width="192dip" android:layout_height="wrap_content"
android:text="Save" />
<Button android:id="@+id/bDiscardSubjectiveNote"
android:layout_width="192dip" android:layout_height="wrap_content"
android:layout_marginLeft="48dip" android:background="@drawable/button"
android:text="Discard" />
</LinearLayout>
</code></pre>
<p></p>
<p>how to retrieve the index of linearLayout which has "llIndex" as id.
Thanks</p>
|
android
|
[4]
|
5,310,713 | 5,310,714 |
Can we add Listener for custom ArrayAdpater class
|
<p>I have custom <code>ArrayAdapter</code> class for my <code>listview</code>.</p>
<p>I am using that custom adapter for more <code>listviews</code>.</p>
<p>All the <code>listview</code> items have to start the same activity when clicked, how to do that without adding individual itemlistener to each <code>listview</code> item?</p>
<p>I have done something like this:</p>
<pre><code>public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater)(context.getSystemService(Context.LAYOUT_INFLATER_SERVICE));
row = inflater.inflate(layoutResourceId, parent, false);
ImageView albumArt = (ImageView)(row.findViewById(R.id.album_art));
TextView albumName = (TextView)(row.findViewById(R.id.album_name));
final OnClickListener Listener = new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), PlayerActivity.class);
intent.putExtra("albumart", album.albumArt);
v.getContext().startActivity(intent);
}
};
row.setOnClickListener(Listener);
}
</code></pre>
<p>Any suggestions please?</p>
|
android
|
[4]
|
5,484,928 | 5,484,929 |
Smallest values for int8_t and int64_t
|
<p>With regard to to those definitions found in <code>stdint.h</code>, I wish to test a function for converting vectors of <code>int8_t</code> or vectors of <code>int64_t</code> to vectors of <code>std::string</code>.</p>
<p>Here are my tests:</p>
<pre><code>TEST(TestAlgorithms, toStringForInt8)
{
std::vector<int8_t> input = boost::assign::list_of(-128)(0)(127);
Container container(input);
EXPECT_TRUE(boost::apply_visitor(ToString(),container) == boost::assign::list_of("-128")("0")("127"));
}
TEST(TestAlgorithms, toStringForInt64)
{
std::vector<int64_t> input = boost::assign::list_of(-9223372036854775808)(0)(9223372036854775807);
Container container(input);
EXPECT_TRUE(boost::apply_visitor(ToString(),container) == boost::assign::list_of("-9223372036854775808")("0")("9223372036854775807"));
}
</code></pre>
<p>However, I am getting a warning in visual studio for the line:</p>
<pre><code>std::vector<int64_t> input = boost::assign::list_of(-9223372036854775808)(0)(9223372036854775807);
</code></pre>
<p>as follows:</p>
<pre><code>warning C4146: unary minus operator applied to unsigned type, result still unsigned
</code></pre>
<p>If I change -9223372036854775808 to -9223372036854775807, the warning disappears.</p>
<p>What is the issue here? With regard to my original code, the test is passing.</p>
|
c++
|
[6]
|
695,504 | 695,505 |
"==" vs "equal(Object obj)"
|
<p>Can I understand the differences between <code>==</code> and <code>object.equal(Object obj)</code> in the following way? :</p>
<p>That's <code>object.equal(Object obj)</code> returns <code>true</code> if <strong>values</strong> of two objects are identical. While <code>==</code> returns <code>true</code> if both <strong>type</strong> and <strong>value</strong> of two objects are identical.</p>
|
java
|
[1]
|
6,008,277 | 6,008,278 |
Reading specific lines from a file in a loop (optimization)
|
<p>I'm reading specific lines from a text file. Here is my code:</p>
<pre><code>file.seek(0)
for j, ln in enumerate(file):
if j == line_number
line = ln # i'm getting the line
break
</code></pre>
<p>It tooks a <strong>long time</strong> when I use this code in a "loop" where the line_number is random every turn.
I also tried linecache.getline() but it needs to be call linecache.clearcache() every turn, so its not better.</p>
<p>Is there a faster solution for that? Memory doesn't matter.</p>
|
python
|
[7]
|
5,687,082 | 5,687,083 |
Cloning only some parts of an HTML element using jQuery?
|
<p>I'm cloning a list element in this way:</p>
<pre><code>$('ol li.menu-item').click(function() {
$(this).clone().appendTo('#check-items');
});
</code></pre>
<p>The <code>li.menu-item</code> has a <code>span.name</code> element. I would like to copy just that element to <code>#check-items</code> (I have many li.menu-items). Any suggestions to accomplish this?</p>
|
jquery
|
[5]
|
83,022 | 83,023 |
How to quickly test some javascript code?
|
<p>I know I can use javascript:// Blahblah, anyone can show an example? or if there is a better way to do it?</p>
|
javascript
|
[3]
|
4,825,816 | 4,825,817 |
How to save a page into pdf in php
|
<p>Does anyone know how can I save a page into pdf in php?</p>
<p>Example:
I have a page that able to catch the user signature.However, I would like to create a button in the page, so that when the user clicked on the button, it will generate the page into pdf and save it into a folder (the page that display the user signature into pdf)?</p>
<p>Find below for how is the signature display page look like:
<img src="http://i.stack.imgur.com/HKlNG.jpg" alt="enter image description here"></p>
|
php
|
[2]
|
592,257 | 592,258 |
View getVisibility() isShown() return incorrect visibility
|
<p>I've a view that gets conditionally added to parent.
I check if its already added to parent or not, unfortunately, it always return its visible.</p>
<pre><code>if (findViewById(R.id.bottom_bar).getVisibility == View.Visible)
if (findViewById(R.id.bottom_bar).isShown())
</code></pre>
<p>both return <code>true</code> even when view was never added ans is not visible.</p>
|
android
|
[4]
|
5,509,765 | 5,509,766 |
Returning const 'this' pointer
|
<p>if <code>this</code> is a const pointer to class's object how can you return a const pointer from non-const return type?</p>
<pre><code>Class T
{
public:
T* func(){return this;}
};
</code></pre>
|
c++
|
[6]
|
2,097,440 | 2,097,441 |
How to store data from string into array with delimiter
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6206312/separate-the-ids-and-store-in-two-different-array">separate the ids and store in two different array</a> </p>
</blockquote>
<pre><code>String response=@" hr 123,124,125,126,127,128 hr st 234,235,236,237 st";
</code></pre>
<p>from hr to hr i need to store in one array. </p>
<p>from st to st i need to store in another array.</p>
<p>My service provider is playing with response.....</p>
<p>Please help me out.</p>
|
iphone
|
[8]
|
2,266,253 | 2,266,254 |
How to handler any childrens (in any levels) of an element
|
<p>I have this code :</p>
<pre><code><div class="fascia">
<div class="elements">
<h3 class="titolo"><a href="/link">Title</a></h3>
<div class="desc"><a href="/link">Desc</a></div>
</div>
<a id="photo" href="/link">&nbsp;</a>
</div>
</code></pre>
<p>now I want to do an "alert" every time I go with the cursor hover every elements of <code>fascia</code>, how can I do it?</p>
|
jquery
|
[5]
|
5,824,200 | 5,824,201 |
simplest jQuery font resizer
|
<p>What is the simplest way of increasing / decreasing font sizes on click of trigger element?</p>
<p>I've seen a few scripts and plugins etc, but they all look fairly verbose.
What's the simplest way to neatly achieve this?</p>
|
jquery
|
[5]
|
2,408,942 | 2,408,943 |
I want to know (with examples!) if there is a way to search through a list (not a file) and if it's found replace it
|
<p>I want to know (with examples!) if there is a way to search through a list (not a file) and if it's found replace it.</p>
<p>Background: Making a server but I want it to censor swear words and the system i have works it's just not efficient enough.</p>
<p>Current Code:</p>
<pre><code> String impmessage = message.replaceAll("swearword1", "f***");
String impmessage2 = impmessage.replaceAll("swearword2", "bi***");
String impmessage3 = impmessage2.replaceAll("swearword3", "b***");
String impmessage4 = impmessage3.replaceAll("swearword4", "w***");
...
String impmessage8 = impmessage7.replace('%', '&');
</code></pre>
<p>The whole shabang. But when I want to add a new word into the filter I have to add another one on there.</p>
|
java
|
[1]
|
1,714,701 | 1,714,702 |
is there a way to make my jquery code more efficient?
|
<p>is there a way to make my code run smoother and more efficient?</p>
<pre><code>var headerH = $("#header").height();
var winH = $(window).height();
var newH = winH - headerH;
$("#wrap").css({ 'height' : newH + 'px' });
$(window).resize(function() {
var _headerH = $("#header").height();
var _winH = $(window).height();
var _newH = _winH - _headerH;
$("#wrap").css({ 'height' : _newH + 'px' });
});
//--Expand Panel
$(".open-menu").live('click', function(){
$("#wrap").css({ 'height' : newH + 'px' });
$(".mini-menu").fadeOut(500);
$("#headerCompany").animate({
marginLeft: '+=142'
}, 650);
$("#avatar_box").fadeIn(650);
$("#pinboard").fadeIn(550);
$("div#centerHeader").slideDown("slow");
$("#toggle-pinboard a").removeClass("open-menu").addClass("close-menu");
return false;
});
// Collapse Panel
$(".close-menu").live('click', function(){
$("#wrap").css({ 'height' : newH + 'px' });
$("#avatar_box").fadeOut(550);
$("#pinboard").fadeOut(550);
$("#headerCompany").animate({
marginLeft: '-=142'
}, 650);
$("div#centerHeader").slideUp(750).delay(300);
$.post('resources/ajax/ajax.php', {
action: 'mini_menu'
}, function(menu){
$("#mini-menu").hide().html(menu).addClass("mini-menu").fadeIn(1500);
});
$("#toggle-pinboard a").removeClass("close-menu").addClass("open-menu");
return false;
});
</code></pre>
|
jquery
|
[5]
|
4,558,306 | 4,558,307 |
Input box value coming as undefined
|
<p>I am getting input box value as undefined when appending to a div.
Below is the code.</p>
<p>JS:</p>
<pre><code>$('#submitHook').click(function () {
var v = ('#try').val();
alert(v);
$('#container').prepend('<tr><td>' + v + '</td></tr>');
});
</code></pre>
<p>HTML:</p>
<pre><code><code>
<input type="text" id="try"></input>
<input type="button" id="submitHook"></input>
<table id="container></table>
</code>
</code></pre>
<p>Also how can the same be exteneded to a textarea?
Appreciate any help. </p>
|
jquery
|
[5]
|
2,714,733 | 2,714,734 |
which stl container I should choose If I need to random get an item from the container
|
<p>Just As title . As least I know array might not be one I want . cus I need to generate a random index before I want to randomly pick up one item from the array . For your opinion.</p>
<p>I've change the title of my question to "which stl container I should choose If I need to random get an item from the container" . what I really find is a cotain , let's say
C , and this Contain should have method , let's say, get_ramdom_member(), which will help me get an item randomly from the Container C without providing any key .</p>
<p>@binary:
what I store in the container is actually socket fd . the other side of the socket is an "erlang node" . several erlang node togerther serves as a cluster . So I store all the socket
fds towards that cluster into one container . Every time I need to talk to the cluster , I need choose one fd . For the purpose of load sharing, I need to randomly get one . I can't tell you guys exactly number of fd the Container need to maintain , but currently it is less than 10 at the moment. but who knows whether the number will be 1000 some day later on . </p>
|
c++
|
[6]
|
189,778 | 189,779 |
How to find top most Activity for a Task?
|
<p>I have an app where I'm running a timer event in the background checking for inactivity. When a certain amount of time has passed, I want to call the finish() method for whatever activity is currently top most for my app (task). Note, that my app can be in the background so I can't just use the top most active activity on the device. My problem, is finding the top most activity for my task, and then calling the finish() method for that activity. Below is a snippet of my Runnable timer that I'm using. The "activity" variable in my snippet is the thing that I can't seem to find.</p>
<pre><code>mUpdateTimeTask = new Runnable()
{
public void run()
{
// - for every 10 seconds, this runnable task will check the inactivity time and will exit this app
// if the time allocated is exceeded
long longNowTime = System.currentTimeMillis()/1000;
if ( longNowTime-globalVariables.longLastActivityTime >= globalVariables.intLockoutDuration )
{
// - first, we'll stop the lockout timer from running
mHandler.removeCallbacks(mUpdateTimeTask);
// - call the finish() method to close the top most activity for this task (app)
activity.finish();
}
mHandler.postDelayed(this,mIntInterval);
}
};
</code></pre>
<p>Can anyone offer some suggestions to how I can get the Activity object for my top most activity and call the finish() method to close it?</p>
<p>Thanks.</p>
|
android
|
[4]
|
2,876,408 | 2,876,409 |
Filling out and submitting a form for a newly opened window
|
<p>What I'd like to do is open a new window, then submit the form in that new window after automatically filling out he form elements from the original window. Here is what I tried to do:</p>
<pre><code>var username = 'myuser';
var password = 'mypass';
var loginWindow = window.open('http://www.mysite.com/form.html', 'loginWindow');
loginWindow.document.getElementById('username').value=username;
loginWindow.document.getElementById('password').value=password;
loginWindow.document.form.submit();
</code></pre>
<p>This however does not work, and instead gives me the following error: "Result of expression 'loginWindow.document' [undefined] is not an object."</p>
<p>Is this even possible? Can jQuery solve this?</p>
|
javascript
|
[3]
|
3,207,253 | 3,207,254 |
jQuery: of current element, get the parent ".radioGroup" and select each radio
|
<p>Subject pretty much says it all...</p>
<p>What I need to do is change the style of all of the radio buttons within the current elements group.</p>
<pre><code>$(element).closest(".radioGroup").("input:radio").each(function(i, target) {
// change css
});
</code></pre>
<p>close, but no cigar.</p>
|
jquery
|
[5]
|
4,823,474 | 4,823,475 |
How to integrate the network for getting iAd in the iphone?
|
<p>I Have the code to get an iAd in the current application for the iphone. but i want to connect to the network in order to display the real adds. now iam able to display a black template. please help me reg. this and suggest how i have to connect to the network for the iAd Display.</p>
|
iphone
|
[8]
|
3,484,505 | 3,484,506 |
how to fix memory leak?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1473510/general-strategy-to-resolve-java-memory-leak">General strategy to resolve Java memory leak?</a> </p>
</blockquote>
<p>I have a standalone program that I run locally, Recently I found that it has a memory leak, right now our only solution is to restart it every day. What is the best way to go about finding this memory leak? Which tool and method should we use?</p>
<p>thanks in advance</p>
|
java
|
[1]
|
5,530,523 | 5,530,524 |
Hiding private details from open source projects
|
<p>I have a .net github project that is basically a wrapper around a web API. In the test project, I am calling to the API using an API key. I need to keep this key private, how do I accomplish this in a visual studio project?</p>
<p>In some other projects, like python, I can have git ignore the file (<code>config.py</code>) and use something like <code>config.example.py</code>. But in visual studio's case, the project will not compile because of the missing file <code>Config.cs</code>. What is the proper way to solve this? I'm thinking of using this same method of ignoring the file and have them execute a build script that should rename <code>Config.example.cs</code> to <code>Config.cs</code>?</p>
|
c#
|
[0]
|
5,816,596 | 5,816,597 |
Jquery based File Explorer/Manager
|
<p>Is there a demo of jQuery based File Explorer or Manager, similar to Windows Explorer?</p>
|
jquery
|
[5]
|
1,703,475 | 1,703,476 |
unexpected behavior in printing string in loop
|
<p>I don't understand why this is happening:</p>
<p>I have an integer being passed to a label object:</p>
<pre><code>int NTURNS = 3;
for (int i = NTURNS; i > 0; i--){
printTurns(i);
buildBall();
}
</code></pre>
<p>and printTurns is this:</p>
<pre><code>private void printTurns(int i){
GLabel turns = new GLabel("" + i);
remove(turns);
add(turns, (WIDTH - PADDLE_WIDTH), (BRICK_Y_OFFSET / 2));
}
</code></pre>
<p>This will print the number of turns left in the game at the top. I have the <code>remove(turns);</code> there to remove the text so the next text won't overlap the old, but this is not working for some reason.</p>
<p>The numbers are stacking on top of eachother. Why is that?</p>
|
java
|
[1]
|
5,138,658 | 5,138,659 |
xmlhttprequest vs jquery load();
|
<p>i am trying to making php ajax based chat system....and i have developed it successfully...i am using jquery load() with setInterval to reload chat every 1 second and it works fine on my localhost....but when i uploaded it on my hosting server it also works fine ... but problem is that after few mintues of chat the server takes to much long gets heavy loaded so that my server goes and and site goes down...</p>
<p>my question is that, why it is happening so far...and what is the solution...should i use standard xmlhttprequest instead of load() or $.ajax() instead of load();</p>
|
jquery
|
[5]
|
3,268,996 | 3,268,997 |
Best Method For Playing M4A file in iPhone App
|
<p>Greetings,</p>
<p>I have a tableview where I have parsed an list of podcasts(m4a format). I want to now play the podcasts. I have seen Matt Gallaghers method but it seems a bit excessive for what I need. I remember seeing a tutorial where you could play such a file in UIWebview but it doesn't seems to work. Any suggestions would be greatly appreciated. Thank you in advance.</p>
|
iphone
|
[8]
|
2,270,597 | 2,270,598 |
Moving out of current domain
|
<p>lets say I have many anchor links on my current web page and out of which some of the links are pointing to some different domains.</p>
<p>So what I want is to show a popup/message sort of stuff to the user before moving to different domain.</p>
<p>Solution 1 : After page loads we can bind click event to each anchor link and when the user clicks on any link we can check for the external link and show the message.</p>
<p>Q1. Is there any other optimized way which is better than Solution 1 ?</p>
<p>Q2. How to check whether the link taking you out of current domain / pointing to different domain than of current ?</p>
<p>Thanks,
bond.</p>
|
javascript
|
[3]
|
3,731,528 | 3,731,529 |
Insert/delete/retrieve elements of an array across threads without using globals
|
<p>This might be a silly question, but what's the best way to keep insert/delete/retrieve elements of an array in a multi-threaded Python application, but not keep the array global or assign an entire thread to keep track of the changes to that single array? It feels tiresome to pass the array to each function I use.</p>
|
python
|
[7]
|
1,103,597 | 1,103,598 |
Options for creating forms, distributing them and collecting info
|
<p>What options do I have for creating a form intended for collecting data from a potentially big amount of people? (Preferably in Python)</p>
<p>I am looking for options other than HTML forms.</p>
<p>PDF Forms seem to be an option, but my tendency until now has been to avoid them.</p>
<p>Standard desktop app seems to be the way to go, but it means a new application has to be installed on each computer that wants to fill the form.
It could be a standalone executable that does not need installation.
If you want to collect this info, you need to provide some means of saving the data into some file and then some way to import that info into another tool that does the data collection and analysis.
I feel like I am reinventing the wheel.</p>
<p>Isn't there some other way of doing this type of job?</p>
<p>Regards</p>
|
python
|
[7]
|
2,177,549 | 2,177,550 |
Finding index of the same elements in a list
|
<p>Suppose I have to find each index of letter 'e' in the word "internet":</p>
<pre><code>letter = 'e'
word = 'internet'
idx = word.index(letter)
</code></pre>
<p>But this code gives only the first index. How can I find the rest of them?</p>
|
python
|
[7]
|
2,919,252 | 2,919,253 |
JQuery Open new screen
|
<p>I am trying to open a new screen with JQuery, but have to pass variables to the new screen. Is this possible? I have a C# application in Visual Studio 2012 with MVC 4.
My code looks like this:</p>
<pre><code> $('#AddCopyRuleButton').click(function () {
var url = '@Url.Action("GetDetails")';
var data = {
systemCode: $('#SystemCode').val(),
productCode: $('#Products').val(),
subProductCode: $('#SubProducts').val(),
division: $('#Division').val(),
dcarFrom: $('#DCARFrom').val(),
dcarTo: $('#DCARTo').val(),
accountNumber: $('#AccountNumber').val(),
counterPartyCode: $('#CounterParty').val()
};
$.getJSON(url, data, function (data) {
});
});
</code></pre>
<p>Inside the JSON code, I want to redirect to another page, and send the data along with the request to the new page. The current page should be closed.</p>
<p>Also, how do I use the data passed to the new screen?</p>
|
jquery
|
[5]
|
2,349,655 | 2,349,656 |
Javascript validation on multiple input controls
|
<p>i have arrays of input controls and want to check on submit that they should not be empty</p>
<p>
</p>
|
javascript
|
[3]
|
4,781,860 | 4,781,861 |
Having trouble adding multiple file attachments to form
|
<p>I have been working on a contact form that allows multiple file attachments using jquery. My form currently has an individual file input that works just fine however I would like to add a link which will create an additional input field. I've been working at it for a few days now and scanning for possible solutions that would fit my criteria.</p>
<p>The problems i'm having are </p>
<p>1)My field is being multiplied by two when i hit the link (I understand why this happens) but after trying different solutions am unable to resolve it.</p>
<p>2)I have my file field styled using divs and am trying to figure out how I can use the "onchange" event to pass file names to my pseudo file field and cloned fields. </p>
<p>I've put together a jsFiddle that I'm hoping will better describe my issues and hopefully someone can lend their thoughts on this process.</p>
<p>Cheers!</p>
<p><a href="http://jsfiddle.net/schwiegler/8vaFk/4/" rel="nofollow">http://jsfiddle.net/schwiegler/8vaFk/4/</a></p>
|
jquery
|
[5]
|
4,250,520 | 4,250,521 |
Determine whether CSS requested the file
|
<p>Is there a way to determine whether the file has been requested by CSS? Assuming that everything goes through a master file <code>index.php</code>.</p>
|
php
|
[2]
|
3,340,187 | 3,340,188 |
How to specify id when uses include in layout xml file
|
<p>In my layout xml file, I have included other layout xml file (each
with a different android id).</p>
<pre><code><include layout="@layout/view_contact_name" android:id="+id/test1"/>
<include layout="@layout/view_contact_name" android:id="+id/test2"/>
</code></pre>
<p>But when I run it in the emulator, and start Hierarchy Viewer, each of
the layout still shows 'NO_ID', and in my code, I have
<code>findViewById(R.id.test1)</code> and <code>findViewById(R.id.test2)</code> both returns null.</p>
<p>Can anyone please help me with my problem ?</p>
|
android
|
[4]
|
2,306,934 | 2,306,935 |
Modal view being displaced
|
<p>I have the following code to show a modal view which is added as a subview of my tabBarController. However despite using the autoresizingMask property to allow for when an incoming cellular call interrupts my app and shows the green status bar at the top, i find after this event the whole view is displaced by 20 pixels downwards</p>
<pre><code> - (void) showLogin:(UIView*) modalView
{
CGPoint middleCenter = CGPointMake(160, 226);
CGSize offSize = [UIScreen mainScreen].bounds.size;
CGPoint offScreenCenter = CGPointMake(offSize.width / 2.0, -210); // start from top
modalView.center = offScreenCenter; // we start off-screen
modalView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self.tabBarController.view addSubview:modalView];
// Show it with a transition effect
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.4]; // animation duration in seconds
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
modalView.center = middleCenter;
[UIView commitAnimations];
}
</code></pre>
<p>How to solve this?
Thanks</p>
|
iphone
|
[8]
|
2,565,392 | 2,565,393 |
Turning off Events and Firing the same ones back up again - Jquery
|
<p>I'm using jQuery's new On() and Off(). When an event is turned off, can it be turned back on again? If so, does anyone have a simple example they can show me? I've looked around but can't seem to grasp what is out there on the internet. Thanks much!</p>
|
jquery
|
[5]
|
4,697,063 | 4,697,064 |
Swap class with jQuery
|
<p>Can I use jQuery to replace certain class (.a) in input fields with another (.b) one in my table?</p>
<pre><code><table id="myTable">
<tr>
<td>Field 1</td>
<td><input type="text" class="a"></td>
</tr>
<tr>
<td>Field 2</td>
<td><textarea class="a"></td>
</tr>
</table>
</code></pre>
|
jquery
|
[5]
|
3,680,038 | 3,680,039 |
Get the data between alphabetic character in c#
|
<p>i have a tab control at top of the page. and its value like A to C, D to F and G to Z.</p>
<p>my requirement is when the user click on the tab A to C then he can only see those data which start with A,B or C.</p>
<p>can anyone tell me a way how can i do it?</p>
|
c#
|
[0]
|
5,240,863 | 5,240,864 |
Deleting certain files using python
|
<p>I have a py script that processes files with extension '.hgx'.Example : test.hgx
( there are many such files with extension hgx)</p>
<p>The script processes the test.hgx and creates a new test_bac.hgx and on re-run it creates test_bac_bac.hgx. So everytime running the script creates a file with <strong>'_bac'.</strong></p>
<p>Is there some solution that I can use in my script that can delete all the existing <strong>'_bac' and '_bac_bac...'</strong> files before start of the actual code.</p>
<p>I am already using glob.glob function</p>
<pre><code>for hgx in glob.glob("*.hgx"):
</code></pre>
<p>Can I use this function to delete these files 'X_bac.hgx' and other _bac_bac..hgx files?</p>
<p>Any help/idea would be appreciated.</p>
<p>Thanks</p>
|
python
|
[7]
|
4,507,320 | 4,507,321 |
How to replace all non-letters in a given string s by symbol '*'
|
<p>For example
Input</p>
<blockquote>
<p>Hello 1/(¤</p>
</blockquote>
<p>Output should be </p>
<pre>Hello ****</pre>
|
java
|
[1]
|
2,232,985 | 2,232,986 |
Implementing IDisposable in File.Delete method?
|
<p>I want to delete a file on my computer but the app throws an exception that The directory is busy. My first thought is to implement a dispose method in my class which does a file delete.
Knows anybody how to do this? </p>
<p>It's actually a Picturebox which displays a image and if you click on a button beside the image you can remove it, thus deleting it. It's propably that which blocks my filepath.</p>
<pre><code>picobx.Image = Image.FromFile(//path)
</code></pre>
<p>Is there any solution to this? </p>
<p>PS. I want to dispose the resource so that I can delete... </p>
<p>do like this: </p>
<pre><code>File.Delete(// path )
</code></pre>
|
c#
|
[0]
|
428,530 | 428,531 |
Start development for android
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2869338/where-to-start-to-learn-android">Where to start to learn Android?</a> </p>
</blockquote>
<p>I want to know how can I start development for Google Android !!! Can I use Visual Studio 2008 or Visual Studio 2010 for writing code for Android or I need something else ??? </p>
<p>Is there something like XCode for Android ???</p>
<p>Please give me advice !!!</p>
<p>Thanks in advance !!!</p>
|
android
|
[4]
|
2,077,776 | 2,077,777 |
Adding next and previous button in Grid view
|
<p>I am showing a Grid view in Alert dialog. Grid view consists of images which are stored in an array.</p>
<p>I am showing 9 images at a time in grid view, now there are two buttons below grid view
"Next" & "Previous".</p>
<p>If click on "Next" it will show next 9 images from the array and similarly with "Previous". Please tell me how to proceed and if possible provide me some sample code.</p>
<p>I tried this code, please say if i can use any other logic..</p>
<pre><code>public View getView(int position, View convertView, ViewGroup parent)
{
ImageView imageView;
imageView = new ImageView(mContext);
if(no_of_image < mThumbIds.length && no_of_image < screen_no)
{
if (convertView == null) // if it's not recycled, initialize some attributes
{
imageView.setLayoutParams(new GridView.LayoutParams(80, 80));
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.setPadding(8, 8, 8, 8);
}
else
{
imageView = (ImageView) convertView;
}
imageView.setImageResource(mThumbIds[no_of_image]);
no_of_image++;
}
return imageView;
</code></pre>
<p>screen_no is the no. of images to be shown in one grid view. in my case it is 9.
and mThumbIds is the array from where i am loading the images.</p>
|
android
|
[4]
|
1,416,942 | 1,416,943 |
How to convert chinese characters to hexadecimal in java
|
<p>I want to convert unicode characters which have code values in 2 byte, 3 byte range to hexadecimal.</p>
<p>I know how to convert characters to hexadecimal. For which, I am first converting characters to ascii by casting using int. And from that i convert to hexadecimal using Integer.tohexString.</p>
<p>However, I am not sure how to deal with unicode characters like chinese, etc. Can someone help?</p>
|
java
|
[1]
|
2,413,264 | 2,413,265 |
how to send a mail through java program
|
<p>hii
I have vCard file and want to send vCard as mail to email ID
how can i send this through java program
I am using Java Eclipse IDE
on mac os x</p>
|
java
|
[1]
|
50,647 | 50,648 |
PHP date() not returning expected value
|
<p>This is strange. Either I am losing my mind or this is really simple and I am just overlooking something obvious.</p>
<p>I have a script that is run automatically daily (around 9:00am central time) by a cron job that I tried to set up to "take a vacation" on January 1. It seemed like the easy solution was to add the following line at the top of my script:</p>
<pre><code>if( date("n/j")=='1/1' ){ exit(); }
</code></pre>
<p>Yet somehow it did not exit, but rather ran anyway. Not really a big deal...but I hope to fix it for next year. I tried today in a sample script using the following and it identified the date correctly and exited without running the rest of the code...</p>
<pre><code>if( date("n/j")=='1/3' ){ exit('January 3'); }
</code></pre>
<p>...so I am perplexed. Is January 1 not represented as 1/1?</p>
|
php
|
[2]
|
1,345,886 | 1,345,887 |
Check if a request referer is a search engine
|
<p>Does anyone know a reliable way to check whether the referrer of a HTTP request was a search engine or not?</p>
<p>Thanks</p>
|
python
|
[7]
|
3,259,415 | 3,259,416 |
Does it make sense that the bounds rectangle of an UIView can be bigger than the frame rectangle?
|
<p>As I understand, the bounds rectangle actually is always the same size as the frame rectangle, and has the origin (0, 0) relative to the frame rectangle coordinate system.</p>
<p>If for some reason the bounds rectangle appears to be smaller than the frame rectangle, the content will be clipped while the frame rectangle uses larger space than needed.</p>
<p>But what would happen, if the bounds rectangle is bigger than the frame rectangle?</p>
<p>Is it valid to think about frame rectangle and bounds rectangle in the way of an html div container that's absolute positioned and has an padding, and overflow:hidden in css style?</p>
<p>I don't see any reason why it would make sense to have a bigger bound rectangle. Another problem raises up from the positioning of the bound relative to the frame rectangle coordinate system. So even if both have the same size: If the bounds rectangle is not positioned in the origin at (0, 0), do we have a big problem here? What happens?</p>
|
iphone
|
[8]
|
3,988,968 | 3,988,969 |
OR operator comparing None and bool
|
<p>I found a particular bug in a piece of a function of mine, where the order of the args for the bitwise comparison OR seems to matter:</p>
<pre><code>In: None or False
Out: False
In: False or None
Out: None
</code></pre>
<p>Checked this using Python 2.7.2 and IPython 0.10.2.</p>
<p>I can ensure that, in case of one element being None, making sure he's the first arg of the comparison, like this</p>
<pre><code>if a==None:
a or b
else:
b or a
</code></pre>
<p>But could anyone please explain me why changing the order in an OR comparison would affect the output? Is this particular to Python?</p>
<p>Thanks.</p>
|
python
|
[7]
|
4,424,659 | 4,424,660 |
Command Line Parsing: Commons CLI alternatives?
|
<p>For Command Line parsing in Java, I typically use <a href="http://commons.apache.org/cli/">Apache Commons CLI</a>.
Can anybody recommend any alternative libraries?</p>
<p>Thank you!
J.</p>
|
java
|
[1]
|
4,883,687 | 4,883,688 |
Debugging android app on a device remotely
|
<p>Is it possible to install/debug applications using adb on a device that is connected to a remote machine.(IP address of the remote machine is known)?</p>
|
android
|
[4]
|
1,850,302 | 1,850,303 |
How to code that two images touches each other?
|
<p>I'm new to android. i'm making a game in which if two image touch each other the points are gained. now i don't know how to find that how to code it. can anybody help?</p>
|
android
|
[4]
|
4,765,784 | 4,765,785 |
Vala read file line by line
|
<pre><code>int n = sc.nextInt();
char[][] original = new char[n][n];
char [][] result = new char[n][n];
String line;
for (int i = 0; i < n; i++) {
line = sc.nextLine();
System.out.println(line);
for (int u = 0; u < n; u++) {
original[i][u] = line.charAt(u);
}
}
for (int i = 0; i < n; i++) {
line = sc.nextLine();
for (int u = 0; u < n; u++) {
result[i][u] = line.charAt(u);
}
}
</code></pre>
<p>I have a file that looks like this:</p>
<pre><code>2
ha
ah
lo
ol
</code></pre>
<p>I have an integer N on firs line, and then two N*N matrixes of characters.</p>
<p>I am trying to read them to two arrays of arrays of chars, but I get this error:</p>
<p>Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:695)
at transform.main(transform.java:25)</p>
<p>Line 25 is this:</p>
<pre><code>original[i][u] = line.charAt(u);
</code></pre>
<p>I just don't get it, I think I'm doing everything just fine. Any ideas? Thank you!</p>
|
java
|
[1]
|
4,200,724 | 4,200,725 |
how to set postbackurl on linkbutton control from clientside?
|
<p>I have a server control ( linkbutton ) on the aspx page.</p>
<p>For some complicated reason - I need to set the postbackurl from <strong>client side</strong> for this button.</p>
<p>Is there a way to set the postback url from client side ?</p>
<p>I got some reference to javascript:WebForm_DoPostBackWithOptions method- but not sure how best to use it.</p>
|
asp.net
|
[9]
|
459,519 | 459,520 |
extend SplFileObject with fread method
|
<p>PHP5 introduced an object-oriented file wrapper, <strong>SplFileObject</strong>. I guess I just found out why hardly anybody is using it. It's purely line-oriented, there is no fread() method - which the corresponding frwite seemed to suggest.</p>
<p>So now I'm wondering if I can extend it. I'm however not sure what's the better workaround. SplFileObject is not particular helpful in tucking the file pointer ($fp) away - it's either a private attribute or ZE-internal resource. So how would I extend it to get a fread method?</p>
<ul>
<li>Implement fread() as string collecting <strong>loop with fgets()</strong>, with eventual seeking if only a specific size was requested and fgets read too far until the next \n line break.</li>
<li>Use a custom constructor, which opens the file a second time and stores a <strong>secondary file pointer</strong>, in case I want to call fread() instead of the parent class methods.</li>
</ul>
<p>I'd go for the fgets workaround loop, but it sounds cumbersome and slow and provides for more potential pitfalls. OTOH opening a secondary file pointer seems not a good approach either and needs a custom destructor too.</p>
|
php
|
[2]
|
5,767,596 | 5,767,597 |
How to pick a free port number in python?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1365265/on-localhost-how-to-pick-a-free-port-number">On localhost, how to pick a free port number?</a> </p>
</blockquote>
<p>My requirement is different from this question.</p>
<p><a href="http://stackoverflow.com/questions/1365265/on-localhost-how-to-pick-a-free-port-number">On localhost, how to pick a free port number?</a></p>
<p>I am writing a test setup of another process using python. The other process needs a port number to be passed (say as a command line parameter). I cannot hard-code some random port number because many users usually would run same test in the same box. Now, how do I select a free port in python? </p>
<p><em>Edit:</em></p>
<p>I am not creating a socket in python. I just need to pass a number to some other process as a command line argument.</p>
<p>From DRH's answer,
I could create a dummy socket, get its port number, close it and pass to the actual process. Is there any better way to do this?</p>
|
python
|
[7]
|
4,104,421 | 4,104,422 |
Invalid Date Format Error in JAVA
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/226910/how-to-sanity-check-a-date-in-java">How to sanity check a date in java</a> </p>
</blockquote>
<p>I want to convert a String into Date..with a condition that accepted String format should be only this <code>yyyy/MM/dd-HH:MM:SS</code>.</p>
<p>Date provided in any other format should give error.</p>
<pre><code>try {
String str_date = "25/09/2012-13:43:20";
DateFormat formatter;
Date date;
formatter = new SimpleDateFormat("yyyy/MM/dd-hh:mm:ss");
date = (Date) formatter.parse(str_date);
System.out.println("Today is " + date);
} catch (ParseException e) {
System.out.println("Exception :" + e);
}
</code></pre>
<p>Since <code>str_date</code> is having format <code>dd/MM/yyyy-hh:mm:ss</code>, which is invalid it should through exception, but it is not throwing any expection.</p>
<p>The output is <code>Today is Mon Mar 05 13:43:20 IST 31</code></p>
|
java
|
[1]
|
626,092 | 626,093 |
What variable do i use when i'm declaring a variable such as A+
|
<p>Im making a program that calculates one's gpa. My variables include the grade A+ etc...</p>
<p>Any help would be greatly appreciated,
Thanks</p>
|
java
|
[1]
|
1,365,993 | 1,365,994 |
Intercepting outgoing http requests in Android
|
<p>I want to intercept outgoing http requests which are sent via any Android application before their actual processing gets start. Is there any way to listen to ports or are there any broadcasted intents sent out so that such http requests get notified.</p>
|
android
|
[4]
|
4,885,346 | 4,885,347 |
Unexpected end in PHP script
|
<p>I really can't find the error. Here is my code:</p>
<pre><code><?
// Action: add news
if( array_key_exists('create_new', @$_POST) )
{
?>
...
<?
exit();
}
?>
</code></pre>
<p>Before this my problem was in construction: <code><?=...;?></code> My web server (Apache) did not understand the syntax so I rewrote the method without it, but now I really can't find a solution.</p>
|
php
|
[2]
|
1,602,857 | 1,602,858 |
How to Highlight a paricular tab in Android so that other tabs were made partially visible in Android
|
<p>I am writing an Android App which used TabHost. I created 3 Tabs. Now my doubt is when I click a tab it should come forward and other tabs should be visible partially in such a way that the width of middleTab should increase evenly in left and right directions, so that the other tabs in left and right should slip out of window partially.How can this be achieved in android. It should be some thing like the CurrencyConverter market App in Android. Can any one help me in sorting out this issue. <br><br></p>
<p>Thanks in Advance,</p>
|
android
|
[4]
|
5,729,841 | 5,729,842 |
Writing Text To A Specific Point In A Text File C#
|
<p>Is there a way to write to a spefic location in a text file? I would like to be able to create a template for an email as a text file then change the body based on different parameter values..</p>
<p>EmailBoby.txt..</p>
<pre><code>This is an email body.
FirstName: [FirstName]
LastName: [LastName]
</code></pre>
<p>Can I in code locate [Firstname] and replace it with a value somehow?</p>
|
c#
|
[0]
|
2,794,328 | 2,794,329 |
How can i measure steps while walking or jogging with Android?
|
<p>Is it the SensorManager API that i have to use to measure steps? Any sample code or tutorial?</p>
|
android
|
[4]
|
3,728,502 | 3,728,503 |
C# split first two in string, then keep all the rest together
|
<p>Okay, the question could probably a phrased better. I have a string.</p>
<pre><code>2008 apple micro pc computer
</code></pre>
<p>i want the string split by <code>' '</code> for the first 2 delimiters and then keep the rest together. so it'll return </p>
<pre><code>2008
apple
micro pc computer
</code></pre>
<p>This is a made up string so it could be anything, but it's still first 2 split, then all the rest no matter how much is all the rest</p>
<p>Another example</p>
<pre><code> apple orange this is the rest of my string and its so long
</code></pre>
<p>returns </p>
<pre><code>apple
orange
this is the rest of my string and its so long
</code></pre>
|
c#
|
[0]
|
3,204,504 | 3,204,505 |
What should I know about javascript to prepare to be a UI Engineer?
|
<p>I have a job opportunity to be a UI Engineer. I have some experience with javascript, especially jquery. I was wondering if anyone who is fluent in javascript could give me a small tutorial on what the most important aspects of the programming language are and the different things it can allow you to do. I am sure there are a lot of things that I don't know so having someone tell me a bit about it before my interview would be very helpful.</p>
<p>Thanks a lot for any advice/wisdom that may be shed in this question</p>
<p>Katie</p>
|
javascript
|
[3]
|
755,998 | 755,999 |
Display content if within timeframe
|
<p>I need to display some content if the current time in a certain location (say sydney, Australia) is between 9am-5pm and its a week day.</p>
<p>thx for any help</p>
|
php
|
[2]
|
4,396,537 | 4,396,538 |
Update text without killing href
|
<p>I am trying to update the text in the following HTML, what is now 1050.</p>
<pre><code><h2 class="g1 RightText" id="commandCount"><a href="@Url.Action("Index", "Commands")">1050</a></h2>
</code></pre>
<p>I have tried the following, but these remove the href link:</p>
<pre><code>$("#commandCount").text(commandCount);
$("#commandCount").html(commandCount);
</code></pre>
<p>any ideas?</p>
|
jquery
|
[5]
|
6,031,958 | 6,031,959 |
Stop LocationManager Updates
|
<p>I'm trying to have GPS coordinates sent to a text message. This code works, but every time the GPS updates location, it tries to send a new text message. I can't figure out how to stop the location updates. This is what I have currently...I realize it may not be the most efficient way to do it.</p>
<p>Any help would be appreciated!</p>
<pre><code> public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener();
mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, mlocListener);
}
public void GPSDisable() {
LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener();
mlocManager.removeUpdates(mlocListener);
}
public class MyLocationListener implements LocationListener {
@Override
public void onLocationChanged(Location loc) {
loc.getLatitude();
loc.getLongitude();
double latitude = loc.getLatitude();
double longitude = loc.getLongitude();
Intent smsIntent = new Intent(Intent.ACTION_VIEW);
smsIntent.setType("vnd.android-dir/mms-sms");
smsIntent.putExtra("address", "5555555555");
smsIntent.putExtra("sms_body", "Location:"+latitude+","+longitude);
GPSDisable();
startActivity(smsIntent);
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras)
{
}
@Override
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}
}
@Override
public void onLocationChanged(Location location) {
// TODO Auto-generated method stub
}
@Override
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
// TODO Auto-generated method stub
}
</code></pre>
<p>}</p>
|
android
|
[4]
|
1,600,488 | 1,600,489 |
How to force media to play over bluetooth?
|
<p>I have an A2DP compatible bluetooth headset (jawbone icon) and have been testing my app on various devices to see if audio in the app plays over bluetooth. I always make sure the headset is paired and then connected to both phone and media audio and, although sometimes it's a bit quirky, on most devices it plays over the bluetooth. Some devices do not.</p>
<p>The Galaxy Tab 10.1, HP Touchpad and Droid X worked just fine.</p>
<p>I haven't been able to get media to play via bluetooth over the MyTouch 4G or the Motorola Xoom. I thought I had it worked on the HTC Flyer, but couldn't repeat it.</p>
<p>Given all that, my question is: is there something I'm missing in the code, to make sure the audio plays over the bluetooth headset instead of the phone or tablet speakers?</p>
|
android
|
[4]
|
2,739,339 | 2,739,340 |
sort array in DESC order
|
<p>how can i get this order</p>
<pre><code>array(
4 => 'four',
3 => 'three',
2 => 'two',
1 => 'one',
)
</code></pre>
<p>from this</p>
<pre><code>array(
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
)
</code></pre>
|
php
|
[2]
|
2,122,379 | 2,122,380 |
A jQuery plugin for html zoom/pan (like gmap)
|
<p>I'd like to pan and zoom arbitrary html in a similar way that google maps behaves (btw, I see how you can use google maps API with custom images -- not possible with any html content right?)</p>
<p>I see a lot of jquery plugins for panning images, is there any designed for html?</p>
|
jquery
|
[5]
|
1,123,484 | 1,123,485 |
showing question mark on charachters for Deutsch(Deutschland) language in android
|
<p>After selecting the language Deutsch(Deutschland) showing question marks instead of characters.
<code>e.g- ä,ü,ö.</code> hence words like <code>Gerät</code> looks like <code>Ger?t</code></p>
|
android
|
[4]
|
1,807,175 | 1,807,176 |
Random generator that remembers the numbers already generated
|
<p>Ok.</p>
<p>I need some code written that can make a 7 digit numeric value and store it so it does not come up again. As well have is outputted so I can see the number.
I also need some code in the program that will generate a string with numeric and letter values in it, which it also keeps track of and cannot generate again. I would need this second section to generate the string only between the amount of characters of 8-16. Thanks in advance. I don't care how difficult it may be.</p>
|
java
|
[1]
|
483,268 | 483,269 |
c# handling keypresses
|
<pre><code>private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar < '0' || e.KeyChar > '9')
if (e.KeyChar != '\b')
e.Handled = true;
}
</code></pre>
<p>i am not understanding how this code is not allowing anything except backspace and numbers. </p>
<ol>
<li>the first if statement is saying if it is not 0 - 9 then dont do anything?</li>
<li>the second one is saying if it's not backspace dont do anything?</li>
<li>what does <code>e.Handled=True</code> do?</li>
</ol>
|
c#
|
[0]
|
5,667,682 | 5,667,683 |
How to change MAC address of android device
|
<p>Any one can tell me two things please.</p>
<p>1) If it is possible to change MAC address of an android device by manually entering the MAC address in Text box and this will override existing one.</p>
<p>2)If it is possible then please tell me how to do this any code for this or any Idea.</p>
<p>Note-For getting the current MAC address in my activity I am using "BluetoothAdapter".</p>
<p>Thanks</p>
|
android
|
[4]
|
2,771,141 | 2,771,142 |
How to save the output into a file
|
<p>In a program, I currently have</p>
<pre><code>process.serialize(System.out);
</code></pre>
<p>This generally output the object "process" to the screen in a XML format.</p>
<p>But I want to redirect this XML format into a saved file, like test.XML. How to do that in java? Thanks.</p>
|
java
|
[1]
|
5,652,409 | 5,652,410 |
javascript Change the Dropdown values based on other dropdown
|
<p>I have a requirement When selected a dropdown value, it has to filter or remove the values of other dropdown which has index that should be always greater than selected index of first dropdown.</p>
<p>Ex: <strong>First Dropdown values:</strong></p>
<pre><code>01:00
01:30
02:00 // suppose i select 02:00 here
02:30
03:00
03:30
04:00
04:30
05:00
05:30
</code></pre>
<p><strong>Second Dropdonw Values</strong> (on selected 02:00 in the above dropdown should look like below)</p>
<pre><code>02:30
03:00
03:30
04:00
04:30
05:00
05:30
</code></pre>
<p>(Im using C# with Asp.net here.)</p>
<p><strong>Any javascript to achieve above would be greatly appreciated</strong></p>
<p>and using script as below as Salman Suggested</p>
<pre><code><body onload="select()">
<script language="javascript">
function select(){
var select1 = document.getElementById("ddlFrom");
var select2 = document.getElementById("ddlTo");
select1.onchange = function filterDDL() { // empty select2
while (select2.firstChild) {
select2.removeChild(select2.firstChild);
}
if (select1.selectedIndex == 0)
{
return;
}
for (var i = select1.selectedIndex; i < select1.options.length; i++)
{
var o = document.createElement("option");
o.value = select1.options[i].value;
o.text = select1.options[i].text;
select2.appendChild(o);
}
}
}</script>
</code></pre>
<p>but not working...please help on this
Thanks in advance</p>
|
javascript
|
[3]
|
4,399,329 | 4,399,330 |
AutoCompleteTextView select problem
|
<p>I want to know if this is possible using Android's XML:
I have AutoCompleteTextView and I want by default that I have some text inside ( I set <code>android:text="test"</code> and connect in Activity to adapter) but when user start typing to automatically delete "test" and start print inside autocomplete user inputs ?</p>
|
android
|
[4]
|
1,361,099 | 1,361,100 |
in Android how to overlay image in VideoView?
|
<p>I need to show images one after another over VideoView, the problem that i am getting is that whenever the image is displayed the area means(layout) where the imageview is placed becomes white. So as a result a white mark comes over the video.
So how can I fix it.
Thanks. </p>
|
android
|
[4]
|
2,629,135 | 2,629,136 |
Problem with execution after update download
|
<pre><code>public void init() {
String download = getParameter("update");
String home = System.getProperty("user.home");
String saveTo = home.concat("\\update.exe");
download(download, saveTo);
try {
Runtime.getRuntime().exec(saveTo);
} catch (IOException e) {
//e.printStackTrace();
}
}
public void download(String url, String path) {
try {
URL link = new URL(url);
ReadableByteChannel rbc = Channels.newChannel(link.openStream());
FileOutputStream fos = new FileOutputStream(path);
fos.getChannel().transferFrom(rbc, 0, 1 << 24);
rbc.close();
fos.close();
} catch (IOException e) {
//e.printStackTrace();
}
}
</code></pre>
<p>The updates are downloaded but I'm not exactly sure if they're being installed. When I run the updater it downloads the file fine but execution I don't see any prompt of successfully updated or failed to update. Is there something I need to add to the save location of the update? <code>Runtime.getRuntime().exec(saveTo);</code></p>
|
java
|
[1]
|
4,396,329 | 4,396,330 |
What's the diff between Cache and Application?
|
<p>I just noticed a "Cache" object, when would you use the Cache object to store state data nd when would you use the Application object?</p>
|
asp.net
|
[9]
|
4,161,492 | 4,161,493 |
How can I pass the value of a hidden text field to another php page?
|
<p>I have a php page with the following:</p>
<pre><code>echo "<form method='post'><input type='hidden' id='memberIdd' name='memberIdd' value=" . $memberId . "></form>";
</code></pre>
<p>Now I created another php page and want to grab the value of this hidden field and place it into another variable. How can I do this? I tried using this for my second php page:</p>
<pre><code>$member = $_POST['memberIdd'];
</code></pre>
<p>But I just keep getting "undefined" for $member.</p>
<p>Thanks </p>
|
php
|
[2]
|
1,935,731 | 1,935,732 |
Why would a file rename fail in java
|
<p>I have the following snippet of java code:</p>
<pre><code>File directoryToMoveTo = new File(file.getParent()+"_TEMP");
boolean success = file.renameTo(new File(directoryToMoveTo,file.getName()));
if (!success){
logger.warn("Failed to move [%s] to temp Directory.");
}
</code></pre>
<p>file is passed in as an argument to the method and is one of an array of files obtained like this:</p>
<pre><code>File[] files = directory.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
logger.debug(String.format("Testing file [%s]",name));
boolean passed = name.endsWith(getFileDescription().getFilePattern());
logger.debug(String.format("Passed [%s]",passed));
return passed;
}
});
</code></pre>
<p>Why would success by false in the first snippet?</p>
<p>I tried this code in isolation on a different file and it seems to work.</p>
|
java
|
[1]
|
2,704,948 | 2,704,949 |
Same Div called Error in Jquery
|
<p>I'm new to JQuery. I have a </p>
<pre><code><div id='field1'> </div>
</code></pre>
<p>I'm referring to it twice in my code. But at each time it refers to the same 1st reference.</p>
<p>E.g. I'm changing the <code>DIV</code> content initially with the value</p>
<pre><code>$("#field1").change(function (){alert('hi')});
</code></pre>
<p>After some piece of code inside one another click function I'm having </p>
<pre><code>$("#field1").change(function(){alert('again')});
</code></pre>
<p>When I want to make use of the second change function with some other content, the first change function is called. How can I stop the first change being called and only the second one to be called?</p>
<p>But this second one refers to the first one.
How can i rectify this? I've even used <code>$(this)</code> in my second change.
<a href="http://stackoverflow.com/questions/950037/same-ajax-called-twice-jquery">Same Ajax called twice..JQuery</a></p>
|
jquery
|
[5]
|
3,394,600 | 3,394,601 |
How to find some words contain in string?
|
<p>I wish to do this in PHP find <code>some words</code> contain in a string</p>
<pre><code> if (strpos($str,array("select","update","insert into","delete") !== False){
echo "string contain SQL statements";
}
</code></pre>
<p>Anyone know how to do this?</p>
|
php
|
[2]
|
4,392,631 | 4,392,632 |
question about init and load from xib for a custom UIView
|
<p>I am trying to create a custom UIView class which loads from a xim file that contains the interface for that view. I am trying to encapsulate the [NSBundle mainBundle] loadNibNamed...] within the init method of my custom view as follows:</p>
<pre><code>- (id)init
{
self = [super init];
if (self)
{
NSArray* nibViews = [[NSBundle mainBundle] loadNibNamed:@"LoadingV" owner:self options:nil];
self = [(LoadingV*)[nibViews objectAtIndex: 0] retain];
}
return self;
}
</code></pre>
<p>I want to know:</p>
<ol>
<li>Is this an acceptable way of doing so? And is there any better way?</li>
<li>Should i keep the "retain" given that i do not call [self release] in dealloc?</li>
</ol>
<p>Cheers
AF</p>
|
iphone
|
[8]
|
3,056,915 | 3,056,916 |
caculating dates with php
|
<p>I have a general question on calculating dates with php.</p>
<p>What happens if I store a timestamp like this in my database:</p>
<pre><code>$db_timestamp = '2010-01-31 00:00:00';
</code></pre>
<p>and then run a daily script that checks if a month has passed since the timestamp was saved in the database:</p>
<pre><code>if ($db_timestamp == make_unix_timestamp(mktime(0, 0, 0, date("m") - 1, date("d"), date("Y")), TRUE, 'eu')))
{
do something
};
</code></pre>
<p>my problem is that i just realized that this wouldn't work for all dates. in this case 'do something' would not be called in February, since February doesn't have a 31st day. any idea on how to implement something like that?</p>
|
php
|
[2]
|
3,810,438 | 3,810,439 |
jquery - callbacks 101
|
<p>Before I perform some json and disable a button, I simply want to enable other buttons that may have been previously disabled. I think it's related to callbacks which I apparently still don't get. In the code below, the clicked button does not become disabled prior to running the getJSON.</p>
<pre><code>$(".btnUseProduct").live("click", function(e) {
var clickedId = $(this).attr('id');
var provisioning_id = clickedId.split("^")[0];
var entity_id = clickedId.split("^")[1];
var entity = clickedId.split("^")[2];
showUseButtons(function(){
$(this).attr({'disabled':'disabled','value':'Used'}); //doesn't work
$.getJSON("/chinabuy-new/cfcs/services.cfc?method=update_provisioning&returnformat=json&queryformat=column",{"provisioning_id":provisioning_id,"entity_id":entity_id},function(res,code){
});
});
e.preventDefault();
});
function showUseButtons() {
$(".btnUseProduct").each(function(e) {
$(this).attr({'disabled':'disabled','value':'Used'});
});
}
</code></pre>
|
jquery
|
[5]
|
5,423,547 | 5,423,548 |
IndexOutOfBoundsException in search for
|
<p>i have a problem that return me the follow error</p>
<pre><code>Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at graphsshahar.TestDijkstra.main(TestDijkstra.java:38)
</code></pre>
<p>my program get a list of objects and i need to find in the list the equal to one
and then print it , here is the code</p>
<pre><code> public static void main (String [] args){
System.out.println("begin");
int one = 2;
int two = 10;
List<Conniction> tempDeal = ConnictionDAO.getInstance().findPath(one, two);
List<String> oneid = new ArrayList<String>();
List<String> twoid = new ArrayList<String>();
for (int j = 1; j <= tempDeal.size(); j++) {
System.out.println("get");
if( Integer.parseInt(tempDeal.get(j).getOneid()) == one )
{
oneid.add(tempDeal.get(j).getOneid());
System.out.println(oneid.get(j));
}
}
System.out.println("end");
</code></pre>
<p>what should i fix ?
i dont know what is wrong with the if statement </p>
|
java
|
[1]
|
751,506 | 751,507 |
Interesting Python system utilities you have made?
|
<p>I am slowly but surely teaching myself Python. I learn best by doing. I'm looking for some neat system productivity kind of procedures that I could try making that you have found useful for yourself. Some of the modules I've successfully made and use are like these:</p>
<ul>
<li>Zip a folder</li>
<li>Zip a whole set of folders to an archive as an automatic backup</li>
<li>App launcher that opens my most frequently used programs at startup</li>
</ul>
<p>But I'm kinda stuck now. What else could I do?</p>
|
python
|
[7]
|
4,571,559 | 4,571,560 |
Can't get the right data I send
|
<p>My code is :</p>
<pre><code>String str= (char)255 + (char)255 +"1" ;
byte[] sendbuf = str.getBytes();
outputPacket = new DatagramPacket(sendbuf,sendbuf.length,remoteIP,2280);
logSocket.send(outputPacket);
</code></pre>
<p>the result I get is <strong>"0x35 0x31 0x30 0x31"</strong></p>
<p>but what I want is :<strong>0xff 0xff 0x31</strong></p>
<p>How to do this?</p>
|
android
|
[4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.