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 |
|---|---|---|---|---|---|
2,494,856
| 2,494,857
|
div doesn't position horizontally
|
<p>Im not getting my form element to position horizontaly in the center here is my code</p>
<pre><code>$('.form')
.css('top', window.screen.availHeight / 2 - $('.form').height() / 2)
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,875,232
| 2,875,233
|
How to change text on spinner selection
|
<p>I have a couple of textviews with a couple of spinners lined up in a table. There are 4 choices in the spinners, all of them the same, the first choice being '--'. I want the textview next to the spinner to be red when the default option '--' is selected, and white otherwise. </p>
<p>I coded this to handle this but when you select one spinner's different option, all of the textviews change It's behavior is just really strange.</p>
<pre><code> public void onItemSelected(AdapterView<?> parent,
View view, int pos, long id) {
switch(parent.getId()) {
case R.id.spinner1:
if(parent.getItemAtPosition(pos).toString().equals("--")){textView1.setTextColor(Color.RED);}else{textView1.setTextColor(Color.WHITE);}
case R.id.spinner2:
if(parent.getItemAtPosition(pos).toString().equals("--")){textView2.setTextColor(Color.RED);}else{textView2.setTextColor(Color.WHITE);}
case R.id.spinner3:
if(parent.getItemAtPosition(pos).toString().equals("--")){textView3.setTextColor(Color.RED);}else{textView3.setTextColor(Color.WHITE);}
}
}
</code></pre>
|
java android
|
[1, 4]
|
71,201
| 71,202
|
Converting string to javascript object
|
<p>I want my user to input some text in an input field and click a button "Evaluate" on clicking that button I will convert that inputted text into a JavaScript object if I could and will show all of it's members(properties and functions).</p>
<p>For example if user inputs <code>"document"</code> or <code>"window"</code> I will show all members of <code>document</code> and <code>window</code> respectively.</p>
<p>Iterating through the members of an object is done, but when user inputs some text in input text field and I get that text than that value is treated as String of course how can I convert that text into an object like <code>"document"</code> to <code>document</code> and <code>"window"</code> to <code>window</code> ???</p>
|
javascript jquery
|
[3, 5]
|
3,960,604
| 3,960,605
|
calendar android
|
<p>how can i catch calendar events in android? (when i have a calendar event right now i will do something?</p>
<p>thanks</p>
|
java android
|
[1, 4]
|
5,858,632
| 5,858,633
|
JQuery - image refresh
|
<p>Can anyone tell me why the first block of code works, but not the other two?</p>
<pre><code>setInterval(function() {
var url = "http://192.168.2.5:8080/?action=snapshot" + Math.random();
$("#webcam2").attr("src", url);
}, 1500);
</code></pre>
<p>Not working:</p>
<pre><code>setInterval(function() {
var url = String(Math.random());
$("#webcam2").attr("src", "192.168.2.5:8080/?action=snapshot" + url);
}, 1500);
</code></pre>
<p>nor:</p>
<pre><code>setInterval(function() {
$("#webcam2").attr("src", "192.168.2.5:8080/?action=snapshot" + Math.random());
}, 1500);
</code></pre>
|
javascript jquery
|
[3, 5]
|
324,641
| 324,642
|
How to remember changes of html attributes which are changed by jquery
|
<p>I am using jquery function which changes the class of element</p>
<pre><code> $("a").click(function(){
$(this).closest("ul").find("a").parent().removeClass("active");
$(this).parent().addClass("active");
});
</code></pre>
<p>but when i refresh page, there are no changes added. How to remember them, even when user refreshes page? Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
1,596,329
| 1,596,330
|
Query breaks after updating Android app
|
<p>I have this query running. If I update my app from an old version to a new. This query seems to break. I can 100% guarantee that the database is the same. Does anyone have any suggestions for what I should check?</p>
<pre><code>Cursor value = checkDB.rawQuery("SELECT * FROM table WHERE open='1' AND country=?", new String[]{countryID});
</code></pre>
<p>This is where that query is nested.</p>
<pre><code>protected Cursor getChildrenCursor(Cursor groupCursor) {
String countryID = Integer.toString(groupCursor.getInt(groupCursor.getColumnIndex("_id")));
SQLiteDatabase checkDB = null;
checkDB = SQLiteDatabase.openDatabase(DB_PATH, null, SQLiteDatabase.OPEN_READONLY);
Cursor value = checkDB.rawQuery("SELECT * FROM table WHERE open='1' AND country=?", new String[]{countryID});
checkDB.close();
return value;
}
</code></pre>
<p>Edit: By break I mean that no results are returned.</p>
|
java android
|
[1, 4]
|
1,256,880
| 1,256,881
|
JQuery modal popup on specific region
|
<p>I have a grid and when i change its sorting order i a loading message appear on grid region and block its content like other modal popup but only on grid region
is there any available jquery modal popup meet my needs ? can I configure jqueryUI modal to do this ?</p>
|
javascript jquery
|
[3, 5]
|
1,692,479
| 1,692,480
|
Back Button Code not working
|
<p>I am using the following code for a "Back" Button:</p>
<pre><code><INPUT type="button" value="Button" onclick="window.history.back(); return true;">
</code></pre>
<p>But, on the Previous page I have two div elements. When the page loads it will show div1. The next time, when the button of div1 is clicked, div2 will show. On div2 I have a "Next" button. which redirects to the other page. I want code for a "Back" button, which will show div2 when Back is clicked. Also, If I use history.back() it will show div1. </p>
<p>HTML code</p>
<p>
<b>List all your liabilities as calculated on the day the debt was forgiven to
the debt was forgiven prior</b></p>
NEXT
<pre><code><div id="d2">
<table cellspacing="3">
<tr>
<td colspan="2" class="styleh">
<p>
<b>Part II. List the fair market value (FMV) of all your assets, calculated as of the
day prior to the debt being forgiven - this would be the "sell today, cash value."</b></p>
</td>
</tr>
<tr>
<td>
</td>
<td>
<button id="btncalc" onclick="return btncalc_onclick()">
Calculate</button>
<button id="Button2" runat="server">
BACK</button>
</td>
</tr>
</table>
</div>
</code></pre>
<p>Thank you in advance</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,554,184
| 2,554,185
|
How to pass an array of structures through Postback?
|
<p>I have the following structure:</p>
<pre><code>private struct S_indiv
{
public int[] x;
public int s;
public S_indiv(int[] p1, int p2)
{
x = p1;
s = p2;
}
}
</code></pre>
<p>and array:</p>
<pre><code>private static S_indiv[] ind;
</code></pre>
<p>How can I pass this array through Postback?</p>
|
c# asp.net
|
[0, 9]
|
3,987,178
| 3,987,179
|
jQuery: Can I get a reference to the bound events on an element?
|
<p>I have some elements with a function bound to the <code>click</code> event. I want to bind that same function instead to the <code>mouseover</code> and <code>mouseout</code> events. Is it possible to get a reference to the click event so that I can assign it to those other events? I'm imagining something like this (inside <code>each()</code>):</p>
<pre><code>$(this).bind('mouseover', $(this).click());
$(this).bind('mouseout', $(this).click());
$(this).unbind('click');
</code></pre>
<p><strong>Questions You Might Ask</strong></p>
<p><em>Why don't you just change the code that's binding it to the click event?</em></p>
<p>The JS that's setting this up is part of a Drupal module (<a href="http://drupal.org/project/dhtml_menu">DHTML Menu</a>, if you're curious), so I don't want to change the module code because it will be wiped out when the module is inevitably updated in the future. I'm also using the <code>click</code> handler for other parts of the page - I only want to move it to <code>mouseover</code> and <code>mouseout</code> for one menu.</p>
|
javascript jquery
|
[3, 5]
|
1,757,066
| 1,757,067
|
How to scale click/touch area of a view after applying ScaleAnimation in android?
|
<p>I haven't found any solution regarding how to scale the touch area of a view after applying ScaleAnimation, this animation really change the scale of that view but not the touch area of that view .The touch area remains the same. Here is my sample code:</p>
<pre><code>package com.xyz;
public class XyzActivity extends Activity {
int zoomLevel = 1;
int zoomNext = 2;
Button btn = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
btn = (Button)findViewById(R.id.button1);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
AnimationSet set = new AnimationSet(false);
ScaleAnimation anim = new ScaleAnimation(zoomLevel, zoomNext, zoomLevel, zoomNext);
set.addAnimation(anim);
set.setDuration(0);
set.setFillEnabled(true);
set.setFillAfter(true);
v.startAnimation(set);
zoomLevel += zoomNext;
zoomNext = zoomLevel - zoomNext;
zoomLevel-=zoomNext;
}
});
}
}
</code></pre>
<p>And tha xml is:</p>
<pre><code><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button android:text="Button" android:id="@+id/button1"
android:layout_width="wrap_content" android:layout_height="wrap_content"/>
</RelativeLayout>
</code></pre>
<p>What I do please suggest me....</p>
|
java android
|
[1, 4]
|
4,415,756
| 4,415,757
|
How to show status message on TextView in Main Activity?
|
<p>I am newbie in android, in my android app, a main <code>Activity</code> class, which contains a <code>TextView</code> for displaying various status message from other classes. I want to update <code>TextView</code> of main <code>Activity</code> with status values from other classes. There is no direct connection between main activity class and other class. Is it possible in android ? if yes i am not aware to do it. Kindly provide solution to do it</p>
<p>code snippets</p>
<pre><code>//main activity
public class MainMenu extends Activity {
static String status = "Hello Friends";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView)findViewById(R.id.mytext);
tv.setText(status);
MyOtherClass myclass = new MyOtherClass();
myclass.connect();
}
</code></pre>
<p>Other class is not an activity class</p>
<pre><code> // Other class
public class MyOtherClass {
public MyOtherClass(){
}
public void connect(){
String strIP = Mtx.confRead("IPAddress");
String strPort = Mtx.confRead("Port");
String msg = "Connecting...";
// i want to show value of msg varible in Textview of main activity from here
}
</code></pre>
<p>thanking you</p>
|
java android
|
[1, 4]
|
3,881,913
| 3,881,914
|
download problem asp.net
|
<p>Hi this is the current version......please help.</p>
<p><%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="FormDownload.aspx.cs" Inherits="Default2" Title="Form Download" %></p>
<p>
'>
</p>
<p>using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;</p>
<p>public partial class Default2 : System.Web.UI.Page
{
private void BindGrid()
{
DirectoryInfo dir = new DirectoryInfo("D:/Pilabs Projects/GlobeDse/globedse website/globedse.com/Uploads");
FileInfo[] files = dir.GetFiles();
GridView1.DataSource = files;
GridView1.DataBind();</p>
<pre><code>}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BindGrid();
}
}
private void Downloadfile(String fileName, String FullFilePath)
{
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.TransmitFile(FullFilePath);
Response.End();
}
protected void GridView1_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
{
if (e.CommandName == "Download")
{
String[] fileInfo = e.CommandArgument.ToString().Split(';');
String FileName = fileInfo[1].ToString();
String FullPath = fileInfo[0].ToString();
Downloadfile(FileName, FullPath);
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridView1.PageIndex = e.NewPageIndex
BindGrid();
}
</code></pre>
<p>}</p>
|
c# asp.net
|
[0, 9]
|
5,453,014
| 5,453,015
|
can we create instance of class by using USE Keyword
|
<p>We use keyword to refer the namespaces and class</p>
<p>can we create instance of class by using USE Keyword </p>
<p>i need to access method in that class.</p>
<p>Like eg:- using (new class) if any other ways please let me know. </p>
|
c# asp.net
|
[0, 9]
|
2,225,425
| 2,225,426
|
How to use JavaScript/jQuery to search/delete emails in GMail, HotMail etc?
|
<p>I want to create a small software to delete all old emails which were sent by a specific user, e.g. GroupOn. </p>
<p>I would like to run this program on multiple platforms so I would like to write in JavaScrip.</p>
<p>I am not sure whether it is possible.</p>
<p>Thanks in advance.</p>
<p>Updated my subject, and thank you for reminding me.</p>
|
javascript jquery
|
[3, 5]
|
1,453,561
| 1,453,562
|
how to convert the data stored in string to string array
|
<p>I'm parsing an url using json. I'm getting the value of each tag and storing it in a string using <code>getString</code> in a <code>for</code>-loop. </p>
<p>What I want is to store the <code>String</code> value into a <code>String</code> array. I'm a noob as far as android development is concerned.</p>
<p>Below is the code:</p>
<pre><code>JSONObject json = JsonFunctions.getJSONfromURL("http://www.skytel.mobi/stepheniphone/iphone/stephenFlickr.json");
try {
JSONArray boombaby=json.getJSONArray("items");
for(int i=0;i<boombaby.length();i++) {
JSONObject e = boombaby.getJSONObject(i);
mTitleName=e.getString("title");
String mTitleImage=e.getString("image");
}
}
</code></pre>
|
java android
|
[1, 4]
|
4,314,607
| 4,314,608
|
confirmation about deleting a record from database
|
<p>I am using php and javascript. I want to delete a record from database after a giving "Yes" and "No" confirmation to user. I am using confirmbox by google but don't know what should be my code structure inside that. I am new to programing. Can any one help me please</p>
<p>How can I add this php function on javascript</p>
<pre><code>function deleteRecord($id)
{
$sql = "DELETE FROM user_database WHERE user_id = ".$id;
mysql_query($sql) or die("Can not delete");
}
</code></pre>
<p>And on page</p>
<pre><code><script type="text/javascript">
function show_confirm()
{
var r=confirm("Press a button!");
if (r==true)
{
alert("You pressed OK!");
}
else
{
alert("You pressed Cancel!");
}
}
</script>
</head>
<body>
<input type="button" onclick="show_confirm()" value="Show a confirm box" />
</code></pre>
|
php javascript
|
[2, 3]
|
3,142,140
| 3,142,141
|
Is this possible through javascript?
|
<p>I am currently working on asp.net project. I use oodle web service. Oodle provides result via URL. I use <a href="http://api.oodle.com/api/v2/listings?key=TEST&region=chicago&category=vehicle&format=json" rel="nofollow">Link</a> to get data from the URL.</p>
<p>From code behind I use following code to fetch the resultant string :</p>
<pre><code>string url =
@"http://api.oodle.com/api/v2/listings?
key=TEST&region=chicago&category=vehicle&format=json";
var jsonString = new WebClient().DownloadString(url);
</code></pre>
<p>Now , My problem is I use button click event to run that code. But is this through <code>JavaScript</code> ? Because If I use <code>Javascript</code> it will be easier to access my resultant data. </p>
|
c# javascript asp.net
|
[0, 3, 9]
|
5,319,055
| 5,319,056
|
Passing data from one page (within jQuery Dialog) to another
|
<p>How can I pass a selected value of an element in a jQuery dialog to its parent page?</p>
<p>Page1.aspx</p>
<pre><code> $(document).ready(function() {
$("#btnLookUp").click(function() {
$("#searchActor").dialog({
autoOpen: "false",
resizable: "false",
height: "250",
width: "320"
});
});
});
$(document).ready(function() {
$("#btnSearch").click(function() {
$("#actorsList").load("LookUp/ActorsList.aspx", { lname: $("#txtSearchCriteria").val() });
});
return false;
});
function SelectGrid(objValue, itemValue , popUpDialog) {
$(objValue).val(itemValue);
$(popUpDialog).dialog("close");
}
</code></pre>
<p>ActorsList.aspx Codebehind</p>
<pre><code>private void LoadActors(string param)
{
DataTable dt = new DataTable();
//Execute stored proc
Response.Write("<table>");
foreach (DataRow dr in dt.Rows)
{
Response.Write("<tr>");
Response.Write("<td>" + "<label onclick='SelectGrid(#txtActorId,0,#searchActor'>Select</label>" + "</td>");
Response.Write("<td>" + dr[2].ToString() + "</td>");
Response.Write("<td>" + dr[3].ToString() + "</td>");
Response.Write("<td>" + dr[4].ToString() + "</td>");
Response.Write("</tr>");
}
Response.Write("</table>");
}
</code></pre>
<p>`</p>
<p>Also, please help me with this line, I'm having trouble how to assign the value so I just placed it as 0.
<code>Response.Write("<td>" + "<label onclick='SelectGrid(#txtActorId,0,#searchActor'>Select</label>" + "</td>");</code></p>
|
jquery asp.net
|
[5, 9]
|
3,378,068
| 3,378,069
|
How can I prevent automatic redirect in LoggedIn-event on the asp.net login control?
|
<p>How can I prevent the asp login-controls automatic redirect on authentication in the LoggedIn-event? I want to make some controls available to the user before redirect...</p>
<p>Stig</p>
|
c# asp.net
|
[0, 9]
|
3,802,439
| 3,802,440
|
javascript get variable open in new window
|
<p>I have standard text links which all say "Full View". When clicked these links send out php in this form: <a href="http://mysite.com/fullview.php?myimage=30" rel="nofollow">http://mysite.com/fullview.php?myimage=30</a></p>
<p>Basically there's thumbnailed images and text links that say full view. I'd like for fullview.php to capture the myimage variable, and display it as a full sized image. Meaning, a blank page (fullview.php) displaying the image. Sounds likes javascript to me.</p>
<p>How do you put the javascript into fullview.php to capture the variable and display it as a full sized image?</p>
<p>myimage=30 can be any number example: myimage=942</p>
<p>Thanks for any help, Darrell</p>
|
php javascript
|
[2, 3]
|
5,652,695
| 5,652,696
|
how to use parameters in code behind to access some controls in my aspx file using C#
|
<p>i have 2 textbox that has a date values in my aspx file. I would like to access these 2 controls in my select statement using code behind but i am getting error like this:
'Must declare the scalar variable "@txtStartClosingDate"
so what am i missing here in my code behind here? thanks</p>
<pre><code> protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
MainGridView.DataSource = GetData("select GroupCategory, Count(Status1) as TotalCount from [MasterProject] where Closing_Date >= @txtStartClosingDate and Closing_Date <= @txtEndClosingDate and Status1 is not null group by GroupCategory");
MainGridView.DataBind();
}
}
</code></pre>
<p>Here is one of the textbox that i am trying to reference:</p>
<pre><code><asp:TextBox ID="txtStartClosingDate" runat="server" CssClass="datepicker"></asp:TextBox>
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,467,943
| 1,467,944
|
jquery remove javascript code
|
<p>I am able to remove html element using jquery using <code>$(element).remove();</code>. But there is a javascript code, like <code>setinterval()</code>, which should be removed. Yes, I can do <code>clearInterval()</code> for particular that case, but what if other types of javascript code?</p>
<pre><code> <script>
var baseurl = '...';
jQuery(function(){
new AjaxUpload('#upload_button', {
action: baseurl,
onSubmit : function(file , ext){
jQuery('#...').val(file);
},
onComplete: function(file, response){
// do something....;
}
});
});
</script>
</code></pre>
<p>But I am unable to do so.</p>
<p>Can anybody help me out this problem?</p>
|
javascript jquery
|
[3, 5]
|
5,580,655
| 5,580,656
|
set first check box checked and others disable from checkbox list in clientside
|
<p>I have a Checkbox list. On the load of a page i want my first checkbox true and others are disable.I need to check only one checkbox from checkbox list and others should be disable.If use unchecked the checked checkbox then others should be enable means allowed only one check box checked.</p>
<p>My javascript code is here but on the load of page its not checked the first checkbox, also i want the id of each checkbox while using checkboxlist.</p>
<pre><code>function CheckOptions(CheckBoxList) {
var checkboxlist = document.getElementById('CheckBoxList1');
var checkedCount = 0;
var options = CheckBoxList.getElementsByTagName('input');
for (var i = 0; i < options.length; i++) {
if (options[i].checked) {
checkedCount += 1;
}
}
if (checkedCount > 0) {
for (var j = 0; j < options.length; j++) {
if (!options[j].checked)
options[j].disabled = true;
} }
else {
for (var k = 0; k < options.length; k++) {
options[k].disabled = false;
}
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,380,738
| 5,380,739
|
How to add touch events to a class?.. prefereably through jquery
|
<p>How can you do something like the following?</p>
<pre><code>$('.myDivs').ontouchstart(function(){
alert('touch');
})
</code></pre>
<p>the only way I appear to be able to implement touch events is using javascript.. like so </p>
<pre><code>document.getElementById('singleDiv').addEventListener("touchstart",touchHandler, false);
</code></pre>
<p>However I would like to implement this to a class, rather than an id... therefore is there a way to do it using jquery like the above example?....</p>
<p>I have found the answer:</p>
<pre><code>$('.myDivs').bind('touchstart', function (event) { alert('touch');});
</code></pre>
<p>Kind regards J</p>
|
javascript jquery
|
[3, 5]
|
272,391
| 272,392
|
hide tr that has th and colspan
|
<p>I'm trying to alter the background of "table tr" if it has a "colpan" and if it contains "th" but this below wont work.</p>
<pre><code>$("#mytable tr").contains('th').attr('colspan').hide();
</code></pre>
<p>Can you help?'</p>
|
javascript jquery
|
[3, 5]
|
5,226,870
| 5,226,871
|
How to Create Generic Get Custom WebConfig Section Extension Method
|
<p>i have the following Code to get a Custom Webconfig Section</p>
<pre><code>Configuration config = WebConfigurationManager.OpenWebConfiguration
(System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath + "/ExternalConfig");
Sample1Section myHandler =
(Sample1Section)config.GetSection("settings");
</code></pre>
<p>i want to convert it into Generic Extension Method so i wont repeat this same code for every Custom Section i create.</p>
<p><strong>Update 1</strong>: I get Compile Time Error "Static Class cant have non-static Method"</p>
<pre><code>public static class MyExtensions
{
public T GetSection<T>(this string sectionName) where T : class
{
Configuration config = WebConfigurationManager.OpenWebConfiguration(HostingEnvironment.ApplicationVirtualPath + "/ExternalConfig");
return config.GetSection(sectionName) as T;
}
}
</code></pre>
<p><strong>Update 2</strong>: Fixed thanks to BrandonZeider :)</p>
<pre><code> public static class MyExtensions
{
public static T GetSection<T>(this string sectionName) where T : class
{
Configuration config = WebConfigurationManager.OpenWebConfiguration(HostingEnvironment.ApplicationVirtualPath + "/ExternalConfig");
return config.GetSection(sectionName) as T;
}
}
</code></pre>
<p>thanks In Advanced.</p>
|
c# asp.net
|
[0, 9]
|
211,651
| 211,652
|
compare sql date to javascript date
|
<p>Is there an easy way to compare a sql dateTime to a javascript date time so that the two can be compared easily?</p>
<p>Are there built in javascript functions as I cant edit the sql</p>
|
javascript jquery
|
[3, 5]
|
2,686,463
| 2,686,464
|
Why is this displaying Hello World when I run it?
|
<pre><code>package com.FlickrView;
import android.app.Activity;
import android.os.Bundle;
import java.net.*;
import java.io.*;
public class FlickrView extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
URL flickr = new URL("http://api.flickr.com/services/feeds/photos_public.gne?id=39350419@N06&lang=en-us&format=rss_200");
URLConnection flickrConnect = flickr.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(flickrConnect.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
catch (MalformedURLException e) {
System.out.println("Unable to load URL");
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
</code></pre>
|
java android
|
[1, 4]
|
2,453,909
| 2,453,910
|
Disable wifi in source code
|
<p>In android source code 'WifiEnabler.java' class I want to disable wifi when battery voltage is below 3.4. I am getting battery voltage but i am unable to disable toggle button. How to do this? </p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
1,635,380
| 1,635,381
|
Iterating through array using jquery returns only last object
|
<p>I am new to jquery and i think this is just a basic problem. `</p>
<pre><code><input type="text" name="text1" value=""></input>
<input type="text" name="text2" value=""></input>
<input type="text" name="text3" value=""></input>
<input type="text" name="text4" value=""></input>
<input type="text" name="text5" value=""></input>
<input type="submit" value="submit"></input>
<pre id="result">
</pre>
</form>`
</code></pre>
<p>This is my html form and i am using following jquery function to produce json object </p>
<pre><code>$.fn.serializeObject = function()
{
var o = {};
var d={};
var a = this.serializeArray();
$.each(a, function(i,n) {
o['name'] = n['name'];
o['content'] =(n['value']);
});
return o;
};
</code></pre>
<p><code>$(function() {
$('form').submit(function() {
$('#result').text(JSON.stringify($('form').serializeObject()));
return false;
});<br>
});</code> </p>
<p>on runnig the above html i am getting the output <code>{"name":"text5","content":"sdsd"}</code> </p>
<p>just the final text field. i know am wrong somewhere . can someone help me to fix it. thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
5,839,206
| 5,839,207
|
asp.net c# google api Documents - 401 Unauthorized
|
<p>I have this code</p>
<pre><code>DocumentsService vService = new DocumentsService("test");
vService.setUserCredentials("vUserName", "vPassword");
RequestSettings vSettings = new RequestSettings("test");
DocumentsRequest vDocReq = new DocumentsRequest(vSettings);
Feed<Document> vFeed = vDocReq.GetEverything();
foreach (Document d in vFeed.Entries) {
lbxDocumente.Items.Add(d.Title + " " + d.Author);
}
</code></pre>
<p>Why do I get this exception?</p>
<blockquote>
<p>System.Net.WebException: The remote server returned an error: (401) Unauthorized</p>
</blockquote>
|
c# asp.net
|
[0, 9]
|
2,191,130
| 2,191,131
|
C# run code every 30 days
|
<p>If I were to run some code, perhaps send an email, every 30 days to users of my site, how would that be done?</p>
|
c# asp.net
|
[0, 9]
|
1,101,726
| 1,101,727
|
Why does my function get called when it's not supposed to?
|
<p>I have 2 java script functions. If the first one returns true, the 2nd one is not to be executed. If the first one returns false, only then the second function to be executed.
So I am trying to achieve this with the following code:</p>
<pre><code> <script type="text/javascript" language="javascript">
function needsForcedReset() {
if($("#showMessage").text().length > 0) {
return true;
}
return false;
}
function sendAlert() {
//Sends an alert;
alert('oh oh');
}
$(document).ready(function() {
alert('in doc ready');
if (needsForcedReset()) {
alert('Need force reset, no check for alerts');
return;
}
else {
sendAlert();
}
});
</script>
</code></pre>
<p>What I am seeing though, is that the sendAlert is being called regardless of what the needsForcedReset function return. How do I make it work?</p>
<p><b>Edit: the showMessage is a div element </b></p>
|
javascript jquery
|
[3, 5]
|
2,568,413
| 2,568,414
|
auto collapse html content
|
<p><br/>
Perhaps you can't help me.
I want to auto create <strong>jquerymobile collapses</strong> (<a href="http://jquerymobile.com/test/docs/content/content-collapsible.html" rel="nofollow">http://jquerymobile.com/test/docs/content/content-collapsible.html</a>) with javascript a content like this :</p>
<pre><code><h3>title 1</h3>
some text
<h3>title 2</h3>
some text
<h3>title 3</h3>
some text
</code></pre>
<p>This content come from JSON that i can't manipulate before.<br/>I must wrap each :</p>
<pre><code><h3>title</h3>
some text
</code></pre>
<p>with this :</p>
<pre><code><div data-role="collapsible" data-collapsed="true"></div>
</code></pre>
<p>but i can't do this... Help !</p>
|
javascript jquery
|
[3, 5]
|
3,349,224
| 3,349,225
|
How do I encrypt multiple passwords using one key?
|
<p>I want to encrypt multiple passwords using one key using Java. I can generate passwords using a key generator but it generates different key every time.
I want only one key to do encryption. How do I encrypt multiple passwords using one key?
And the other issue is each time i run my application i always use the same key after i re-start application.</p>
|
java android
|
[1, 4]
|
5,005,719
| 5,005,720
|
How can I autoplay media in Safari on an iPhone?
|
<p>I'm trying to get an video file to autoplay in Safari on an iPhone.
But this javascript not working on Safari on an iPhone, but on Android it's fine.</p>
<pre><code> window.onload = function () {
var pElement = document.getElementById("myVideo");
setTimeout(function () {
pElement.load();
setTimeout(function () {
pElement.play();
}, 500);
}, 500);
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,409,479
| 3,409,480
|
Fetch posts from db-table, do math and THEN sort <- how?
|
<p>For fetching some db-posts (int) and then multiplying with user input-values I use php. </p>
<pre><code>$result = mysql_query("SELECT * FROM table")or die("Error" . mysql_error());
while($row = mysql_fetch_array($result)){
$value1=$row['value1'];
$value2=$row['value2'];
$value3=$row['value3'];
$product1=$value1*$userinput1;
$product2=$value2*$userinput2;
$product3=$value3*$userinput3;
}
</code></pre>
<p>[Now show results sorted by e.g. product1 ASC]</p>
<p>HOW?</p>
<p>Also how to make it possile to let the user change to e.g. sort by product2?</p>
<p>How can I then show the resluts, sorted by the sum of the user in put and one value from the row. And also give the user the possibility to change which value and user-input sum to sort by.</p>
|
php javascript
|
[2, 3]
|
661,539
| 661,540
|
Getting images and description of a webpage using its link in ASP.Net
|
<p>hi i am making a website in asp.net which is like social netwroking. users shares their updates and views. i am able to complete all modules but now stucked at a requirement.</p>
<p>i want to get images (not screenshot of page) and description from webpage link, when entered by user into the update status bar. just like facebook do. when we enter some link, it gets its thumbnail images and also some desription of that page.</p>
<p>can someone give me direction how can this be done in asp.net. is there some pluggin or code available..</p>
<p>thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
253,971
| 253,972
|
c#.net website - How to let user choose a folder?
|
<p>I basically want to open a dialog box on the click of a button..The user will choose a destination folder and then a text file will be created in the chosen Folder using the path in the dialogue box.</p>
<p>I have used asp.net's FileUpload to upload files but I don't know how to chose a folder using it. Or there's some other way to do this? please help . Thanks.</p>
|
c# asp.net
|
[0, 9]
|
211,916
| 211,917
|
Jquery - add image at specific co-ordinates
|
<p>Is it possible to add a image at a clicked position within a div using jquery?</p>
<p>I need to develop a small game basically involves clicking the screen to guess a position - a image is placed wherever the user clicks...</p>
<p>I know how to get the X & Y coordinates of the place that was clicked - but have no idea how to place an image in that position...</p>
<p>Any help would be great-fully received!</p>
<p>Cheers
Paul</p>
|
javascript jquery
|
[3, 5]
|
2,575,389
| 2,575,390
|
Are inbuilt layouts in Android Styleable?
|
<p>Is possible to apply styling to Android inbuilt layouts such as R.layout.simple_list_item_multiple_choice?</p>
|
java android
|
[1, 4]
|
1,828,469
| 1,828,470
|
To call C# Function from Javascript in Web apps
|
<p>Hi i wanted to call a C# function through javascript code.</p>
<p>For Eg: i have C# function which is in aspx.cs page</p>
<pre><code>public void setValue()
{
lblMsg.Text = "hello";
....
.....
}
</code></pre>
<p>from javascript i need to call this function. </p>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,997,919
| 2,997,920
|
How to disable cookie triggered popup on first page visitor lands on?
|
<p>I have a cookie set with expiry of 3 mins, this will allow a user to navigate through the site for 3 mins before seeing an advert. They will see the ad if cookie is not present on next page they visit and the cookie will be reset once the ad is closed. </p>
<p>However a consequence of this is that as soon as the website is visited the ad will show, how can I stop the ad showing on the first page a visitor lands on?</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,488,549
| 4,488,550
|
Mixing variables with text in Javascript
|
<p>Im trying (unsuccessfully) to prepend the following content to a div:</p>
<pre><code>var entry = $('textarea').val();
var formated = '<div class="newsfeed_entry"><p>' . entry . '</p></div>';
$('#entry_container').prepend(formated);
</code></pre>
<p>I think the reason it isn't work is related to the way I am mixing variables and text. I looked at the documentation but I can't figure out what the issue is. </p>
|
javascript jquery
|
[3, 5]
|
4,218,546
| 4,218,547
|
How to make a dynamic preview link?
|
<p>I need to show a preview link in a pop up. Basically it is a link that, on the mouse over, shows more information of the contact.</p>
<p>Like when we put the mouse over the avatar of an user who posted a comment.</p>
<p>How can I do this in asp.net?</p>
|
javascript asp.net
|
[3, 9]
|
4,488,305
| 4,488,306
|
Splitting string with multiple delimiters into a hash table in JavaScript
|
<p>I'm trying to figure out how to split a string using regex while having the results placed into a hash table.</p>
<p>Example:</p>
<pre><code>var x = "Name: John Doe
Age: 30
Birth Date: 12/12/1981";
var arr = x.split(/Name:|Age:|Birth Date:/);
</code></pre>
<p>However while I can spit a string the problem is I can't store the values into a useful format such as a hash etc. Since some of the information may not always be shown.</p>
<p>I would want the results to be something like:</p>
<pre><code>var myHash = {}; // New object
myHash['Name'] = "John Doe";
myHash['Age'] = "30";
myHash['Birth Date'] = "12/12/1981";
</code></pre>
<p>Is there an easy why to do this?</p>
<p>Edit: The script is used to parse data from a generated report. And the format does not always have carriage returns. It's going to be used to automatically generate notices instead of hand typing everything.</p>
<p>Example:</p>
<pre><code>Name: John Doe Birth Date: 12/12/1981
Age: 30
</code></pre>
<p>However, after seeing examples I may be able to do it if I first add a carriage return or other special character in front of the regex matches. Need to figure out how to add a value in front of the regex matches first.</p>
|
javascript jquery
|
[3, 5]
|
1,795,411
| 1,795,412
|
Sorting multiple html tables logically related to each other
|
<p>I wish to sort 3 separate tables that are logically related to each other but kept separate in design for some purpose.
I am using sorttable.js for sorting.
Can someone guide me on this.
Thanks.</p>
|
javascript asp.net
|
[3, 9]
|
2,950,747
| 2,950,748
|
Looking for a hand on my jQuery and JS script
|
<p>What I have is in my fiddle here <a href="http://jsfiddle.net/mPuj9/4/" rel="nofollow">http://jsfiddle.net/mPuj9/4/</a> </p>
<p>What I tried to do is to disable the button until all of <code>textbox</code>es are filled and the <code>checkbox</code> is checked. My current code is not good, it let you submit in some cases and I don't know how to work it with the <code>checkbox</code>.</p>
<p><em><strong>CODE</em></strong></p>
<pre><code>$(document).ready(function() {
$('.textfield').blur(function() {
if ($.trim(this.value) == "") {
$('#btnUpdate').attr("disabled", true);
}
else {
$('#btnUpdate').removeAttr("disabled");
}
});
});
$(document).ready(function() {
$('#termid').change(function() {
var val = $(this).val();
$('#reservationdetails').empty().addClass('loading').load('../kratisis/forms/' + val + '.php', function() {
$('#reservationdetails').removeClass('loading')
});
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,436,781
| 2,436,782
|
python and javascript with html generation
|
<p>On a website that I manage, we have JSON files which contain page data. We then create the page using this JSON.</p>
<p>The data looks roughly like this (except a lot more complex).</p>
<pre><code>[
{"title": "Hello world", "content": "World, hello to you!"},
{"title": "Hello world Part II", "content": "The sequel to hello world."},
...
]
</code></pre>
<p>This data is then parsed into HTML. Now, here lies the issue: we need two versions of the HTML.</p>
<p>One needs to be static, outputted in the format of <code>file-0.html</code> which would be formatted with a title of <code>Hello World</code> and content of <code>World, hello to you!</code> and <code>file-1.html</code> (title=<code>Hello World Part II</code>, content=<code>The sequel to hello world</code>).</p>
<p>The second needs to be just a plain page <code>file-all.html</code> which includes a JavaScript that pulls the JSON via AJAX when its needed and creates a container for each page which includes subpages that have the content/titles for everything in the JSON.</p>
<p>Right now, we use Python to generate the HTML for the <code>file-0.html</code> static pages, and then JavaScript for the AJAX pages. While this works, it means there is a lot of code duplication for a pretty small project—every time we want to change the class of the <code><h1></code> title is wrapped in, we have to change two places with slightly different syntax.</p>
<p>Is there any good way of fixing this issue, so that all the code for generating page (or as much as possible) is in one language? (This would probably have to be JavaScript, since bandwidth is an issue—we'd like to avoid transferring <code>HTML</code> via AJAX if possible.)</p>
|
javascript python
|
[3, 7]
|
2,292,141
| 2,292,142
|
Searching multiple words in many blocks of data
|
<p>I have to search about 100 words in blocks of data (20000 blocks approximately) and each block consists of about 20 words. The blocks should be returned in the decreasing order of the number of matches. The brute force technique is very cumbersome because you have to search for all the 100 words one by one and then combine the number of related searches in a complicated manner. Is there any other algorithm which allows to search multiple words at the same time and store the number of matching words?</p>
<p>Thank you </p>
|
c++ python
|
[6, 7]
|
782,927
| 782,928
|
Java split string from array
|
<p>I have a string array that contains some information.</p>
<p>Example: </p>
<pre><code> String [] testStringArray;
testStringArray[0]= Jim,35
Alex,45
Mark,21
testStringArray[1]= Ana,18
Megan,44
</code></pre>
<p>This is exactly how the information is. Now my problem is I want to make each element a seperate element in an array and I want to split it based on the \n character.</p>
<p>So I want </p>
<pre><code> newArray[0]=Jim,35
newArray[1]=Alex,45
newArray[2]=Mark,21
newArray[3]=Ana,18
</code></pre>
<p>etc etc. I am aware of the split method but won't this just split each array element into a completely new array instead of combining them?</p>
<p>If anyone could help, it would be appreciated. Thanks</p>
|
java android
|
[1, 4]
|
4,872,346
| 4,872,347
|
associate an event to the spinner
|
<p>I've created a spinner for my application. This is the code in the main.xml</p>
<pre><code> <Spinner
android:id="@+id/sMenu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:prompt="@string/base"
/>
</code></pre>
<p>and in my main class</p>
<pre><code> String [] base = {"Decimale", "Binaria", "Ottale", "Esadecimale"};
Spinner s1;
s1 = (Spinner) findViewById (R.id.sMenu);
ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.base, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
s1.setAdapter(adapter);
</code></pre>
<p>The program converts a number in binary, decimal, octal, hexadecimal. I want to associated some events to the spinner. For example, if I select in the spinner binary, in the edit text I can put only binary numbers. In which way I can associate this event to the spinner?</p>
|
java android
|
[1, 4]
|
2,067,963
| 2,067,964
|
Why is object/associative array values not setting when I use $item.data("something").x
|
<p>Why is it when I do something like </p>
<p><a href="http://jsfiddle.net/sUhn9/" rel="nofollow">http://jsfiddle.net/sUhn9/</a></p>
<p><em>Added relevant HTML</em></p>
<pre><code><div id="container" data-physics='{x: 10, y: 5}'>Hello</div>
</code></pre>
<p>JavaScript:</p>
<pre><code>$(function() {
var obj = $("#container").data("physics");
console.log("b4", obj);
obj.x = -2;
obj.y = -6;
console.log("after", obj);
});
</code></pre>
<p>I get </p>
<pre><code>b4 {x: 10, y: 5}
after {x: 10, y: 5}
</code></pre>
<p>Where x and y are not being set</p>
|
javascript jquery
|
[3, 5]
|
2,051,799
| 2,051,800
|
How to pause but not freeze Android execution?
|
<p>I'm trying to set the background color of an ImageView over a specified amount of time (pauses in between each switch of color) based on a certain criteria (such as string = "a" or "b"). My problem is I can't seem to make the entire application wait for one change until it moves on to the next, so to the user it just looks like the color starts then is immediately the last color. </p>
<p>I've tried CountDownTimers (which just continue to execute while the other timer is running), handlers (postDelayed(null, 5000)), Thread.Sleeps etc. </p>
<p>Here's an example of what I'm trying to do: </p>
<p>Set color on ImageView to red<br>
sleep for 500ms </p>
<pre><code>for(int i = 0; i < stringArray.length; i++){
if(stringCompare = "a") {
Set color on ImageView to blue
sleep for 500ms }
else if(stringCompare = "b") {
Set color on ImageView to blue
sleep for 1000ms
}
Set color on ImageView to red
sleep for 500ms
}
</code></pre>
<p>I know that's kind of crazy, but I've tried all the above methods I could think of with no success on actually making the program wait, but not completely stopping it. </p>
<p>Thanks.</p>
|
java android
|
[1, 4]
|
617,889
| 617,890
|
Trying to find a (jquery?) popup date/time selector with callback to php
|
<p>I have a large table with input boxes.</p>
<p>Three columns of these are dates/times (in unix format).</p>
<p>Im trying to find an easy to implement way of allowing the user to click on this box, being able to (graphically) select a date/time, and when done, sending the selection to a php script to make the physical changes of the data. (i can convert the date/time back to unix from here if necessary).</p>
<p>The caveat is that each input is named dynamically according to its row number.</p>
<p>Here is my script where i output the date fields</p>
<pre><code>}elseif(in_array($j, array(19,33,54))){
echo "<td><input type=text value=\"$value\" name=\"date$j\" class=med></td></td>";
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
4,130,194
| 4,130,195
|
Transversing a JQuery object?
|
<p>I'm doing sorting of a list of elements, using:</p>
<pre><code>jQuery.fn.sort = function() {
return this.pushStack( [].sort.apply( this, arguments ), []);
};
$("ol li").sort("sortFunction").appendTo("ol");
</code></pre>
<p>The problem is in the sortFunction.</p>
<pre><code>function sortFunction($a, $b) {
...
}
</code></pre>
<p>Basically, what I want is to treat both $a and $b as jQuery objects, so I can manipulate them.</p>
<p>e.g, inside the sortFunction do </p>
<pre><code>$a.find("div#3 li").html();
</code></pre>
<p>This doesn't work since $a and $b are native javascript objects.</p>
<p>Any help?</p>
|
javascript jquery
|
[3, 5]
|
433,040
| 433,041
|
Python to Javascript
|
<pre><code>>>> def clockwise(r):
... return list(r[0]) + clockwise(list(reversed(zip(*r[1:])))) if r else []
...
>>> a = [
... [ 1, 2, 3],
... [ 5, 6, 7],
... [ 9, 10, 11]]
>>> clockwise(a)
[1, 2, 3, 7, 11, 10, 9, 5, 6]
</code></pre>
<p>I'm trying to change the function clockwise into Javascript but can't seem to get it to work.</p>
<p>I've created some methods with similar functions:</p>
<pre><code>function zip(masterArray){//zips 2 arrays
var innerLoop = masterArray.length; //inner loop
var outerLoop = 0;
//get length of shortest
for (var i = 0; i<masterArray.length;i++){
var a = masterArray[i].length;
if (outerLoop==0){outerLoop = a;}else if(a < outerLoop){outerLoop = a;}
}
var newOuterArray = new Array(outerLoop);
for (var x = 0; x<outerLoop;x++){
var newInnerArray = new Array(innerLoop);
for (var y = 0; y<innerLoop;y++){
newInnerArray[y] = masterArray[y][x];
}
newOuterArray[x] = newInnerArray;
}
return newOuterArray;
}
function reversed(arr){
var newArray = new Array(arr.length);
var n = 0;
for(var i=arr.length-1; i>=0; i--){
newArray[n++] = arr[i];
}
return newArray;
}
function clockwise(r){
if(r.length>0){
var a = reversed(zip(r.slice(1)));
a.splice(0,0,r[0]);
return clockwise(a);
}else{
return [];
}
}
</code></pre>
<p>Here's my progress. I'm stuck at the last part: clockwise error in firebug is too much recursion. </p>
|
javascript python
|
[3, 7]
|
366,551
| 366,552
|
Jquery: Add class unless there is a child of certain class
|
<p>I want to do an addclass, but only if it doesn't have a child of a certain class.</p>
<pre><code>$selector.addClass('addthisclass');
</code></pre>
<p>So I want:</p>
<pre><code><div class="addthisclass"><span></span></div>
</code></pre>
<p>And nothing on here.</p>
<pre><code><div><span class="badclass"></span></div>
</code></pre>
<p>Anyone know how to do this?</p>
|
javascript jquery
|
[3, 5]
|
4,481,158
| 4,481,159
|
What's the Java's float.floatToRawIntBits equivalent method in C#?
|
<p>What's the Java's float.floatToRawIntBits method implementation in C# ?</p>
|
c# java
|
[0, 1]
|
4,182,718
| 4,182,719
|
How can we make Tab layout auto hide?
|
<p>generally we can hide particular tabs at runtime. but I need to make make whole tab layout hideable. when I click the screen once it appears and other time it will disappear. Can this possible. I have seen this in motorola Droid X phone's camera application.
please Help me.
thanks in advance</p>
|
java android
|
[1, 4]
|
4,667,794
| 4,667,795
|
Dropdownlist filling within Gridview (updated)
|
<p>I have a DropDownList within a Gridview (<em>a web application</em>), the Dropdownlist' data comes from database, as :</p>
<pre><code> private void LoadClassType(DropDownList dropDownList)
{
businesslayer bs = new businesslayer(); // business layer object
dalDataset ds = new dalDataset (); // typed dataset
dropDownList.Items.Clear();
ds = bs.GetStClassType(-1);
dropDownList.DataSource = ds.tClassType;
dropDownList.DataTextField = "classType";
dropDownList.DataValueField = "classTypeId";
dropDownList.DataBind();
}
</code></pre>
<p>It's important to show this DropDownList with each record(row).. <br> using The '<code>GridViewRowDataBound</code>' to set the values for the dropdownlists in each grid' row at run time..like:</p>
<pre><code> protected void MyGridViewRowDataBound(object sender, GridViewRowEventArgs e)
{
DropDownList ddlClassTypeId= (DropDownList)e.Row.FindControl("ddlClassTypeId");
LoadClassType(ddlClassTypeId);// load data
}
</code></pre>
<p>Actually I found that I'm calling this method every row!<br>
I'm trying to find a way to enhance the performance.
Is there a technique to get the two values (<code>ClassTypeId(int),ClassType (string)</code>) <strong>once</strong> and assign each DropDownList to these values without calling more than one time for the database? <br>
What is the correct way to do this?
ASP.NET 3.5 C# </p>
|
c# javascript asp.net
|
[0, 3, 9]
|
5,842,311
| 5,842,312
|
Is it possible to compile C# without structs and with limited generics into JVM?
|
<p>I like C#, but I have to write Java and I really dislike Java as a language. But what is the difference? If we omit structs and interop related stuff, then the resulting C# code should be easily compilable into JVM, isn't it?</p>
<p>So, my question is this - is there a tool that:</p>
<ol>
<li>Can compile C# into JVM, provided that the C# code is compatible with JVM and fail the compilation if not? </li>
<li>Makes it possible to reference Java libraries from such C# code?</li>
</ol>
<p>Thanks.</p>
<p><strong>EDIT</strong></p>
<p>When I mean the languages are similar, I mean that the basic concepts should be implemented similarly in JVM and MSIL. As for the languages, I find the Java language too verbose and inconvenient to program compared to C# 4.</p>
<p><strong>EDIT2</strong></p>
<p>Another clarification. I am not intending to target both CLR and JVM. At the end of the day, I need JVM. My only problem is that it feels really awkward to program Java after having programmed C# 4, which has all these little things, which are usually no more than syntactic sugar of the compiler, but they make all the difference.</p>
|
c# java
|
[0, 1]
|
5,990,757
| 5,990,758
|
Issue parsing Reddit XML with jQuery
|
<p>I'm trying to use the reddit XML feed of a subreddit, but I'm having issues parsing it with JavaScript. </p>
<p>I've got this code</p>
<pre><code>function parseXml(xml) {
var xmlResult = "";
$(xml).find("item").each(function() {
xmlResult = xmlResult + ($(this).find("title").text()) + "<br />";
});
document.write(xmlResult);
}
</code></pre>
<p>but the issue is that it duplicates the title.</p>
<p>In the Reddit XML feed, there is the title and the media:title tag. I how I can fix this duplication.</p>
<p>Example: Title is "Really awesome title of post", and in my output I get "Really awesome title of postReally awesome title of post".</p>
|
javascript jquery
|
[3, 5]
|
3,015,038
| 3,015,039
|
jQuery cant get value from textbox
|
<p>I am trying to get a value from a textbox so that that I can rotate an Image using jQuery</p>
<pre><code><script src="Scripts/jQueryRotate.2.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
var angle = $("input:TextBox1").val();
$("#needle").rotate(angle);
alert(angle);
});
</script>
</code></pre>
<p>And I'm populating the textbox as follows</p>
<pre><code><script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
WeatherLibrary.WeatherData wLib = new WeatherLibrary.WeatherData();
double dataLatest;
string sensorName;
sensorName = "umtAdjWinDir";
double dir = wLib.GetLatestData(sensorName).Value;
dir = Math.Round(dir, 0);
TextBox1.Text = dir.ToString();
}
</script>
</code></pre>
<p>TextBox1 is the the id of the textbox</p>
<pre><code> <asp:TextBox ID="TextBox1" runat="server" ReadOnly="True"></asp:TextBox>
</code></pre>
<p>The alert I have given says <code>undefined</code> and the image never gets rotated.</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
91,849
| 91,850
|
JavaScript methods, calling method without parentheses
|
<p>Hello there I have a question with the that I need some help with to increase my knowledge and understanding of JavaScript.</p>
<p>Within my init method please look at this particular line with the .on method where I am saying when button is clicked we’re going to refer to the contactForm object by using the this keyword and then we’re going to call the .show method. </p>
<pre><code>.on( 'click', this.show );
</code></pre>
<p>Now the question is – if show is a method, then why aren’t we doing this, why aren’t we calling the method like this? </p>
<pre><code> .on( 'click', this.show() );
</code></pre>
<p>Am I correct in saying it’s because we don’t want to call the show method immediately, if JavaScript came across the init method would parse all of this code, and then it would come to this section right here – <code>this.show()</code> - and it would immediately execute this function. But I don’t want it to do that, I only want that function to be called on the condition that the corresponding button is clicked. </p>
<p>When the show method is written as <code>this.show</code> does the absence of the parentheses stop the show method from automatically executing ?</p>
<pre><code>var contactForm = {
init: function() {
$('<button></button>', {
text: 'Contact Me!'
})
.insertAfter('article:first')
.on( 'click', this.show() );
},
show: function() {
console.log('showing');
}
</code></pre>
<p>Sorry if I haven't been descriptive enough or accurate enough with my terminology. Any succinct and clearly explained answers would be massively appreciated.</p>
|
javascript jquery
|
[3, 5]
|
4,380,649
| 4,380,650
|
Do I have to use an animation to change an Android activity's view?
|
<p>Everywhere I look online, it seems that I must use an animation to change views dynamically (like slide in, out). Do I have to do this, or can I simple just setContentView() on each new activity?</p>
<p>Thanks!</p>
|
java android
|
[1, 4]
|
4,873,125
| 4,873,126
|
JQuery - getting mixed up with variable scope in parameter functions
|
<p><a href="http://jsfiddle.net/c7JFH/" rel="nofollow">JSFiddle - SSCCE</a></p>
<pre><code>function restoreTitle() {
for (var i = 0; i < 4; i++) {
clicks[i] = false;
letter = $('#title-wrapper p[index="' + i + '"]');
letter.css('cursor', "pointer");
}
animateTitle();
}
function animateTitle() {
for (var i = 0; i < 4; i++) {
letter = $('#title-wrapper p[index="' + i + '"]');
direction = i < 2 ? 1 : -1;
letter.css('right', 50 * direction + "%");
doAnimateLetter(i, letter, direction);
}
}
function doAnimateLetter(i, letter, direction) {
loop(function(){
var current = letter.css('right').replace("%", "");
var incoming = parseInt(current) - (5 * direction);
letter.css('right', incoming + "%");
var completed = incoming == 0;
if(completed) letter.fadeTo(animation_speed, 1);
return !completed;
});
}
function loop(run) {
if (run.apply()) requestAnimationFrame(function () {
loop(run);
});
}
</code></pre>
<p>What I would like to achieve is for the two left letters to fly in from the left and for the two right ones to fly in from the right. I can't find where I'm going wrong.</p>
|
javascript jquery
|
[3, 5]
|
3,640,376
| 3,640,377
|
creating an action table and accessing it
|
<p>I am a beginner in android and have only limited knowledge in java..!!
Anyone plzz tell me how i can create action table in android..like one showed in the picture..but my situation is different..and then how can i call actions based on the table created..
plzz help me..
Thanks in Advance</p>
<p>for image plzz see the link : <a href="http://www.ranorex.com/images/i-os-16-updating-action-table-ed.png" rel="nofollow">http://www.ranorex.com/images/i-os-16-updating-action-table-ed.png</a></p>
|
java android
|
[1, 4]
|
2,180,607
| 2,180,608
|
How to store html in hidden field using jquery?
|
<p>How to store string with HTML tags in hidden field using jquery?
I am using the below code. But its not working.</p>
<pre><code>var terms = $('#TermsAndCondition').val();
alert($('#hdnTerms').val(terms));
</code></pre>
<p>Here TermsAndCondition is TextArea and hdnTerms is hidden field.
In alert it returns the object.</p>
|
javascript jquery
|
[3, 5]
|
321,767
| 321,768
|
Convert Dataset element to string array in c#
|
<p>I am trying to convert the dataset item into the string and save into the array. But it gives me syntax error. Please help me out. This in VS 2005 and C#</p>
<p>Thanks in advance!!</p>
<pre><code>string strdetailID[] = new string[4];
for(int i = 0; i < x ; i++)
{
strdetailID[i] = dsImages.Tables[0].Rows[i]["Ad_detailsID"].ToString();
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,136,681
| 3,136,682
|
Parent Iframe URL Query string
|
<p>I am having a iframe withing facebook fanpage , the inner iframe is at my server</p>
<p>a link opens the same FanPage again in pop up using <code>window.open</code> javascript attaching a query string to it</p>
<pre><code>window.open(path,'mywindow','scrollbars=yes,toolbar=no,menubar=no,status=no,width=805,height=400');
</code></pre>
<p>Variable path is same fanpage location with querystring attached to it</p>
<pre><code>http://www.facebook.com/pages/mypagename/234234234?sk=app_3457124854683&a=1&b=10000
</code></pre>
<p>I need to get variables using php
&a=1&b=100002212364645</p>
<p>Can somebody provide a way to access this in PHP?</p>
|
php javascript
|
[2, 3]
|
2,179,306
| 2,179,307
|
How to create columnspan in gridview?
|
<p>I have a grid like below. Here I am getting problem with "<strong>Hours Last 52 Weeks</strong>". Here I have to use this text over the grid headers like the below screen. How can I use this? Highlighted in "Yellow" is the actual text.</p>
<p>Please help me on this. Thanks in advance.</p>
<p><img src="http://i700.photobucket.com/albums/ww5/vsrikanth/2010-08-03_195801.jpg" alt="alt text"></p>
|
c# asp.net
|
[0, 9]
|
3,128,976
| 3,128,977
|
Using Javascript or JQuery, how can i get the RGB color where ever the mouse is moving specially in IMG or DIV elements
|
<p>I have a <code><img src="/meAndMy/face.jpg" /></code>. I am trying to get the RGB colors when ever or where ever i move my mouse cursor.</p>
<p>How can i do this with jQuery or plain Javascript? e.g: <a href="http://www.script-tutorials.com/demos/158/index.html" rel="nofollow">http://www.script-tutorials.com/demos/158/index.html</a></p>
<p><strong>Follow up (for copy paste testing):</strong></p>
<pre><code><?=$this->headScript(); ?>
<script>
$(document).ready(function()
{
var image = new Image();
var ctx = $('#panel')[0].getContext("2d");
/* Load the picture empty.jpg */
image.onload = function ()
{
ctx.drawImage(image, 0, 0, image.width, image.height);
}
/* How can i reload later new?
image.empty; */
image.src = "/agents/empty.jpg";
/* On mouse over to my image, show me the background with RGB
change mousemove to click if requires */
$('#panel').mousemove(function(e)
{
/* Leave as it is */
var canvasOffset = $(this).offset();
var canvasX = Math.floor(e.pageX - canvasOffset.left);
var canvasY = Math.floor(e.pageY - canvasOffset.top);
var imageData = ctx.getImageData(canvasX, canvasY, 1, 1);
var pixel = imageData.data;
var pixelColor = "rgba("+pixel[0]+", "+pixel[1]+", "+pixel[2]+", "+pixel[3]+")";
/* Meat */
$(document.body).css('background-color',pixelColor);
});
});
</script>
<body>
<canvas id="panel" width="500" height="333"></canvas>
<body>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,216,662
| 1,216,663
|
parsing only the Year in a DateFormat Java
|
<p>I get a returned parsed JSON result with string values in the form of dates like "27-11-2012" which i parse to a date Object. my code for this is:</p>
<pre><code>public Date stringToDateReport(String s){
//Log.d(TAG, "StringToDateReport here is " + s);
DateFormat format;
Date date = null;
//if(s.matches(""))
format = new SimpleDateFormat("dd-MMM-yyyy");
try {
date = (Date)format.parse(s);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
</code></pre>
<p>now my issue is, a feature has been implemented that sometimes the json only returns a year object like "2012" and is giving me an "ParseException: Unparseable date" as expected. I was thinking of using regex to match the string pattern and parse from there, but not sure how to do that. Any ideas and also anyway to parse only year in a DateFormat?</p>
|
java android
|
[1, 4]
|
1,691,456
| 1,691,457
|
redirect by clicking submit button
|
<p>I am writing a code in which I need to redirect to the another page to another link by clicking the submit button
But there is something wrong Because I am not redirecting to that page.</p>
<pre><code><input id="submit1" type="submit" value="submit" onclick="location.href='hi.php'">
</code></pre>
|
php javascript
|
[2, 3]
|
2,563,933
| 2,563,934
|
Flexscroll not working in show/hide div
|
<pre><code><div class="right_tab_content_part1_s">
<a href="javascript:void(0)" class="active" id="classtabnew1" onclick="showHideDivforTabbingBeforeaward(1)">View Provider</a>
<a href="javascript:void(0)" class="" id="classtabnew2" onclick="showHideDivforTabbingBeforeaward(2)">View Message</a>
</div>
<div style="display:block;" id="divtabnewBeforeaward1"></div>
<div style="display:none;" id="divtabnewBeforeaward2"><div id="scroll2_msg" class="flexcroll"></div></div>
<script type="text/javascript">
function showHideDivforTabbingBeforeaward(id)
{
for(j=1;j<3;j++)
{
if(id==j)
{
document.getElementById('divtabnewBeforeaward'+j).style.display = 'block';
document.getElementById('classtabnew'+j).className = 'active';
}
else
{
document.getElementById('divtabnewBeforeaward'+j).style.display = 'none';
document.getElementById('classtabnew'+j).className = '';
}
}
}
</script>
</code></pre>
<p>Flexscroll is not working, even when i use the enter <code>fleXenv.initByClass ("a-class-name-of-your-choice");</code> or <code>fleXenv.fleXcrollMain (yourDivElement);</code></p>
|
javascript jquery
|
[3, 5]
|
2,749,236
| 2,749,237
|
How to implement three tier architecture in java and asp.net?
|
<p>I want to know that how can I implement three tier architecture in java and ASP.NET and what are the benefits of implementing it?</p>
|
java asp.net
|
[1, 9]
|
5,227,741
| 5,227,742
|
How to handle progress dialog correctly in android?
|
<p>I am new in android and java. I am in a trouble in implementing progress dialog correctly.</p>
<p>I have a code like this</p>
<pre><code> ProgressDialog dialog= new ProgressDialog(Main.this);
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setMax(100);
dialog.show();
MY METHOD WHICH GRABS DATA FROM INTERNET;
dialog.dissmiss();
</code></pre>
<p>but by implementing this, my method runs well but no progress dialog is visible, again when i comment out the dismiss method, the dialog doesnt stop and i had to force close the app,then how to use this dialog? in aditional dont want to bring any thread here, is there any way to use dialog without any thread? Thanks</p>
|
java android
|
[1, 4]
|
3,232,841
| 3,232,842
|
Error in for loop in datatable
|
<p>I've got an error in a datatable , that I want to present it in the aspx code. (%>)</p>
<p>it throw me an exception : </p>
<blockquote>
<p>An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. </p>
</blockquote>
<p>this is the code :</p>
<pre><code><%for (int i = 0; i < DTview.Rows.Count; i++)%>
<% {%>
<tr><%=DTview.Rows[i]["blog_total_views"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["first_name"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["is_affiliate"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["rating"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["price"].ToString(); %></tr>
<tr><%=DTview.Rows[i]["current_city"].ToString(); %></tr>
<%}%>
</code></pre>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
5,322,870
| 5,322,871
|
How to call a function when a function execution is completed? - Javascript
|
<p>I am working with a user control that has set of javascript functions that are called when an action is performed. This user control is used in a lot of places in the application.</p>
<p>When one of the inbuilt JS function completes execution, I need to fire a custom JS function on my page. </p>
<p>Is there a way for me to attach a function to be fired when another function completes execution? I don't want to update the inbuilt JS function to call this page JS function.</p>
<p>Hope this makes sense.</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
2,171,604
| 2,171,605
|
What number does 8e3 evaluate to?
|
<p>I encountered this code today:</p>
<pre><code>b = setTimeout(function () {
// do some javascript stuff here
}, 8e3)
</code></pre>
<p>The timeout is set to <code>8e3</code>. What time does this equate to in milliseconds, and why would anyone choose this strange notation? The code appears to be fully functional.</p>
|
javascript jquery
|
[3, 5]
|
591,796
| 591,797
|
Monitor services in android
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/600207/android-check-if-a-service-is-running">android: check if a service is running</a> </p>
</blockquote>
<p>I have one services to perform my action, it will run on background indefinite time. I want to monitor the service whether its is running or not. So, I want to create another service to monitor first one. </p>
<p>Is There any other action interfilter to broadcast, service running or not?</p>
|
java android
|
[1, 4]
|
5,708,719
| 5,708,720
|
More efficient way to pre-load images
|
<p>What is a better way to pre-load images:</p>
<pre><code>$.each(['{{ MEDIA_URL }}jwplayer/jwplayer.js',
'{{ MEDIA_URL }}jwplayer/jwplayer.js.jgz',
'{{ MEDIA_URL }}jwplayer/player.swf'], function() {
$('<img/>')[0].src = this;
</code></pre>
<p>or: </p>
<pre><code>var preloadImages = ['{{ MEDIA_URL }}jwplayer/jwplayer.js',
'{{ MEDIA_URL }}jwplayer/jwplayer.js.jgz',
'{{ MEDIA_URL }}jwplayer/player.swf'];
var imgs = [];
for (var i=0; i<preloadImages.length; i++) {
imgs[i] = new Image();
imgs[i].src = preloadImages[i];
}
</code></pre>
<p>What makes one better than the other?</p>
|
javascript jquery
|
[3, 5]
|
1,213,854
| 1,213,855
|
jquery inquiry: passing message without a new pageload
|
<p>Please forgive the awkwardness of this question, I honestly don't know how to phrase a better query...</p>
<p>The situation:</p>
<p>I have a basic contact form within an xhtml/php page that I'm in the process of upgrading. I recently added a new unrelated jquery plugin on this page, so I would like to use the jquery functionality to help with some simple form validation if possible. The validation is already being done via PHP in a separate file submitted by the contact form.</p>
<p>What I want to happen, is for the PHP validation message to be passed back to the main (contact form) page without a new pageload. I've seen this done by means of jquery somewhere, but I can't seem to find it again either here or via google. Can anyone help?</p>
<p>I'm really looking for speed and simplicity here, and at first glance, the jquery validation plugin is daunting in its size and complexity, so I'm loath to embark on that particular route...</p>
|
php jquery
|
[2, 5]
|
20,010
| 20,011
|
jQuery - script tags in the HTML are parsed out by jQuery and not executed
|
<p>I have an HTML page like so:</p>
<pre><code><html>
<body>
<div id='something'>
...
<script>
var x = 'hello world';
</script>
...
</div>
</body>
</html>
</code></pre>
<p>On another page, I am doing this:</p>
<pre><code>$.ajax({
url: 'example.html',
type: 'GET',
success: function(data) {
$('#mydiv').html($(data).find('#something').html());
alert(x);
}
});
</code></pre>
<p>jQuery, however, is not executing the javascript in the first file, even though the documentation says it does. How can I make it do that?</p>
<p>EDIT: Unfortunately in the real world application I am working on I don't have control over what the "included" page has. We are on the same domain, but I can't modify the code that it outputs as it is a packaged product our IT department will not let us modify.</p>
|
javascript jquery
|
[3, 5]
|
2,838,558
| 2,838,559
|
android - fc without an obvious reason
|
<p>Can someone tell me what is wrong with this code. On my 3 different devices it works totally fine but a lot of my app users are reporting fc when this activity starts</p>
<p>Logcat from every one of then is saying NullPointerException in onCreate</p>
<p>Code:
<a href="http://pastebin.com/E3WyeYdN" rel="nofollow">pastebin</a></p>
<p>And this is how i start this activity</p>
<pre><code> Intent intent = new Intent();
intent.setClass(this,ProfileEditor.class);
intent.putExtra("profileName","");//this is when creating new profile, when editing profile name goes here
startActivityForResult(intent,GET_CODE);
</code></pre>
|
java android
|
[1, 4]
|
1,099,502
| 1,099,503
|
File, Save As for iPhone and Android
|
<p>I have an application written in HTML5 that uses localstorage. The user should be able to play this game in airplane mode, but right now it goes to my website to load the page.</p>
<p>Q: How do I save a web page onto a mobile device so that it doesn't require going to the Internet to dl it first?</p>
<p>Is the answer different for iPhone vs. Android?</p>
|
android iphone
|
[4, 8]
|
4,236,686
| 4,236,687
|
Working with the same variable across the jQuery .ready() defined in multiple scripts
|
<p>Say that I have a HTML that links to two scripts:</p>
<pre><code>...
<script type="text/javascript" src="general.js"></script>
<script type="text/javascript" src="specific.js"></script>
...
</code></pre>
<p>Each of the two scripts has it's own jQuery's <code>.ready()</code> defined.</p>
<p><strong>general.js:</strong></p>
<pre><code>jQuery(function() {
var foo;
$('#btn').click(function() {alert(foo())});
}
</code></pre>
<p><strong>specific.js:</strong></p>
<pre><code>jQuery(function() {
foo = function() {alert("hello")};
$('#btn').click(function() {foo()});
}
</code></pre>
<p>where <code>#btn</code> is a button element.</p>
<p>When I clicked on <code>#btn</code> I was expecting to see "hello" dialog, but instead, I got <code>Uncaught TypeError: undefined is not a function</code> in chrome developer tools.</p>
<p>My own understanding is that <code>foo</code> should have been assigned the function already, instead of being undefined, before it's accessed by the <code>click</code> event. Obviously, my understanding is incorrect. Can someone please explain to me why it's behaving the way it is?</p>
|
javascript jquery
|
[3, 5]
|
2,149,026
| 2,149,027
|
Resetting a while loop
|
<p>I have found a confusing thing in a php script I am writing to generate some javascript. Here it is below, slightly simplified.</p>
<p>The second while loop won't run unless I comment out the entire first while loop. Can anyone explain why? Many thanks.</p>
<pre><code><?php
$listid = 2; //DEMO ONLY
$result1 = mysql_query("SELECT words.wid,words.wordmd5,words.word FROM words,instances WHERE words.wid = instances.wid AND instances.lid = \"$listid\"");
$result1copy = $result1;
$count1 = 1;
while( $row = mysql_fetch_object( $result1 ) )
{
print "words_left[$count1] = \"".$row->word."\";\n";
//Increment the array counter (starts at 1)
$count1++;
}
?>
//Some javascript
<?php
$count2 = 1;
while( $row = mysql_fetch_object( $result1copy ) )
{
print "
$count2 then $row->wordmd5
";
$count2++;
}
?>
</code></pre>
|
php javascript
|
[2, 3]
|
2,623,915
| 2,623,916
|
Getting the value from usercontrol in javascript on button click
|
<p>I have this following scenario. I have a usercontrol in my page which has a radio button. This control is placed in a page, on click of a button in the page I need to know if the radio button is selected. This is a client event click event of the button as I have to show a confirmation message box i.e. if user clicks yes only then I have to do the remaining operation. Can you guide me what would be the best way to find if the radio button in the userControl is selected.</p>
<p>Thanks</p>
|
javascript asp.net
|
[3, 9]
|
744,193
| 744,194
|
Mobile software development ( iphone/android/ java)
|
<p>I have an interview for Mobile software developer ( java/ J2ME ) at <strong>Sybase</strong>. Can anyone help me out as to what questions can I expect?
The interview will be of 30 minutes. In such a short span what type of questions can be asked. </p>
|
java iphone android
|
[1, 8, 4]
|
2,051,461
| 2,051,462
|
What is the non-jQuery equivalent of '$(document).ready()'?
|
<p>What is the non-jQuery equivalent of <code>$(document).ready()</code>?</p>
|
javascript jquery
|
[3, 5]
|
2,913,686
| 2,913,687
|
How do i read javascript array in c sharp
|
<p>I have created a function in javascript like a class</p>
<pre><code> function myclass
{
this.Id=null;
this.Name=null;
}
</code></pre>
<p>from other function i am returning a list(Array in javascript) of myclass </p>
<pre><code>function ReturnList
{
var lst=[];
var objmyclass=new myclass();
objmyclass.Id=1;
objmyclass.Name="abc";
var objmyclass1=new myclass();
objmyclass1.Id=1;
objmyclass1.Name="abc";
lst.push(objmyclass);
lst.push(objmyclass1);
PageMethods.GetListData(lst,onsuccess);
return false;
}
</code></pre>
<p>How do i read the lst in my webmethod</p>
<pre><code>[WebMethod()]
public static bool GetListData(datatype lst)
{
//How to read each item from lst
}
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,142,081
| 3,142,082
|
jQuery .index() strangeness
|
<p>I'm by no means a jQuery (or JavaScript) expert so forgive me if I'm misunderstanding or overlooking something. I have the following HTML:</p>
<pre><code><html>
<body>
<div class="ted">Ted</div>
<div class="ted">Ted</div>
<div class="tim">Tim</div>
<div class="ted">Ted</div>
<div class="tim">Tim</div>
</body>
</html>
</code></pre>
<p>And the following JS:</p>
<pre><code>$('.ted').click(function() {
alert($(this).index());
});
</code></pre>
<p>When I click a div with the class <code>'.ted'</code> the alert should show the index of that <code>div</code>.</p>
<p>Clicking the first div alerts '0' (expected), the second div alerts '1' (expected). However, clicking the last <code>'.ted'</code> <code>div</code> (the fourth in the list) alerts '3' - why is this not giving an index of 2? (as JS arrays are 0 based) and this is the <strong>third</strong> <code>'.ted'</code> <code>div</code>?</p>
<p>It's as if <code>$('.ted')</code> is actually bringing back all the divs in the list?</p>
<p>Example here: <a href="http://jsfiddle.net/nha2f/6/" rel="nofollow">http://jsfiddle.net/nha2f/6/</a></p>
|
javascript jquery
|
[3, 5]
|
1,633,190
| 1,633,191
|
How do I make the $(window).height() doesn't go below what it started at?
|
<p>I am trying to console.log the window height with this code here:</p>
<pre><code>var $win = $(window);
$win.on('resize', update);
function update () {
console.log($win.height());
}
</code></pre>
<p>It sort of works, but it wont go below the height of my largest element. How can I make it so it will?</p>
|
javascript jquery
|
[3, 5]
|
1,501,702
| 1,501,703
|
Extend Session Time On Button Click Event Server Side
|
<p>Is there a way to extend the session of a user the moment they click a button that fires up code behind logic. Example I need to 100 people to a gridview and each time I add a person I want the session to be reset to 30 minutes.</p>
<p>I need to set the timeout on a certain page not the whole site. When a user makes a button click fire the timeout resets. So if the timeout on the page is 30 min, you wait 29 minutes then click the button the timeout is 30 min again.</p>
|
c# asp.net
|
[0, 9]
|
1,986,250
| 1,986,251
|
Using a get variable while staying on the same page?
|
<p>I was wondering if there is a way to use a GET variable while staying on the same page. </p>
<p>I have some php/mysql script that I would like to execute if a particular link is clicked, using a GET variable. However, once the link is clicked, I don't want anything on the page to change, I just want to the script to run behind the scenes.</p>
<p>Right now, when A user is on the search page and adds an item to their favorites all search results disappear, and b/c I am resubmitting </p>
<p>NOTE: The add to favorites link below, links to same page that the user will be on when clicking it.</p>
<pre><code>if(isset($_SESSION['username'])){
echo '<div id="favbutton"><a href="search.php?id='.$id.'"><img src="./image/staricon.png"/>Add to favorites</a></div>';
}
</code></pre>
<p>thank you</p>
|
php jquery
|
[2, 5]
|
1,560,024
| 1,560,025
|
How to create Facebook chat like sound?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/879152/how-do-i-make-javascript-beep">How do I make Javascript beep?</a> </p>
</blockquote>
<p>I'm using PHP for my new project. My client needs a beep sound when someone enters data in a mysql table.</p>
<p>Is it possible to create a sound/beep in PHP or Javascript?</p>
|
php javascript
|
[2, 3]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.