Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
861,575 | 861,576 |
$.ajax() post json data type
|
<p>That is my function, for exp.:</p>
<pre><code>adId = 1, adTitle = test
function deleteAd(adId, adTitle) {
$.ajax({
dataType: 'json',
url: 'ajax.php',
type: 'POST',
data: {
adId : adId,
adTitle: adTitle
},
success: function(data) {
alert(data);
}
});
</code></pre>
<p>That is ajax.php:</p>
<pre><code>echo $_POST['adId']; echo $_POST['adTitle'];
</code></pre>
<p>But echo only adId, don't have adTitle.</p>
<p>I try this:</p>
<pre><code> data: {
adId : adId,
adTitle: "test"
},
</code></pre>
<p>And don't have result too. With HttpFox I found this post and postdata is: adId=1&&adTitle=test</p>
|
javascript jquery
|
[3, 5]
|
5,914,333 | 5,914,334 |
How to make hitTest, Collision Detection Functionality in Android
|
<p>I have three small ImageView on Screen/View. OnTouch and onTouchMove I have to detect that the Touch/Mouse has collide the ImageView.</p>
|
java android
|
[1, 4]
|
1,270,230 | 1,270,231 |
Position a relative layout below a listview element
|
<pre><code>RelativeLayout item = (RelativeLayout)findViewById(R.id.catalogParent);
View child = getLayoutInflater().inflate(R.layout.detailedcatalog, null);
RelativeLayout.LayoutParams layoutParams = new
RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.addRule(RelativeLayout.BELOW,view.getId());
item.addView(child, layoutParams);
</code></pre>
<p>Above is the code for placing a layout below a listview element. The view.getId() function is always returning a -1. The relative layout is being inflated programmatically during runtime.</p>
<pre><code>lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View view,
int position, long arg3) {
...}}
</code></pre>
<p>The view object is obtained from the onItemClick function. Can you please help me with this. Thanks in advance.</p>
|
java android
|
[1, 4]
|
1,419,854 | 1,419,855 |
jQuery, same function for multiple ids
|
<p>i want to clear specified input if the value is not number. function works for one ID, but i want it to work for multiple. of course i can write function multiple times but i dont want to do that.</p>
<p>the following code gets effect only for input with id "d". i dont know how to identify other ids. can anyone help?</p>
<pre><code><input id="d" />
<input id="d2" />
<input id="d3" />
<script type="text/javascript">
$('#d,d2,d3').keyup(function(){
if($('#d,d2,d3').val() != "") {
var value = $('#d,d2,d3').val().replace(/^\s\s*/, '').replace(/\s\s*$/, '');
var intRegex = /^\d+$/;
if(intRegex.test(value)) {}
else {
$(this).val('');
}
}
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,371,313 | 4,371,314 |
Android browser: Some javascript functions stop working randomly
|
<p>I am writing an android (2.2) app which launches the default native web browser via a new Intent to a page I've created. On that page, it pauses for 2 seconds before then submitting a form, which redirects the user to another page.</p>
<p>I am using javascript's setTimeout() function.</p>
<p>It works most of the time, but then sometimes it just stops working, and won't work again until I restart the phone!</p>
<p>There are NO javascript errors which appear in LogCat.</p>
<p>Even stranger, to counteract this I put a link on the page that says "If the page has not redirected in 5 seconds click here". It submits the form when clicked, via onClick() and .submit(). Well, again, it usually works, but, when the setTimeout() function stops working, so does the link! But, I have confirmed that alert() still works, so some javascript functions apparently still work.</p>
<p>Any ideas why setTimeout() and .submit() would just randomly stop working, until the phone is reset?</p>
<p>EDIT: I've also confirmed that window.location doesn't work anymore either, but, if you just have a regular link, it does actually let you click on it, and it leaves the page.</p>
<p>EDIT: It appears that you can get this problem to happen more quickly if you hit STOP and REFRESH a few times while waiting for the setTimeout to fire off. Basically if I hit stop, then refresh, then stop, then back, etc, a couple times, I can get this problem to happen. After it starts, no amount of refreshing or killing/restarting the browser will make these javascript functions start working again.</p>
<p>Thanks!
Richard</p>
|
javascript android
|
[3, 4]
|
337,494 | 337,495 |
onPause/Resume/Start/Stop order
|
<p>Im trying to detect the global Application onPause. For doing it I'm registering every Activity onResume, onPause, onStop calls.
I'd like to know if I can assume the calling order (when the ActivityA leaves and enters the ActivityB) is always:</p>
<pre><code>A ->onPause;
B ->onStart;
B ->onResume;
A ->onStop;
</code></pre>
<p>Is there some case where the A-> onStop is called before the B-> onResume?</p>
<p>I'm asking that because thats the method I'm using for detecting the globalPause and want to validate it:</p>
<pre><code> onPause(){
active=false;
}
onResume(){
active=true;
}
onStop(){
if(!active) onGlobalPause();
}
</code></pre>
<p>thanks</p>
|
java android
|
[1, 4]
|
2,312,460 | 2,312,461 |
asp.net to php encoding
|
<p>I need to do this with php encryption method.
turkey 3d a bank payment module in the code for the example given to me in this way encryption.
could you help me translate this into php code?</p>
<pre><code> SHA1 sha1 = new SHA1CryptoServiceProvider();
byte[] notHashedBytes = System.Text.Encoding.ASCII.GetBytes(notHashedStr);
byte[] hashedByte = sha1.ComputeHash(notHashedBytes);
string hashedStr = System.Convert.ToBase64String(hashedByte);
return hashedStr;
</code></pre>
|
php asp.net
|
[2, 9]
|
4,548,337 | 4,548,338 |
Add URL variables with Server.Transfer in asp.net
|
<p>I am currently trying to add a variable to the url using Server.Transfer. I need to use Server.Transfer as I need to keep form post data which is why I can't use Response.Redirect.</p>
<p>I am using <code>Server.Transfer("add_account.aspx?error=userNotFound");</code> but the variable is not being added to the URL. </p>
<p>Thanks for your help. </p>
|
c# asp.net
|
[0, 9]
|
915,451 | 915,452 |
random genereration in ASP.NET---
|
<p>My following code generates two different values but I need same value to be posted for an event.</p>
<pre><code> protected void Button1_Click(object sender, EventArgs e)
{
try
{
string url = "transfer.aspx";
string rgen = randomurl.passwordString();
string gpeck = rgen;
Response.Redirect(url + "?msession=" + gpeck);
Session["sendval"] = gpeck;
}
catch
{
}
}
</code></pre>
<hr>
<pre><code>class file :
public class randomurl
{
public static string passwordString()
{
string allowedChars = "";
allowedChars = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,";
allowedChars += "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,";
allowedChars += "1,2,3,4,5,6,7,8,9,0";
char[] sep = { ',' };
string[] arr = allowedChars.Split(sep);
string passwordString = "";
string temp = "";
Random rand = new Random();
for (int i = 0; i < Convert.ToInt32(64); i++)
{
temp = arr[rand.Next(0, arr.Length)];
passwordString += temp;
}
return passwordString;
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,737,205 | 5,737,206 |
How read values from MultipleSelectListPreference
|
<p>I want to read my string arrays entries from <code>SharedPreferences</code> that were saved via MultipleSelectListPreferences. </p>
<p><code>getStringSet()</code> seems to be the only method on SharedPreferences that fits the requirements.
How do I extract the saved String array with this method - I don't understand how to get the array from a String set.</p>
|
java android
|
[1, 4]
|
1,656,140 | 1,656,141 |
How to show a label message, then hide it after some seconds?
|
<p>I would like to show a message on my ASP.Net page like "Record saved" on save button click. After 5 seconds, I would like to hide it.<br>
How can I do in JavaScript? Can I avoid to add jQuery (I'm not using it)?</p>
|
javascript asp.net
|
[3, 9]
|
4,676,732 | 4,676,733 |
space or not outputting in jQuery
|
<p>I have the following being extracted from an XML and being put into a jQuery variable. </p>
<pre><code> links.append($("<a href='"+alink+"'></a>&nbsp;").html(desc));
</code></pre>
<p>...however the <code>&nbsp;</code> does not output onto the page. I need this to separate the hrefs on output</p>
<p>I have also tried</p>
<pre><code>links.append($("<a href='"+alink+"'></a>").html(desc));
links.append($("&nbsp;"));
</code></pre>
<p>Many thanks!</p>
|
javascript jquery
|
[3, 5]
|
1,573,361 | 1,573,362 |
How to retrieve content passed back from remote server when the server reponds with a System.Net.WebException 422
|
<p>I am working with an api that also returns a valid xml string containing the error that was encountered on their system.</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<error>
<request>Request made to server</request>
<message>No user found for account 12345</message>
</error>
</code></pre>
<p>Is there any way to get that xml from the remote server out of the System.Net.WebException object?
Thanks in advance :)</p>
|
c# asp.net
|
[0, 9]
|
2,188,271 | 2,188,272 |
Curve Global Approximation, Java implementation
|
<p>I need fit a curved line to a set of vertices. A very promising method for doing this is discussed in the below link, though I'm finding it a bit challenging to implement the algorithm from the discussion. I was hoping that someone might be aware of an available java implementation of this algorithm?</p>
<p><a href="http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/INT-APP/CURVE-APP-global.html" rel="nofollow">http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/INT-APP/CURVE-APP-global.html</a></p>
|
java android
|
[1, 4]
|
5,634,248 | 5,634,249 |
How to disable a control in command field control in gridview
|
<p>how to find a command field control in the gridview.</p>
<p>in a method not in the row data bound.</p>
<p>so far i have used this coding but i cant find the control.</p>
<pre><code><asp:CommandField ButtonType="Image" ShowEditButton="True
HeaderText="Enter Leave"
EditImageUrl="~/IMAGES/edit-icon.gif">
<ItemStyle HorizontalAlign="Center" />
</asp:CommandField>
</code></pre>
<p>source code:</p>
<pre><code>ImageButton edit = (ImageButton)EmployeeDetails.FindControl("Image");
edit.Enabled = false;
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,818,802 | 1,818,803 |
On hover display none, on mouse out display block
|
<p>I have a div on my page, that is click and draggable. </p>
<p>Over this div, I have another that is absolutely position. </p>
<p>On hover of this div, I want it to fade out and dissapear so i can use the div beneath, I cant seem to get it working however. Is there a way to say on hover, display none, on mouse leave, display block?</p>
<p>Currently im using...</p>
<pre><code>$('.overlay').hover(function() {
$(this).stop(true).fadeTo("fast", 0);
}, function() {
$(this).stop(true).fadeTo("fast", 0.3);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,288,853 | 1,288,854 |
How to retrive value from dynamic button
|
<p>I created a dynamic button inside c# code and I have assigned some value in <code>button.text</code> but the problem is that on <code>buttn_Click</code> event I want to show details related to that value. So any idea how to do this?</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < list.Count; i++)
{
lnk1 = new Button();
VW obj1 = list[i];
lnk1.Text = " "+obj1.ticketNo+": "+obj1.subject+": "+obj1.qu;
lnk1.Click += new EventHandler(lnk1_Click);
}
}
</code></pre>
<p>I want to show above mentioned obj1.ticketno in next page like ticket No: some value is selected</p>
|
c# asp.net
|
[0, 9]
|
3,104,879 | 3,104,880 |
How to rearrange an array in JQuery
|
<p>I have this being POSTed to my script</p>
<pre><code>Array
(
[0] => Array
(
[name] => test1
[value] => test1 value
)
[1] => Array
(
[name] => test2
[value] => test2 value
)
)
</code></pre>
<p>What I want is:</p>
<pre><code>Array
(
[0] => Array
(
[test1] => test1 value
)
[1] => Array
(
[test2] => test2 vlaue
)
)
</code></pre>
<p>This is the JQuery I am using to post the data. Can someone tell me what I need to achieve this?</p>
<pre><code>var vals = $("#post").find('input,select,textarea').serializeArray();
vals.push({
name: 'article',
value: CKEDITOR.instances.article.getData()
});
var qs = $.param(vals);
$.post('test.php', {
data: vals
}, function (data) {
if(data.success == 0) {
}
}, 'json');
</code></pre>
<p><strong>EDIT:</strong>
What I am looking to do is to simply access each key value on my server like this:</p>
<pre><code> echo $_POST['test1'];
...
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,906,463 | 2,906,464 |
Periodic timer not working with .load
|
<p><strong>Problem:</strong></p>
<p>I believe that .load is blocking but is intended to be asynchronous.</p>
<p><strong>Code:</strong></p>
<pre><code>$(window).load(function(){
$('#content').load('/ajax/databaseworking.php');
setTimeout(function(){ $('#content').load('/ajax/databaseperform.php');}, 5000);
});
</script>
</code></pre>
<p><strong>Further Details:</strong></p>
<p>The code basically calls databaseworking.php to do some database maintenance. Every 5 seconds, an ajax call is made to get its progress. </p>
<p>I have checked my logs. databaseworking.php and databaseperform.php are being called. However, databaseperform.php is not being called periodically. In other words, its only being called once.</p>
<p>As a test, I commented out the databaseworking call. This lead to the the progress function being called per interval as intended. This makes me believe that there is a problem with load. Note I have checked and tested databaseworking.php and there shouldnt be an error in there.</p>
|
javascript jquery
|
[3, 5]
|
2,392,970 | 2,392,971 |
Android resource not found exception?
|
<p>I am having a strange problem using findViewById(id). It comes back with resource not found even though the resource is definitely there. It is a textview in a layout next to another textview, one of the textviews I can find by id but the other shows resource not found. Is there any reason this might be happening?</p>
|
java android
|
[1, 4]
|
4,340,753 | 4,340,754 |
How to define Variable similer to Session variable in ASP.NET
|
<p>I want to define a variable or object like session, to stored data about each user, and i want to access this object in many pages,
could u please tell me if there is a way.
thanks</p>
|
c# asp.net
|
[0, 9]
|
362,605 | 362,606 |
Truncate a double variable in Javascript?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4912788/truncate-decimal-number-not-round-off-in-jquery">Truncate Decimal number not Round Off in jquery</a> </p>
</blockquote>
<p>I have values like <code>5.3777777</code>, <code>4.6666666</code> on my <code>Y</code> variable.</p>
<p>How can I truncate it so it shows 5.3 or 5.6 instead with JavaScript?</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
4,691,905 | 4,691,906 |
Replacing a substring in href-attribute using jQuery
|
<p>I have some "a" tags in div. I have to change part of the href. For example: <a href="http://jsfiddle.net/A6z88/" rel="nofollow">http://jsfiddle.net/A6z88/</a>, I have to change only 'foo' in the href with 'asd'. Thanks a lot and sorry for my english :D</p>
|
javascript jquery
|
[3, 5]
|
6,030,225 | 6,030,226 |
Comparing user's voice to an audio file
|
<p>How can i make a continuous speech recognition and use that to compare between what i am saying and a text that has already been stored, or and audio that had been stored like for example the lyrics to a song or something.</p>
|
java javascript android
|
[1, 3, 4]
|
162,060 | 162,061 |
Copy object properties to a new object and delete the new (not by reference)
|
<p>I have a Javascript array of objects, which is initialised with some values.
I want to copy those values to a new array of objects, but without referencing to the original one.
Then i want to manipulate the new object as i wish.</p>
<p>I tried <code>objectOptions.concat()</code> like in this sample code but it then deletes also the referenced original object:</p>
<pre><code>var objectOptions = [{option1: 'value1', someOption: 'value2'}];
function objectClean(){
var newObjectOptions = objectOptions.concat();
for(var i in newObjectOptions )
{
delete newObjectOptions[i]['someOption'];
}
return newObjectOptions ;
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,846,063 | 1,846,064 |
jQuery get height in pixels
|
<p>I have the following elements in a HTML page:</p>
<pre><code><body>
<div style="height:100%; width:100%">
<div style="height:100px;"></div>
<div id="container" style="height:25%; width:50%">
</div>
</code></pre>
<p>Now I would like to get the height in pixels of the div <code>container</code> using jQuery (or plain JavaScript).
How can I do it?</p>
<pre><code>$('#container').height() // returns `0`
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,906,541 | 1,906,542 |
Android & Java simple Code
|
<p>I Wonder what is and does (this) in this code:</p>
<pre><code>Button btn = new Button(this);
</code></pre>
|
java android
|
[1, 4]
|
4,836,490 | 4,836,491 |
Run logic on same date only
|
<p>I have a situation where my logic is comparing my column 0 (list of time) to a 24hour javascript clock, and returns a stoplight color scheme on the row depending on how close the times are. </p>
<p>The issue is when its 23:00(11pm) and there is a item in my time column that read "2:10am"(next day) my logic thinks its a late time, and does not recognize it's tomorrow's item. my color coding logic works but I only need this to execute if cell[0] date is equal to the system date(js clock).</p>
<pre><code> //date time object
var t = new Date();
// loops through each row
for (i = 0; i < rows.length; i++) {
cells = rows[i].getElementsByTagName('td');
//configures the clock
var hm = cells[0].innerText.split(":");
t.setHours(hm[0], hm[1], 0, 0);
var r = (t.getTime() - currentTime.getTime()) / 1000 / 60 / 60;
//logic executed
if (r <= 0.25 && cells[1].innerText == false)
rows[i].className = "ewTableRowConditionalRed";
else if (r > 0.25 & r <= 0.5 && cells[1].innerText == false)
rows[i].className = "ewTableRowConditionalYellow";
else if (r > 0.5 & r <= 2 && cells[1].innerText == false)
rows[i].className = "ewTableRowConditionalGreen";
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,267,973 | 2,267,974 |
Reduce array of DOM elements to the ones with the deepest level in JavaScript
|
<p>Let's assume i have HTML markup like this:</p>
<pre><code><body>
<div id="content">
<div id="sidebar">
</div>
<div id="main">
<p class="foo">text</p>
<p class="bar">more <span>text</span></p>
</div>
</div>
</body>
</code></pre>
<p>Let's further assume that i selected some of them in an array of DOM elements:</p>
<pre><code>var allElements = jQuery('div,p').get();
// result: [div#content, div#sidebar, div#main, p.foo, p.bar]
</code></pre>
<p>Now i want to efficiently remove all elements from the result set which have a child in the result. In other words, only the deepest level should remain. So, the desired result would be:</p>
<pre><code>var deepestElements = doSomethingWith(allElements);
// desired result: [div#sidebar, p.foo, p.bar]
</code></pre>
<p><strong>How can i do this?</strong></p>
<p>By the way: "Deepest elements" seems to be the wrong term for what i am trying to do. Is there any better name?</p>
|
javascript jquery
|
[3, 5]
|
4,156,048 | 4,156,049 |
jQuery - if Value = 1 fadeIn
|
<p>Is there any alternative to onKeyUp which says that if letter was typed do this because onKeyUp shift, enter, backspace etc counts. </p>
<p>Something like if value.div1 = 1 fade in div2 for example.</p>
<p>Thanks alot </p>
<p>EDIT:
Okay I wasn't clear. Sorry, what I meant is:</p>
<p>I have a textarea. If letter is typed [not KeyUP,Keypress etc.] in the textarea then fadeIn div1. </p>
<p>Sorry and thanks alot again</p>
|
javascript jquery
|
[3, 5]
|
4,688,820 | 4,688,821 |
Printing out a javascript variable (not showing up?)
|
<p>I want to make sure a javascript variable is getting the correct values passed into it when setting it to a ruby variable.</p>
<pre><code><script type="text/javascript" charset="utf-8">
var test = <%= @test || 'null' %>;
document.write(test);
</script>
</code></pre>
<p>However, there doesn't seem to be any output whatsoever. I've tried just <code>document.write("somethinganything")</code> and I still don't see any output. Is it supposed to appear on webpage or terminal? I couldn't find any in both. </p>
|
javascript jquery
|
[3, 5]
|
1,315,540 | 1,315,541 |
ASP Checkbox and JS
|
<p>I'm trying to check to see if the aspboxes are checked in js. Can I set an ID number to the listItems and check each one by one?</p>
<pre><code> <asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem Text="Asset Classes" value="Asset Classes"></asp:ListItem>
<asp:ListItem Text="Asset Types" Value="Asset Types"></asp:ListItem>
<asp:ListItem Text="Asset Manufactuerer" value="Asset Manufactuerer"></asp:ListItem>
<asp:ListItem Text="Asset Voltage Class" Value="Asset Voltage Class"></asp:ListItem>
</asp:CheckBoxList>
</code></pre>
<p>Thanks!</p>
|
javascript asp.net
|
[3, 9]
|
1,940,894 | 1,940,895 |
PHP with Javascript: Email confirmation script not working
|
<pre><code> echo "<script type=\"text/javascript\">
function finishForm() {
var answer = confirm('Are you sure these are the teams you want to enter with?');
if (answer) {
if(document.getElementByID(emailconfirm).value == ".$_SESSION[Email].") {
form.action=\"esubmit.php\";
form.submit();
} else {
alert('E-mail address do not match');
return false;
}
}
}
function restartForm() {
var answer = confirm('Are you sure you want to start over?');
if (answer) {
form.action=\"e1.php\";
form.submit();
}
}
</script>";
</code></pre>
<p>I have a regular button calling this function. emailconfirm is a text input.<br>
I want to confirm that they have chosen the right teams, then check if the email in the session and the email confirmation text match. If they do match Then i want to submit the form.<br>
If they dont match, I want to alert the user they dont match, and just return to page so user can check emails and then resubmit.<br>
This script is in my header.</p>
<p>EDIT: Haha sorry i submitted one before and it didnt go through, forgot to add my problem!!</p>
<p>When you click the button it comes up with the confirmation, clicking either yes or no doesnt do anything. The alert doesnt pop up if they dont match and if they do match it doesnt submit. Also it might be good to note I had it without the email confirmation if statement and it worked fine (going to the submit page)</p>
|
php javascript
|
[2, 3]
|
1,747,454 | 1,747,455 |
Error: "Specified argument was out of the range of valid values" when populating dynamic DropDownLists
|
<p>I added two DropDownList controls programatically. When the first DropDownList's index is changed the second DropDownList should get populated. The first DropDown gets populated on Page Load.</p>
<p>When I select an item from the first DropDown, a DataTable is filled with values that need to be populated in the second DropDown. On setting the breakpoint I found that DataTable is filling properly.</p>
<p>But when it reaches line:</p>
<pre><code>ddl.DataSource = dt;
</code></pre>
<p>it gives error:</p>
<pre><code>Specified argument was out of the range of valid values
</code></pre>
<p>I also found that ddl is picking the right DropDown.</p>
<p>The problem I find is that while postback some error is happening.</p>
<p>I tried even doing:</p>
<pre><code>dd.Items.Add("abcd");
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,401,122 | 3,401,123 |
Re executing a code after a certain period of time in android
|
<p>I am in a google map project and here is my code in oncreate:</p>
<pre><code>mapView = (MapView)findViewById(R.id.mapView);
mapView.setBuiltInZoomControls(true);
mapView.setSatellite(false);
mapView.setStreetView(true);
mapController = mapView.getController();
mapController.setZoom(19);
getLastLocation();
drawCurrPositionOverlay();
drawMalls();
animateToCurrentLocation();
</code></pre>
<p>but now i want to call this DrawMalls(); method after some seconds and unless the user closes this application this method will be being called after that time? Is there any way to do this?</p>
|
java android
|
[1, 4]
|
1,993,526 | 1,993,527 |
Equalize two ULs by height
|
<p>I have a case where I'm provided with one UL, and an unknown number of LIs. I'm looking to use JS to split the LIs into 2 ULs (I'm using jQuery). I'm able to split the ULs evenly by number of LIs, but I'd like to split it based on the height of each LI as well, so that both ULs are close to the same height.</p>
<p>Any help with this would be appreciated, I don't feel like I'm getting anywhere with the approach I started with.</p>
<p>Thanks.</p>
<p>EDIT: JS code I currently have. The HTML is just a straight UL/LI, each LI can be of varying height.</p>
<pre><code>var $sections = $('div.subsection');
$sections.each(function(){
var $section = $(this);
var $list = $section.children('ul');
var $items = $list.children('li');
var itemCount = $items.size();
var leftover = itemCount % 2;
var itemsPerColumn = Math.floor(itemCount / 2);
var $newList = $('<ul />');
$items.each(function(){
var $this = $(this);
var index = $items.index($this);
if (index >= (itemsPerColumn + leftover)) {
$this.remove().appendTo($newList);
}
});
$list.after($newList);
_equalizeListHeights();
function _equalizeListHeights(){
var listHeight = $list.height();
var newListHeight = $newList.height();
if (listHeight > newListHeight){
var $lastItem = $list.children('li:last');
var lastItemHeight = $lastItem.height();
if (listHeight - lastItemHeight > newListHeight + lastItemHeight){
$lastItem.remove().prependTo($newList);
_equalizeListHeights();
}
}
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,371,339 | 2,371,340 |
Accessing gridview in all pages in C#-ASP.NET
|
<p>I have a gridview. I need to display that gridview in four pages. I dont want to write the code for gridview in all four pages. Please tell a good approach to do this?</p>
|
c# asp.net
|
[0, 9]
|
4,929,065 | 4,929,066 |
Can jQuery or Javascript simulate a link being clicked?
|
<p>I have a slider on my site but unfortunately it doesn't have an auto mode.</p>
<p>Is it possible to write a function that simulates a link being clicked at certain time intervals so that the slide rotates?</p>
|
javascript jquery
|
[3, 5]
|
3,259,548 | 3,259,549 |
SQl server hierarchy
|
<p>I have a website application, In that website i created four text boxes(txtSchoolName,txtBranchName,txtClass,txtSection)....</p>
<p>I want to know about SQL server Hierarcy... and How to create hierarchy sqlserver?
how to insert values in that? and also how to connect that hierarchy to ASP.net website(C#)?</p>
<p>Anyone pls Tell me about it...</p>
<p>Thanks in Advance</p>
|
c# asp.net
|
[0, 9]
|
2,586,037 | 2,586,038 |
Get dynamic class each fieldset
|
<p>How can get(dynamic) each class <code>fieldset</code> that wrapping the elements in it?</p>
<p><strong>Like:</strong></p>
<p>if click on button <code>adult</code> =get class=> <code>.adult</code> from here in the html: <code><fieldset class="adult"></code><br>
if click on button <code>child wbed</code> =get class=> <code>.child wbed</code> from here in the html: <code><fieldset class="child wbed"></code><br>
if click on button <code>child bed</code> =get class=> <code>.child bed</code> from here in the html: <code><fieldset class="child bed"></code><br>
if click on button <code>baby</code> =get class=> <code>.baby</code> from here in the html: <code><fieldset class="baby"></code><br></p>
<p><strong>Example:</strong> <a href="http://jsfiddle.net/WErW9/7/" rel="nofollow">http://jsfiddle.net/WErW9/7/</a></p>
<pre><code>$('button').live("click", function (event) {
event.preventDefault();
$(this).remove();
var $this = $(this),
$div = $this.parent('fieldset');
var name = '.' + $(this).closest('fieldset').attr("class");
alert(name);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,286,798 | 4,286,799 |
Accessing nested JavaScript objects with string key
|
<p>I have a data structure like this :</p>
<pre><code>var someObject = {
'part1' : {
'name': 'Part 1',
'size': '20',
'qty' : '50'
},
'part2' : {
'name': 'Part 2',
'size': '15',
'qty' : '60'
},
'part3' : [
{
'name': 'Part 3A',
'size': '10',
'qty' : '20'
}, {
'name': 'Part 3B',
'size': '5',
'qty' : '20'
}, {
'name': 'Part 3C',
'size': '7.5',
'qty' : '20'
}
]
};
</code></pre>
<p>And I would like to access the data using these variable :</p>
<pre><code>var part1name = "part1.name";
var part2quantity = "part2.qty";
var part3name1 = "part3[0].name";
</code></pre>
<p>part1name should be filled with someObject.part1.name 's value, which is "Part 1". Same thing with part2quantity which filled with 60.</p>
<p>Is there anyway to achieve this with either pure javascript or JQuery?</p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
5,846,150 | 5,846,151 |
get ClientID for a specific user control bounded in a repeater
|
<p>iv'e got a list of user controls which i bind to a repeater .</p>
<p><strong>the user control : (Example) "AppProduct"</strong></p>
<pre><code> <div>
<asp:Button ID="btn_details" runat="server" Text="Trigger" />
<asp:HiddenField ID="pid" runat="server" value="5"/>
</div>
</code></pre>
<p><strong>the repeater :</strong></p>
<pre><code> <asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<App:Product ID="P1" runat="server" />
</ItemTemplate>
</asp:Repeater>
</code></pre>
<p><strong>the problem :</strong></p>
<p>when i press a certain "btn_details" on a certain user control i need to call a javascript or Jquery function
which does something according to the value of "pid" , but those are the Server Side id's
how can i get the ClientID for these controls for the user control i clicked on.</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,646,214 | 4,646,215 |
Jquery or javascript event on document header load
|
<p>Is there any Jquery or javascript event available on document header load and not on document load ?</p>
<p>I created two sites, </p>
<ol>
<li>desktop.example.com is for desktop and </li>
<li>m.example.com for mobile version.</li>
</ol>
<p>Actually I want to detect user-agent and depending on it redirect page to mobile or desktop version of site.</p>
|
javascript jquery
|
[3, 5]
|
1,157,025 | 1,157,026 |
Async task can't update GUI
|
<p>My basic question is how do you update the GUI with AsyncTask. I am setting a <code>String</code> in <code>onPostExecute</code> that the GUI thread references. Using logging, I can see the <code>String</code> getting set in the <code>onPostExecute</code> method, but it never gets set on my GUI under my <code>onClickListener</code> to update the GUI. Any help is appreciated.</p>
<p>Main Program:</p>
<blockquote>
<p>public class Main extends Activity {</p>
<pre><code>/** Called when the activity is first created. */
Arduino.ToAndroid.Temperature.GetJSON jsonHttpClass = new Arduino.ToAndroid.Temperature.GetJSON();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
new GetJSON().execute(url_to_Http);
}
View.OnClickListener temperatureListener = new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
// buttonTemperature = json.getTemp();
tempView.setText(jsonHttpClass.value);
Log.i("ROSS LOG", "Button Clicked");
}
}; }
</code></pre>
</blockquote>
<p>Async Task:</p>
<blockquote>
<p>class GetJSON extends AsyncTask {</p>
<pre><code>public String value;
@Override
protected String doInBackground(String... url) {
String result = this.getHttpJson(url[0]);
return result;
}
@Override
protected void onPostExecute(String result) {
value = new String(result);
Log.i("ROSS LOG", value);
}
</code></pre>
<p>}</p>
</blockquote>
|
java android
|
[1, 4]
|
5,219,809 | 5,219,810 |
Javascript date choose with next and prevous button
|
<p>I've a UI as shown below, where when use clicks on next button the text box changes to next date and when clicked on previous, should display previous date.</p>
<p>The complexity is that when user clicks on Weekview button it should show week i.e 6 days from selected date e.g. Tuesday 06 - Monday 12</p>
<p><img src="http://i.stack.imgur.com/KzGlv.png" alt="enter image description here"></p>
<p>Could some one please help me with above, if there are any plugins available to achieve this.</p>
|
javascript jquery
|
[3, 5]
|
936,736 | 936,737 |
What is the difference between $.map and $.grep in jquery
|
<p>What is the difference between $.map and $.grep in jquery?</p>
<p>I want a simple answer as far as possible.</p>
<p>Thanks :)</p>
|
javascript jquery
|
[3, 5]
|
1,768,017 | 1,768,018 |
need help converting c++ definitions to c# equivalent
|
<p>I'm using an API (written in c++) to connect to a DVR machine, actually I only have the .dll and the .lib files, and I want to do the job in .NET (C#).
So, the API doc contains definitions to all functions inside the dll, and I'm having a hard time trying to figure out how to translate those functions to equivalente C# definitions. Some of them are straightforward, but some I cannot make it work.</p>
<p>For example, there is this function: </p>
<pre><code>bool searchEvent(int channel, const LONG* condition, bool next)
</code></pre>
<p>In my c# class I put the following: </p>
<pre><code>[DllImport("search.dll")]
protected static extern bool searchEvent(int channel,
[MarshalAs(UnmanagedType.I8)]long condition, bool next);
</code></pre>
<p>but when I call the searchEvent function, it raises an error (memory error), I guess because of that long var. So my question is how can I translate "const LONG* condition" to c#?
Also, that searchEvent function triggers a callback that returns a struct. I am unable to translate some vars of that struct, like: </p>
<pre><code>char _version[2]
time_t _time
BYTE* _minute
unsigned short int _dwell[MAX]
</code></pre>
<p>Can someone help me with this, please? I´m no expert in c++, so any tips are greatly appreciated. Thanks!</p>
|
c# c++
|
[0, 6]
|
4,563,161 | 4,563,162 |
Android import project errors
|
<p>Hey everyone, I'm a beginner, so I'll try my best to explain this problem succinctly.</p>
<p>Basically, a friend of mine and I were playing around with the Android SDK, editing a simple RSS reader. We could launch it in the emulator and even install it on our real devices. </p>
<p>Fast forward a few days, I'm trying to import the exact same code that was working a few days earlier into Eclipse on my laptop. </p>
<p>I tried both importing and new project from existing source. Both return these new errors that we never had originally.</p>
<p>I got an error that involved the auto generated "R" file, but I have solved this. Now, I'm getting 3 errors that I have never had before -</p>
<ol>
<li><p>The method onClick(View) of type new View.OnClickListener(){} must override a superclass method - displayed twice ( 2 different lines)</p></li>
<li><p>The method onTabChanged(String) of type new TabHost.OnTabChangeListener(){} must override a superclass method</p></li>
</ol>
<p>My question is this - What would cause the these discrepancies between importing/running on my friends computer and mine? </p>
<p>Also, we are both using the latest version of Java/Eclipse</p>
<p>Thanks in advance for any insight. </p>
|
java android
|
[1, 4]
|
5,020,571 | 5,020,572 |
jQuery on enter key submit form
|
<p>I built a simple form that submits whenever you press ENTER. It works fine, but whenever I tried running a <code>.post</code> inside of it, the text in the textarea breaks when I press enter instead of submitting. </p>
<p><strong>What I mean by breaking</strong></p>
<hr>
<p>The text in the textarea is <br />
| breaking<br /></p>
<hr>
<p><strong>This works fine</strong></p>
<pre><code>// Submit comment on ENTER key pressed
$("textarea[name=comment_body]").keypress(function(event) {
if (event.which == 13) {
alert(comment_body);
}
});
</code></pre>
<p><strong>This doesn't</strong></p>
<pre><code>// Submit comment on ENTER key pressed
$("textarea[name=comment_body]").keypress(function(event) {
if (event.which == 13) {
var comment_body = $(this).val();
$.post("comments.php", {
comment_body: comment_body
}
alert(comment_body);
}
});
</code></pre>
<p>How can I use jQuery .post inside of this without it failing?</p>
|
javascript jquery
|
[3, 5]
|
4,886,588 | 4,886,589 |
android web scraping behind a secure login
|
<p>I've been racking my brain about this for a while, I've managed to send a post request to a https based login form using the android sdk, specifically the org.apache.http library. All seems well in that the response i get back from the server is 200 OK. </p>
<p>However, I can't figure out how to then scrape the page behind the login. The apache library seems geared towards server requests/repsonses so the question is how can i get the actual html page back using the android sdk?</p>
<p>Example code would be much appreciated.</p>
|
java android
|
[1, 4]
|
3,167,142 | 3,167,143 |
Page URL delima - Controlling browser refresh
|
<p>I have a page that currently goes to the url <code>/edit/baseProductId</code> and it has a save functionality which creates a new product with the changes you've made. The trick here is that it's an ajax save, so the URL doesn't change. The problem is if the user refreshes the page it resets their form cause the URL wasn't updated. Is it possible for me to change <code>baseProductId</code> in the URL in some way without effecting the user experience?</p>
<p>If I don't change the <code>baseProductId</code> or come up with some solution when the user refreshes the page it'll reset their form - or so they'll think.</p>
|
javascript jquery
|
[3, 5]
|
1,390,159 | 1,390,160 |
Upload files to WiFi IP
|
<p>I have two devices that connect to each other with bluetooth.</p>
<p>Now I have made a socket connection between the two and I want to send a file/upload to the ip address but not to the device.
Not just a file but an Index.html file, so you can actually view the file from your desktop's browser.
In a <a href="http://code.google.com/p/camdroiduni/source/browse/trunk/code/eclipse_workspace/camdroid/src/de/aes/camdroid/WebServer.java" rel="nofollow">source</a>, i saw that this is possible on the WiFi IP adress with the port. But I can't find how they exactly do it.
So if you go to e.g. <a href="http://192.168.1.xxx:10130" rel="nofollow">http://192.168.1.xxx:10130</a> in your browser you could actually see the index.html file as a normal webpage. Is this possible, and how would you achieve this, toghether with sending images.</p>
<p>This is something I really need.</p>
|
java android
|
[1, 4]
|
5,010,004 | 5,010,005 |
android listitem from server and stores data to database
|
<p>i'm trying to do mail program. i've done this using jsonArray, Http protocals and some other functions. But, now i want to implement the program likely unread mails and starred mails. If i'm pressing anyof new mail it'll assign likely 1 to database. Otherwise, keep it 0. And, also if i want to set any mails in important (starred) this will keep 1 to database. Otherwise, keep 0. Now, i want to create a database related to these concepts? Anyone know about this concept Please help me to do this? Thanks in advance.</p>
|
java android
|
[1, 4]
|
1,239,557 | 1,239,558 |
Iterate through a root directory and get all files in it?
|
<p>hi
i am creating a application and i want to know the each and every file which is present under that one folder .i.e. how can i iterate through a root directory and get the each files visit at list once.</p>
|
c# asp.net
|
[0, 9]
|
4,332,467 | 4,332,468 |
Assigning an element an id when document is loaded so it can perform a different function when clicked?
|
<p>I'm trying to manipulate an <code>id</code> to use the same button to do more then 2 actions.</p>
<p>its something like:</p>
<pre><code>var id;
if(something == 2){
id = "id";
}else{
id = "id2";
}
$(".myClass").attr("id", id);
</code></pre>
<p>but, its not good, because if i try to use the <code>id</code> that i set, won't work, maybe because the document was already loaded with no <code>id</code> in the button.</p>
<p>dont think this need a example, <a href="http://jsfiddle.net/SWZMd/15/" rel="nofollow">but i made it</a>.</p>
<p>have another way to do this ?</p>
|
javascript jquery
|
[3, 5]
|
2,576,869 | 2,576,870 |
inline to handle url redirect
|
<p>I am migrating a site from siteA.domain.com to siteB.domain.com. All the page paths remain the same. The problem is it's a gradual migration, and not every path is being migrated at the same time. So what I need to do is check the path the user is going to, and if it's a member of a list of migrated sites, then redirect the user from siteA.domain.com/path to siteB.domain.com/path</p>
<p>I was hoping to add in-line c# code to the master page. Any thoughts/examples of this? </p>
|
c# asp.net
|
[0, 9]
|
238,200 | 238,201 |
jQuery .before() re-executing javascript
|
<p>I have a piece of code that is using .before() and the code it is moving has inline javascript which .before() re-executes. Is there a way to prevent .before() form re-executing javascript code?</p>
|
javascript jquery
|
[3, 5]
|
5,935,489 | 5,935,490 |
Javascript passing variable to Jquery
|
<pre><code><script type="text/javascript">
function DoThings()
{
var txt = txtbox.value;
txt = /* passed info from code behind */
}
$(function() { var Tags=[ txt ]; $( "txtbox2").autocomplete({source: Tags});});
</script>
</code></pre>
<p>but i want to move it to the page. im unsure how i send the variable "txt" to my jquery function</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
1,862,141 | 1,862,142 |
Passing Session[] and Request[] to Methods in C#
|
<p>In C#, How do you pass the Session[] and Request[] objects to a method?</p>
<p>I would like to use a method to parse out Session and Request paramaters for a .aspx page to reduce the size of my Page_Load method. I am passing quite a few variables, and need to support both POSTand GET methods. For most calls, not all variables are present, so I have to test every variable multiple ways, and the code gets long...</p>
<p>This is what I am trying to do, but I can't seem to properly identify the Session and Request paramaters (this code will not compile, because the arrays are indexed by number)</p>
<pre><code>static string getParam(
System.Web.SessionState.HttpSessionState[] Session,
System.Web.HttpRequest[] Request,
string id)
{
string rslt = "";
try
{
rslt = Session[id].ToString();
}
catch
{
try
{
rslt = Request[id].ToString();
}
catch { }
}
return rslt;
}
</code></pre>
<p>From Page_Load, I want to call this method as follows to retrieve the "MODE" paramater:</p>
<pre><code>string rslt;
rslt = getParam(Session, Request, "MODE");
</code></pre>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
4,465,984 | 4,465,985 |
Find requested page from masterpage load?
|
<p>Say I am in the masterpage load event. If the user is logged in, I need to redirect them away from Login.aspx, if not logged in, I need to redirect them to Login.aspx. But first, I need to know which page they were trying to access.</p>
<p>How can I get this information?</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
5,442,330 | 5,442,331 |
Custom view in ListView disappears while scrolling in Android
|
<p>I wrote a simple custom view for rows in ListView. It works fine, but when I try to scroll the list, I see only white rows without content. And when scrolling is over, rows continue to show again. </p>
<p>This is how I draw a custom view: </p>
<pre><code> @Override
protected void onDraw(Canvas canvas) {
if(poster != null) {
canvas.drawBitmap(poster, padding, padding, paint);
}
canvas.drawText(title, 55 + padding, 16 + padding, paint);
}
</code></pre>
<p>Maybe I missed something? </p>
<p>P.S. This is short screencast (400kb) <a href="http://dl.dropbox.com/u/190203/test.mpeg" rel="nofollow">http://dl.dropbox.com/u/190203/test.mpeg</a></p>
|
java android
|
[1, 4]
|
1,022,187 | 1,022,188 |
Clear browser cache only on logout
|
<p>How can I clear browser cache only on logout, sure I can use the below:</p>
<pre><code>Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
Response.Cache.SetNoStore();
</code></pre>
<p>But this particular page which is a shopping bag page is accessible by both login and non-login users. How can I set it in such a way whereby the login user is able to access this page without clearing the browser cache but <strong>Only</strong> clears it when he/she logs out so that another user will not be able to access the history contents.</p>
<p>I have tried the solutions here:
<a href="http://www.codeproject.com/Tips/135121/Browser-back-button-issue-after-logout" rel="nofollow">http://www.codeproject.com/Tips/135121/Browser-back-button-issue-after-logout</a>
made some changes but still couldn't figure out how to deal with this issue. </p>
<p>I also cleared my session on logout as below but I understand the browser cache will still stay. </p>
<pre><code>FormsAuthentication.SignOut();
Session.Abandon();
Response.Redirect("~/");
</code></pre>
<p>Please advice. Thanks.</p>
|
c# asp.net
|
[0, 9]
|
4,111,667 | 4,111,668 |
Resume timer with jQuery
|
<p>I am using the plugin from <a href="http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/" rel="nofollow">http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/</a></p>
<p>I want to Resume the timer. I wrote this, as I also want to get the data from server. But <strong>onResume</strong> is not working (Means the timer is not resetting).</p>
<pre><code>$.get("test1.php?data="+message, function(result){
// $("div").html(result);
$('#idletimeout').html(result)._onResume();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
836,930 | 836,931 |
Having a TableRow with TextView's underneath each other
|
<p>I'm currently having the following problem:</p>
<p>I've got a TableView that is given TableRow's to be added to it with data. I want each TableRow to contain 2 TextView's having a width of the parent and are underneath each other, for example:</p>
<pre><code>| TextView1.............. |
| TextView2.............. |
| .........EndOfTextView2 |
</code></pre>
<p>In my example above, it's just showing that I also want the second TextView to be able to run over multiple lines.</p>
<p>Here is the XML for my TableLayout:</p>
<pre><code><TableLayout
android:id="@+id/feed"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="5px"
android:stretchColumns="1"
>
</TableLayout>
</code></pre>
<p>Used to iOS so I'm kind of new in this XML/Java style mobile programming department.</p>
<p><strong>EDIT:</strong></p>
<p>I ended up adding a LinearLayout to the TableRow, is this the best way to do it?</p>
|
java android
|
[1, 4]
|
3,239,060 | 3,239,061 |
getting the last event data
|
<p>I am using an external jquery plugin (iosSlider. but it doesn't metter). The plugin triggers an event when I click the mouse and move it. The plugin triggers the event and supply data to the listener. But, it doesn't provide the original event object. The original event object contains data which I don't have in the data the plugin supplied. Is there any way I can get the data of the last event happend?</p>
|
javascript jquery
|
[3, 5]
|
3,803,873 | 3,803,874 |
Error: uncaught exception: Syntax error, unrecognized expression: inputnum
|
<p>I've inherited another developer's code for a project I'm working on. Here's an example of their code - notice the first comment... </p>
<pre><code>function disableSuggestButton(themePath) {
// could not see a better way of doing this :(
var row = $("input[type='text']:inputnum:inputnumsmall");
$(row).each(function () {
if ($(this).attr("disabled") == true) {
var btn = $(this).closest("tr").find(".btnSuggest")
$(btn).hover(function () {
$(this).css({ backgroundImage: 'url(' + themePath + '/images/buttons/btnSuggest.png)' }).css('cursor', 'default');
}, function () {
$(this).css({ backgroundImage: 'url(' + themePath + '/images/buttons/btnSuggest.png)' }).css('cursor', 'default');
});
$(btn).removeAttr("title").removeAttr("href");
}
});
}
</code></pre>
<p>I needed to upgrade the version of jQuery (from 1.3.2 to 1.4) however when doing this the following line: </p>
<pre><code>var row = $("input[type='text']:inputnum:inputnumsmall");
</code></pre>
<p>produces the following error: </p>
<blockquote>
<p>Error: uncaught exception: Syntax error, unrecognized expression:
inputnum</p>
</blockquote>
<p>How can I improve on the previous devloper's selector? inputnum & inputnumsmall are CSS classes.</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
5,566,564 | 5,566,565 |
getting image from remote server issue
|
<p>Just two things, is this a good simple way to grab images? also when i do try it on the android AVD nothing gets displayed on screen as well as in log_cat, no errors or crashes. Here is my code: </p>
<pre><code>public class MainActivity extends Activity {
Bitmap bitmap = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try{
bitmap = getBitmap("https://twimg0-a.akamaihd.net/profile_images/2275552571/image_normal.jpg");
ImageView img = (ImageView) findViewById(R.id.img);
img.setImageBitmap(bitmap);
}catch(Exception e){
}
}
public Bitmap getBitmap(String bitmapUrl) {
try {
URL url = new URL(bitmapUrl);
return BitmapFactory.decodeStream(url.openConnection().getInputStream());
}catch(Exception ex) {return null;}
}
}
</code></pre>
|
java android
|
[1, 4]
|
5,053,190 | 5,053,191 |
How to set time for AlarmManager correctly?
|
<p>I have the following code:</p>
<pre><code> PendingIntent pi=PendingIntent.getBroadcast(getActivity(), id, i, 0);
manager.setRepeating(AlarmManager.RTC_WAKEUP, date.getTime(), 5000, pi);
</code></pre>
<p>This code works correctly, but there is one problem - for example, I set time as "15 october 2012", and it will show notification for me 15 october, but it also show me notification after executing this code at once! How can I disable it? </p>
|
java android
|
[1, 4]
|
2,761,383 | 2,761,384 |
how to get the prefect url from html encoded url
|
<p>Folderpath\0\Microsoft%202007\chapter1\images</p>
<p>how can i remove %20 from this url path.</p>
|
c# asp.net
|
[0, 9]
|
4,976,821 | 4,976,822 |
hover more than one element
|
<p>Is it possible to use more than one element in jQuery hover?
This code is only for <code>a</code> elements but how may you use it for <code>div</code>,<code>texterea</code>,<code>a</code> and <code>li</code> elements together?</p>
<p>Example:</p>
<pre><code>$("a").hover(function () {
var id = $(this).attr("class");
$("#helparea").text(id);
},
function () {
$("#helparea").empty();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
982,103 | 982,104 |
How to set center of GoogleMap?
|
<p>I have following task: I have been making Android application, and I need to set drawable marker into center of Map that if I move map or zoom map this marker will continue point to center of Map, won't move with Map. How can I do it? </p>
|
java android
|
[1, 4]
|
4,553,387 | 4,553,388 |
Java code optimalization - Two functions into one
|
<p>Hello I have this code:</p>
<pre><code>this.firstBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
final CharSequence[] items = {"1", "2", "3"};
AlertDialog.Builder builder = new AlertDialog.Builder(SlovnikoidActivity.this);
builder.setTitle("test");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
langFrom.setText(items[item]);
}
});
AlertDialog alert = builder.create();
alert.show();
}
});
this.secondBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
final CharSequence[] items = {"1", "2", "3"};
AlertDialog.Builder builder = new AlertDialog.Builder(SlovnikoidActivity.this);
builder.setTitle("test");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
langFrom.setText(items[item]);
}
});
AlertDialog alert = builder.create();
alert.show();
}
});
</code></pre>
<p>There are just two different parts: <code>this.firstBtn</code> and <code>this.secondBtn</code>
Is there a way how to merge it? For example when I click on <code>firstBtn</code> it calls a function <code>foo(firstBtn)</code> and <code>secondBtn</code> calls <code>foo(secondBtn)</code> and the rest would work the same?
I'm not sure about syntax etc. because I'm new to Java and Android development today.</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
1,500,768 | 1,500,769 |
Should i learn PHP (this is not vague..)
|
<p>I have been into Python i know a bit.
But what i really want is a good balance with web development and actual programs.
For that i'll have to learn more than one language for sure.
When i look at some companies (Google ) i see that Python has the power i thought it would have in web.
But i would have to write the server myself.
PHP has everything... just need to learn how to use it.
I heard a lot of trolling on PHP that made me ask this.
Besides i can easly get free PHP-mysql hosting.
I also heard that PHP gives bad habits.
But theres wordpress and facebook..
Python i would have to host on my Computer.(idk how to do such thing)</p>
<p>Should i learn PHP, or can someone guide-me(into a website or something) for Python.</p>
|
php python
|
[2, 7]
|
4,340,800 | 4,340,801 |
Php variable to JavaScript
|
<p>How to add the value of php variabele to jquery variable and adds them,i have a form that will take a value and post to second page where second page contains a div panel where the form checkboxes values are adding and subtracting,basically i want to add the submitted value from page1 to page2.Here is the code.I have 3 form values which will be redirected one by one.Whenever user submits the respective button</p>
<pre><code>if($_POST['submit'])
{
$beg=$_POST['basic'];
}
function refreshPrices() {
var currentTotalValue = 0;
var beg=?????
$("#results div").each(function() {
if (!isNaN(parseInt($(this).find("span").text().substring(1)))) {
currentTotalValue += parseInt($(this).find("span").text().substring(1));
}
});
$("#totalValue").text("$" + currentTotalValue)
}
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
277,497 | 277,498 |
Solid background for android dialog
|
<p>In android 1.6, the background color is solid but in 2.3 or later, the dialog is transparent, more like opacity 80%. So I created new style</p>
<pre><code><style name="SolidDialog" parent="android:Theme.Dialog">
</style>
</code></pre>
<p>but what should I put inside ??</p>
|
java android
|
[1, 4]
|
3,114,968 | 3,114,969 |
Android How to set String array into a single textview
|
<p>I'd like to try to set string array as text of the textview. How can I do that?</p>
<p>Below is what I've tried so far:</p>
<pre><code>String[] word = { "Pretty", "Cool", "Weird" };
tv.setText( word.length );
</code></pre>
<p>But it's throwing some errors. I'm new to Android/Java</p>
|
java android
|
[1, 4]
|
2,995,080 | 2,995,081 |
Is it possible to Post Data from a Java application to a .php page?
|
<p>im trying to make a quick java app that posts data to a website just basic $_POST variables.
Is it possible?</p>
<p>Thanks.</p>
|
java php
|
[1, 2]
|
505,853 | 505,854 |
Access URL in javascript/jquery?
|
<p>I want to create a variable for the url location, and change text depending on the input. For example, for bill.google.com, the value of the variable would be bill. For example.google.com, the value of the variable would be example. I don't know how to access the text in the url. Help?</p>
|
javascript jquery
|
[3, 5]
|
5,921,444 | 5,921,445 |
JS not acting on .load()-ed html
|
<p>I have a puzzling conundrum:</p>
<p>I have this JS:
<em>EDIT updated JS</em></p>
<pre><code> $(".img-thumb").on("click", function(){ // exhibiting the same behaviour as .click()
thumbID = $(this).attr("id");
console.log(thumbID);
$(".gal-act").removeClass("gal-act");
$(this).addClass("gal-act"); // as suggested below
});
</code></pre>
<p>Which is meant to act on a piece of html inserted into a page using the .load() jquery function. The puzzle is that it works on the html when it's displayed as its original file (as here: <a href="http://keithneilson.co.uk/experimental/products/Data/prod-data.html" rel="nofollow">http://keithneilson.co.uk/experimental/products/Data/prod-data.html</a>, and yes I know there are images missing, no-one is meant to see this page on its own though). As you can see from that link the code is just meant to change the left border of the thumbnail to indicate which is selected for the moment, I'm going to add in the other functionality once I've got this puzzle solved.</p>
<p>Here is the same html inserted as a popup in the final page (click the red box beneath the slideshow): <a href="http://keithneilson.co.uk/experimental/products/" rel="nofollow">http://keithneilson.co.uk/experimental/products/</a>. As you can see the images now work, but if you click the thumbnails again you'll see that the script is not acting (There's no log output either).</p>
<p>Now, it's the same html, and the same javascript, but it isn't working. My question is why, and is there a known workaround?</p>
|
javascript jquery
|
[3, 5]
|
1,501,917 | 1,501,918 |
Need whole body tag mouseover function
|
<p>I need to whole body mouseover function. When I enter some other page, some of my content will append the particular div. </p>
<p>My code is:</p>
<pre><code>$('body').mouseover(function() {
$('#text').append('<div>New content</div>');
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
385,105 | 385,106 |
Send commands between two computers over the internet
|
<p>I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. I thought it would be best if I do this with a web interface as it would not be necessary to install software on that computer. For obvious reasons it would require log in details.</p>
<p>So basically the problem is sending encrypted commands from a web interface to my computer at home. What would be the best method to achieve this and what programming languages should I use? I know Java, Python and C quite well, but have very little experience with web applications, such as Javascript and PHP.</p>
<p>I have looked at web chat examples as it is sort of similar concept to what I wish to achieve, except the text can be replaced with commands. Is this a viable solution or are there better alternatives?</p>
<p>Thank you</p>
|
php java python javascript
|
[2, 1, 7, 3]
|
3,408,475 | 3,408,476 |
get the file size on file browsing
|
<p>i have an asp fileupload control, i want to know,,is it possible to get the filesize the moment i browse a file</p>
|
c# asp.net
|
[0, 9]
|
3,140,496 | 3,140,497 |
Check Space in String
|
<p>I want to check that if my username contains space so then it alert so i do this it work but one problem i am facing is that if i give space in start then it does not alert.I search it but can't find solution, my code is this</p>
<pre><code>var username = $.trim($('#r_uname').val());
var space = " ";
var check = function(string){
for(i = 0; i < space.length;i++){
if(string.indexOf(space[i]) > -1){
return true
}
}
return false;
}
if(check(username) == true)
{
alert('Username contains illegal characters or Space!');
return false;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,897,855 | 5,897,856 |
jQuery Confirm box to leave or remain on a page
|
<p>I have an MVC2 C#.Net web app. When a user attempts to leave a view, I want to pop up a confirm box to alert them that they have made changes but not yet saved. </p>
<p>In a previous .Net 3.5 app, I used <code>window.onbeforeunload</code>. That doesn't seem to work in MVC3. What would be an appropriate place or event to call to do this type of activity? </p>
|
javascript jquery
|
[3, 5]
|
5,382,778 | 5,382,779 |
Formatting Double with two dp
|
<p>From my decimalForm method below, i want to convert double value 7777.54 to 7 777,54 but i am getting 7 777 54. what have missed ? result should be 7 777,54</p>
<pre><code>public static String decimalForm(double value){
DecimalFormat df = new DecimalFormat("#,###,###.00");
String formatted_value = df.format(value).replaceAll(",", " ").replace(".", ",");
return formatted_value;
}
</code></pre>
|
java android
|
[1, 4]
|
594,153 | 594,154 |
How can I make functions available to other javascript files?
|
<p>I have the following code:</p>
<p>$(document).ready(function () {</p>
<pre><code>function loginLinkClick(e) {
e.preventDefault();
$('#loginLink').unbind('click', loginLinkClick);
dialog(this);
}
function registerLinkClick(e) {
e.preventDefault();
$('#registerLink').unbind('click', registerLinkClick);
dialog(this);
}
$('#loginLink')
.bind('click', loginLinkClick);
$('#registerLink')
.bind('click', registerLinkClick);
$('#logoutLink')
.click(function (e) {
window.location = $(this).attr('data-href')
});
</code></pre>
<p>});</p>
<p>I want to have my loginLinkClick and registerLinkClick functions available to other javascript files. Is there a way that I can do this? I'm using jQuery so should I put them into the jQuery namespace or something like that?</p>
<p>One more question. From a performance point of view or for maintainability should I have functions like these outside of the $(document)</p>
|
javascript jquery
|
[3, 5]
|
5,370,845 | 5,370,846 |
generating string from exited characters
|
<p>I have a character array as shown below :</p>
<pre><code>char[] pwdCharArray = "abcdefghijklmnopqrstuvwxyzABCDEFG" +
"HIJKLMNOPQRSTUVWXYZ0123456789`~!@#$%^&*()-_=+[]{}\\|;:'\",<" +
".>/?".ToCharArray();
</code></pre>
<p>and from this char array, i want to generate a string of minimum length 7 and all the characters in the string should be from the above char array.
How to do this operation?</p>
|
c# java
|
[0, 1]
|
177,151 | 177,152 |
Javascript: Referring to control before page is loaded
|
<p>I have a composite control on an ASPX page. There is Javascript on the ASPX page that gets loaded before the control. Now, since the script refers to the control element which does not exist when the script is loaded, this is throwing a Javascript error of "Obect not defined". Attaching the script to the onload event of the control gives "Sys not defined".</p>
<p>Any Idea?</p>
<p>The script is in an external file.</p>
|
asp.net javascript
|
[9, 3]
|
3,195,222 | 3,195,223 |
How to apply table header sorting to divs by an individual list element?
|
<p>I'm creating a series of <code><div></code>s dynamically from an external query. Using Javascript a <code><div></code> is created and populated with separate list elements. The structure is something like:</p>
<pre><code><div class="container" id="1">
<li class="date"> </li>
<li class="name"> </li>
<div>
</code></pre>
<p>The search boxes run a jQuery livefilter on keyUp that hides <code><div></code>s that dont match the search.</p>
<p>I then want to be able to sort the visible divs by clicking on table headers that address individual <code><li></code> elements in the <code><div></code> (date, name, etc). I've tried using tablesorter and putting each <code><li></code> in a <code><td></code> but the table head ends up below the body and does not function.</p>
<p><strong>How can I apply sorting only to the currently visible list element but sort the entire div?</strong></p>
<p><img src="http://i.stack.imgur.com/Eszyf.jpg" alt="Diagram of table"></p>
<p><a href="http://jsfiddle.net/F4BPG/" rel="nofollow">JSFiddle of live filter with non operational header.</a></p>
|
javascript jquery
|
[3, 5]
|
541,709 | 541,710 |
How to convert Javascript code to Jquery code?
|
<p>Please help me, here is the code in Javascript, I need to change this code to Jquery.</p>
<pre><code>eval("parent.document.forms[0].strKey" +
intDimensionId).value = strIds[intDimensionId];
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,660,550 | 3,660,551 |
jQuery Odometer
|
<p>I would like to implement a jQuery odometer, similar to opower.com's website. So far, I was able to get a bit of the copied code to work, but there is such much extra code around their odometer script, my copied code is bloated and cumbersome, plus has incredible amount of styling that I do not like.</p>
<p>What I would like is a text based jQuery count-up odometer that can easily be packaged up in a nice clean folder. </p>
<ul>
<li>timer</li>
<li>css</li>
<li>html</li>
<li>images</li>
</ul>
<p>Can anyone help?</p>
|
php jquery
|
[2, 5]
|
5,063,329 | 5,063,330 |
Is there a good library of video tutorials for Android development?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4904560/where-can-i-find-android-video-tutorials">Where can I find Android video tutorials?</a> </p>
</blockquote>
<p>Specifically some that may cater to an experienced developer (C#) but not necessarily familiar with Java/Eclipse?</p>
<p>I have seen a couple vids on YouTube but they are either short (not much you can learn in 3mins or patronizing)</p>
|
java android
|
[1, 4]
|
3,732,371 | 3,732,372 |
Difference between Caching object and Hash map
|
<p>I was reading an article on Caching object in asp.net framework and I was looking on the class behavior. It has a HashMap like structure and looks like that I can actually instantiate a Hashmap and use it as collection.</p>
<p>What extra benefit does cache object bring over hashmap?</p>
|
c# asp.net
|
[0, 9]
|
2,123,621 | 2,123,622 |
ASP.NET - Page.Form.Action error
|
<p>On my local development server, I am running version 2.0.50727.4955 on the live server I am running 2.0.50727.42.</p>
<p>On my live server I get:</p>
<p>Compiler Error Message: CS0117: 'System.Web.UI.HtmlControls.HtmlForm' does not contain a definition for 'Action'</p>
<p>On my development server everything works fine. Is this a .NET version issue or something else? Is there a way to make this work on my liver server with its current .Net version? Is there a way to upgrade from 2.0.50727.42 to 2.0.50727.4955?</p>
<p>Thanks</p>
<p>EDIT (Code):</p>
<pre><code> if (Request.PathInfo.Length != 0)
{
string reqPath = Request.PathInfo;
string raw = Request.RawUrl;
string url = Request.Url.ToString();
if (reqPath.Length > 0)
url = url.Replace(reqPath, "");
if (raw.Length > 0)
url = url.Replace(raw, "");
litBasePath.Text = "<base href=\"" + url + "\">";
Page.Form.Attributes["Action"] = raw;
}
</code></pre>
<p>EDIT (Local Setup)</p>
<p>This is my local setup. I am not getting any compile errors when i run this locally.</p>
<p><img src="http://i.stack.imgur.com/oexCK.png" alt="alt text"></p>
<p><img src="http://i.stack.imgur.com/u9hSi.png" alt="alt text"></p>
<p><img src="http://i.stack.imgur.com/HLhrq.png" alt="alt text"></p>
|
c# asp.net
|
[0, 9]
|
2,872,738 | 2,872,739 |
Merging two "(document).ready(function()"s
|
<p>I have two jquery/javascript codes but I couldn't merge them. Everytime one of the functions was disable. How can I merge the codes. Please help me, thanks.</p>
<p>First file:</p>
<pre><code>jQuery.noConflict();
jQuery(function(){
jQuery('ul.menu-primary').superfish({
animation: {opacity:'show'},
autoArrows: true,
dropShadows: false,
speed: 200,
delay: 800
});
});
jQuery(function(){
jQuery('ul.menu-secondary').superfish({
animation: {opacity:'show'},
autoArrows: true,
dropShadows: false,
speed: 200,
delay: 800
});
});
//first ready function
jQuery(document).ready(function() {
jQuery('.fp-slides').cycle({
fx: 'scrollHorz',
timeout: 4000,
delay: 0,
speed: 400,
next: '.fp-next',
prev: '.fp-prev',
pager: '.fp-pager',
continuous: 0,
sync: 1,
pause: 1,
pauseOnPagerHover: 1,
cleartype: true,
cleartypeNoBg: true
});
});
</code></pre>
<p>second file:</p>
<pre><code>function checkCopyRight(/*string*/url){
var copyrightLinks = $("a[href='" + url + "']");
return copyrightLinks.length > 0;
}
// second ready function
$().ready(function(){
if(!(checkCopyRight("http://e1.com")&&
checkCopyRight("http://e2.com")&&
checkCopyRight("http://e3.com"))){
alert("...");
}
});
</code></pre>
<p>I get a "Your post does not have much context to explain the code sections; please explain your scenario more clearly." message. There any character limit? </p>
|
javascript jquery
|
[3, 5]
|
5,882,735 | 5,882,736 |
Check if javascript is disabled?
|
<p>If I have a website that makes use of javascript and the user will get the most full experience of the website if they have javascript enabled, but it would still be fully functional even if javascript was disabled. Is there a way to check if the user has javascript disabled for the browser they are using, so I can display a message of something like: "The website is best viewed with javascript enabled"</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,651,549 | 4,651,550 |
Moving from C# to C++
|
<p>I'm a slightly-below average programmer in C#, and I only write apps with GUIs. I might be getting a Mac soon. Since there isn't the .NET Framework or Visual Studio on Mac, I'm going to be using Xcode and Cocoa. I think this will be a good opportunity to switch to a well known and well supported language (C++). I learned C# very easily without knowing C, so I'm hoping that C++ will be the same. I also want to learn Java. What do you suggest I do? Can I write apps with GUIs in C++ and Java? (can i do this with the tools included with xcode?). Do you reccomend any books/sites that will help? </p>
<p>Thanks,
David</p>
|
java c++
|
[1, 6]
|
5,402,507 | 5,402,508 |
Iterating over an array of objects with multiple properties using $.each
|
<p>I have an array of objects called "Contractors" in which each contractor will be displayed in a box on the screen so they have the properties "id", "posx" and "posy". I want to be able to change the coordinates onclick from what they are currently to a line on the bottom of the screen where they will be displayed sequentially. The code for changing the coordinates works properly but animating the boxes to those coordinates does not. </p>
<pre><code>function moveto(){
$.each(Contractors, function(index, value){
$(index).animate({top: this.posy},"slow");
$(index).animate({left: this.posx},"slow");
});
}</code></pre>
<p>I'm not sure where the problem is but I'm getting a problem with "Cannot read property 'Default View' of undefined". Can anyone help? </p>
|
javascript jquery
|
[3, 5]
|
649,082 | 649,083 |
7-zip compression in asp.net web site
|
<p>I am trying to use 7-zip compression to create a zip of a sample file as given in the example
<a href="http://www.dotnetperls.com/7-zip" rel="nofollow">http://www.dotnetperls.com/7-zip</a>
As the URL says, "you must specify "Copy if newer" or "Copy always" to copy files such as executables to the output directory."</p>
<p>I found that when I use this code in a VS Project, I do get the option to specify "Copy if newer" when I see properties of 7za.exe in the properties window</p>
<p>But when I use in a VS Web site, I am unable to find this option. As a result, when I debug this program, it saying that its unable to find 7za.exe</p>
<pre><code>string sourceName = "pdfSample.pdf";
string targetName = "pdfSample.gz";
ProcessStartInfo p = new ProcessStartInfo();
p.FileName = "7za.exe";
p.Arguments = "a -tgzip \"" + targetName + "\" \"" + sourceName + "\" -mx=9";
p.WindowStyle = ProcessWindowStyle.Hidden;
try
{
Process x = Process.Start(p);
x.WaitForExit();
}
catch (Exception ex)
{
Console.Write(ex.ToString());
}
</code></pre>
<p>Any idea why there is no "Copy if newer" option in case of VS Web site?</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
2,718,868 | 2,718,869 |
How can I convert php string value to android string value?
|
<pre><code>public static String ConnDB() throws ParseException, IOException {
// TODO Auto-generated method stub
String webAddress = "http://10.0.0.1:8080/jspbook/AppStore/NewFile.php";
HttpGet httpGet = new HttpGet(webAddress);
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(httpGet);
String responseBody = EntityUtils.toString(response.getEntity());
Log.d("res", responseBody);
return responseBody;
}
</code></pre>
<p>Above is part of android code. I checked this code getting resopnse from php server without problem. <br>
However, emulator not only received values from php, but also received all the php code which I dont <br>
need. <br></p>
<p>
<br>
$time = "test time";<br>
$grade = "test grade";<br>
$title = "test title";<br>
$content = "test content";<br>
<br>
echo ( "$time " );<br>
echo ( "$grade " );<br>
echo ( "$title " );<br>
echo ( "$content " );<br>
echo("abc");<br>
?> <br></p>
<p>I only need value of $time , $grade , $title, $content but my emulator gets all the php code. <br></p>
<p>so.. my question is.. How can I convert php String $time to android java String time? </p>
|
php android
|
[2, 4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.