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 |
---|---|---|---|---|---|
1,161,922 | 1,161,923 | Displaying real time | <p>I am currently displaying date/time on my webpage using the date function PHP provides.
However, using this function, the date/time will only be updated when reloading the page. I wish to have the date/time updated every second instead.</p>
<p>I assume I have to use either javascript or jQuery/ajax for this, however I have no clue on how to do this. I was hoping anyone here could give me some advice.</p>
<p>Thanks in advance.</p>
| php javascript jquery | [2, 3, 5] |
4,619,251 | 4,619,252 | Java: updated class files not used | <p>I'm developing a Java program through Eclipse locally, and debugging on a remote machine. Whenever I make a change to my program, I copy the corresponding class file to the bin directory on the remote machine. I run my program (a simulator) through a python script via the OS.system command.</p>
<p>The problem is that my program <em>sometimes</em> does not use the updated class files after they have been moved over. </p>
<p>The problem persists even if I log out and back into the remote machine. What's really strange is that, as a test, I deleted the bin directory entirely on the remote machine, and was still able to run my program. </p>
<p>Can anyone explain this? </p>
| java python | [1, 7] |
3,606,744 | 3,606,745 | jQuery Swap Image on Click and if/else | <p>Im stuck, Im setting a variable when someone clicks, then testing with if to see if the variable exists and doing something else. Its a simple script which Im probably overthinking, would love someone's thoughts.</p>
<pre><code> $('.view-alternatives-btn').live('click', function() {
//$("#nc-alternate-wines").scrollTo();
//$('.nc-remove').toggle();
var showBtn = null;
if (showBtn == null) {
$('.view-alternatives-btn img').attr("src","../images/wsj_hide_alternatives_btn.gif");
$('#nc-alternate-wines').show();
showBtn = 1;
console.log(showBtn);
}
else if (showBtn == 1) {
$('.view-alternatives-btn img').attr("src","../images/wsj_view_alternatives_btn.gif");
$('#nc-alternate-wines').hide();
console.log("this " + showBtn);
}
return false;
});
</code></pre>
| javascript jquery | [3, 5] |
4,535,987 | 4,535,988 | Why is this valid code? | <p><a href="http://jsbin.com/idazeg/edit#javascript,html" rel="nofollow">http://jsbin.com/idazeg/edit#javascript,html</a></p>
<p>Can someone tell me how and <strong>why</strong> this is working?</p>
<pre><code>$('#pp').click (function () {
ppp:doSomething('2'); //<=== ppp , how is JS **eating** this ?
});
</code></pre>
| javascript jquery | [3, 5] |
505,252 | 505,253 | javascript module that is using jquery loaded before jquery | <p>I have javascript module which should only be interpreted only after jquery is loaded</p>
<p>example</p>
<pre><code><script src=myApp.js></script>
<script src=jQuery.js></script>
</code></pre>
<ul>
<li>myApp.js is using jQuery. </li>
<li>script include sequence has to be like provided before</li>
</ul>
<p>How to do this? As i can't flip them and do </p>
<pre><code><script src=jQuery.js></script>
<script src=myApp.js></script>
</code></pre>
<p>The reason for this is that I have a layout.html that has some scripts which uses jquery,
but each other view which inherits layout.html (etc. index.html) is using different version of jquery, so i want jquery to be unique per page.</p>
| javascript jquery | [3, 5] |
402,809 | 402,810 | Rotate images, if last image then hide | <p>I have 3 images that I want to rotate when a button is clicked.</p>
<p>image1, image2, image3.</p>
<p>If the image is at image1, then when clicked it should show image2 (and so on, in order of image1, .., image3).</p>
<p>When I am at image3, it should then hide the image, i.e. don't display it.</p>
<p>I need some help with the javascript function to do this, I already have the code for the button click event.</p>
<p>I am passing the toggle() function the jquery object <code>$('myImageID')</code>;</p>
<pre><code>$(document).ready(
function()
{
$('#button1').click( function() { toggleSector( $('#sector1') ) } ;
}
);
function toggleSector(o)
{
// help!
}
<div id="sector1"></div>
<input type="button" id="button1" value="Sector 1" />
</code></pre>
<p><b>Update</b></p>
<p>I have to somehow find the name of the current background image set to the
<code><div></code> where my image is.</p>
<p>Is there a background property to get the image name currently being displayed?</p>
| javascript jquery | [3, 5] |
224,383 | 224,384 | Get image from JSON String in JAVA | <p>I am sending JSON string to Java from php, that consists of some string type data and encoded image. In jJva inputStream is converted to BufferedReader and to String. Now string looks like <code>{"name": "xxx", "image":agrewfefe...}</code>
Is there any possible way to decode the string that represents image to bitmap or I have to send image in other stream?</p>
| java android | [1, 4] |
5,684,956 | 5,684,957 | jQuery conditional select problems | <p>I have some problems with part of jQuery code in my form. Everything works fine except one part of code:</p>
<pre><code>if ( $("#finish_day").val() > 4 ) {
$('#start').attr('', '');
} else {
$('#start, #end').not(this)
.children('option[value=' + this.value + ']')
.attr('selected', '')
.siblings().attr('disabled', true);
}
</code></pre>
<p>Whole example you can test here: <a href="http://jsfiddle.net/amarcinkowski/k7kKV/3/" rel="nofollow">http://jsfiddle.net/amarcinkowski/k7kKV/3/</a></p>
<p>Here is the thing:</p>
<p>First problem:
When I change the "Hour" field it automatically change me the "City" field, and after then I can't change the City. When i cut the above code the City field works fine.</p>
<p>Second problem:
I need to have all of "City1" options always active (now when I change the "Hour" I have one active option, and other disabled). The code above should work like this: When the value of "total day" field is less than (for example) 3 the value in "City2" field is the same as in "City1" field (City1: Katowice = City2: Katowice), and other options in City2 field are disabled.</p>
<p>I will be grateful for any help.</p>
| javascript jquery | [3, 5] |
4,894,247 | 4,894,248 | Continuous movement when a key is held down | <p>Is it possible in jQuery to have an element continuously move when the key is held down?</p>
<p>I've tried a few ways but they always have a break in between animation calls. The code I currently have: </p>
<pre><code>$(document).keydown(function (e) {
if (e.which == 37) {
$('#you').stop().animate({
left: '-=16px'
}, 10);
}
});
$(document).keyup(function (e) {
$('#you').stop();
});
</code></pre>
| javascript jquery | [3, 5] |
4,250,800 | 4,250,801 | Best way to create dropdownlists in a loop | <p>I have a two db tables one is the table of categories the second is the table of category values.</p>
<p>For each category I need to create a dropdownlist with values of the second table.
The second step is to put these dynamically created dropdownlists in a component similar to a formview to update, delete update and get the SelectedValue from a GridView filled with a third db table.</p>
<p>What is the best way to do this?</p>
| c# asp.net | [0, 9] |
3,924,120 | 3,924,121 | How do I handle this error : No overload for 'SQLDisplay_Date_records' matches delegate 'System.EventHandler' | <p>So I basically have two textboxes in the aspx file which get populated by dates (using the jquery datepicker) as given below </p>
<pre><code>Start Date: <asp:TextBox ID="TxtDatepicker_start" runat="server" Width = 125px >
</asp:TextBox>
&nbsp;&nbsp;End Date: <asp:TextBox ID="TxtDatepicker_end" runat="server" Width = 125px >
</asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="Button_daterecords" runat="server" Text="Show records" OnClick ="SQLDisplay_Date_records" /><br />
</code></pre>
<p>However when I try to determine what has been stored in the text boxes for further processing in the code behind using this function</p>
<pre><code>protected void SQLDisplay_Date_records()
{
string date1 = TxtDatepicker_end.Text;
string date2 = TxtDatepicker_end.Text;
}
</code></pre>
<p>I am getting this error </p>
<pre><code>No overload for 'SQLDisplay_Date_records' matches delegate 'System.EventHandler'
</code></pre>
<p>Can someone explain this to me ,I apologize for the naive question but I am still making my way around with ASP.NET and C#</p>
| c# jquery asp.net | [0, 5, 9] |
5,050,079 | 5,050,080 | unexpected "focusout" event trigering | <p>I try to show text box (#dimVal), when div(#CanvasArea) is clicked. And I want to make this text box disappear, when it loses its focus.</p>
<pre><code> <head>
<script src="jquery-1.5.1.js" type="text/javascript"></script>
</head>
<body>
<div id = "CanvasArea", style = "width:50%; height:600px; border:2px; border-color:orange; border-style:solid; float:left">
<h3>Click Me</h3>
</div>
<input type="text", id="dimVal", value="111", style="position:absolute; display:none; left:300px; top:300px" />
<script type="text/javascript">
onMouseDown = function(e){
$("#dimVal").show();
$("#dimVal").focus();
$("#dimVal").focusout(onLostFocus);
}
onLostFocus = function(e){
$("#dimVal").hide();
$("#dimVal").unbind("focusout");
}
$("#CanvasArea").bind("mousedown", onMouseDown);
</script>
</body>
</code></pre>
<p>I wonder why "focusout" event fires right after mouseclick?</p>
| javascript jquery | [3, 5] |
4,538,998 | 4,538,999 | Put element under focus in jquery | <p>I want to put element under <code>focus</code> just after <code>append</code> it, means something similar to :</p>
<pre><code>$("id").append($("elementid")).focus(); // not working
</code></pre>
| javascript jquery | [3, 5] |
5,774,627 | 5,774,628 | Why can't I call a form content? | <p>I have this simple code:</p>
<pre><code><html>
<body>
<form name="f1">
<asp:Label name="lbl" runat="server" Text="Label" onclick="lblClick()"></asp:Label>
</form>
<script type="text/javascript">
function lblClick(){
document.f1.lbl.text="new text";}
</script>
</body>
</html>
</code></pre>
<p>It doesn't work, it gives me:
Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object ... ,
I can't even change the label text ....why?!!!</p>
| asp.net javascript | [9, 3] |
3,812,051 | 3,812,052 | Validation on button | <p>I'm doing validation first on an email(mandatory and correct format) and then on a file upload(either blank or correct format) on the button submit.<br>
Here the email is validating well but in file upload if it is blank it also shows an error which is not needed.</p>
<p>Code:</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$("#button").click(function () {
var email = $("#person_email").val();
var img = $("#person_avatar").val();
if (email == null || email == "" || !email.match(/^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$/))
{
$("#valid").show();
return false;
} else if (!img == "" || !img.match(/(\.bmp|\.png|\.jpg|\.jpeg|\.gif)$/))
{
$("#valid_1").show();
return false;
} else {
return true;
}
});
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
533,506 | 533,507 | Device to Device Communication in Android | <p>I have been tasked for university to program a mobile phone application. I have oppted for two mobiles to communicate with each other via message.</p>
<p>I would like the application to connect the mobile to the internet to send the message and the other mobile to connect to the internet to recieve the message.</p>
<p>I am using Eclipse IDE.</p>
<p>Does anyone have any ideas for good examples of similar application source code so I can develop my application using appropriate protocols.</p>
<p>I would appreciate any advice and I am certainly not looking for someone to give me "the answer" I am really looking forward to getting stuck in. Though I have never touched an android phone let alone programed one. So some advice would be amazing!!</p>
<p>Thanks</p>
<p>Si</p>
| java android | [1, 4] |
2,318,564 | 2,318,565 | Does anyone know of source code for a web based study group? | <p>I'm looking for source code for a web based study group. I'd prefer something in Python or C#. I have searched google but I'm finding mostly existing study groups on particular topics and not software to host an online study group. </p>
<p>Can anyone help out?</p>
<p><hr /></p>
<p>Edit: Ah, I was unfamiliar with the buzzwords "Learning Management System" or "Virtual Learning Environment". Moodle is indeed the type of thing I was looking for, even if it is written in the horrible php "language".</p>
<p>Thanks.</p>
| c# python | [0, 7] |
3,470,639 | 3,470,640 | Javascript and css file search path while running python SimpleHTTPServer | <p>I am running a python SimpleHTTPServer and serving a html file. That html file includes couple of javascript files. When the html file is served by the server I get the following errors.</p>
<pre><code>1.0.0.127.in-addr.arpa - - [15/Jun/2012 13:42:54] code 404, message File not found
1.0.0.127.in-addr.arpa - - [15/Jun/2012 13:42:54] "GET /lib/jquery-ui/jquery-ui.min.js
</code></pre>
<p>Html file contents (only relevant lines shown):</p>
<pre><code><script type="text/javascript" src="../../lib/jquery-ui/jquery-ui.min.js"></script>
</code></pre>
<p>Python command used to run the server. It is run in the directory where index.html is present</p>
<pre><code>python -m SimpleHTTPServer 8000
</code></pre>
<p>I have the files jquery-ui-min.js in my local filesystem. But the search somehow is stripping the ../.. and searching in /lib/jquery-ui/jquery-ui.min.js </p>
| javascript python | [3, 7] |
3,078,769 | 3,078,770 | Table generation from Code Behind | <p>I know what my fault is, but not sure how to resolve. I am trying to generate an asp:table from Code Behind.</p>
<p>The table should be 3 cells wide... I'll work on the row limit later.</p>
<p>Here's my code:</p>
<pre><code>GallaryImage g = new GallaryImage();
var images = g.GetAll();
photos.Style.Add("width","100%");
photos.Style.Add("border-style","none");
TableRow tr = new TableRow();
TableCell tc = new TableCell();
tr.Cells.Add(tc);
tr.Cells.Add(tc);
tr.Cells.Add(tc);
int cntr = 0;
TableRow row = new TableRow();
foreach (var image in images)
{
cntr++;
TableCell cell = new TableCell();
Image i = new Image();
i.ImageUrl = image.fullThumbPath;
cell.Controls.Add(i);
row.Cells.Add(cell);
if(cntr%3==0)
{
photos.Rows.Add(row);
row.Cells.Clear();
}
}
if(row.Cells.Count > 0)
photos.Rows.Add(row);
}
</code></pre>
<p>My problem is that I need to create a new row in the Foreach, only when I need the new row... i.e, when we have added 3 cells.</p>
<p>I thought I could add the row to the table, and then clear the row to start a new row - but that's not working, as I just keep clearing the same row object... and therefore, never add multiple rows.</p>
<p>Can someone assist with my logic here?</p>
| c# asp.net | [0, 9] |
269,555 | 269,556 | explode new line in javascript | <p>How do I convert the php code below into javascript? I google it and found something to do with st.replace(/,/g,"\n") but how to apply it to the variable? I have low knowledge about javascript and trying to learn it.</p>
<pre><code>$items = explode("\n", $model);
</code></pre>
| php javascript | [2, 3] |
3,051,218 | 3,051,219 | Display different aspx file in a popup in asp | <p>I am currently developing an ASP.net application. I am generating a table (standard HTML table not GridView) and populating it with data from a MySQL Database. One column of the table has hyperlinks which should link to a dynamic aspx web page that will display certain information based on the database.</p>
<p>When the user clicks on the hyperlink I want to display a pop up that hovers over the top of the original content, not opening a new browser window just displaying like a popup window which will darken the contents of the background content. </p>
<p>I have tried to google search this but did not find anything.</p>
<p>Thanks for any help you can provide. </p>
| c# asp.net | [0, 9] |
4,160 | 4,161 | Calculate total after retriveing tax rate from JSON | <p>I have 1 select, 2 text inputs & some JSON data in a form:</p>
<ul>
<li><strong>select input</strong>: List of Suppliers</li>
<li><strong>text input 1</strong>: Net Amount</li>
<li><strong>text input 2</strong>: Gross Amount</li>
<li><strong>JSON Data</strong>:contains the rates of various suppliers as <code>JSON</code> in <code>supplier_tax_rates</code></li>
</ul>
<p>I am calculating Gross Amount something like this(pseudo code):</p>
<pre><code>grossAmount = NetAmount + ((currently_selected_supplier.tax_percentage_charged / 100) * netAmount)
</code></pre>
<p>Here is the complete code:
<a href="http://jsfiddle.net/A9vmg/17/" rel="nofollow">Calculate total after retriveing tax rate from JSON</a></p>
<p>Now, this should work but it doesn't. I get NaN(not a number), means something is wrong. But I have trouble find where. </p>
<ul>
<li><a href="http://jsfiddle.net/A9vmg/17/" rel="nofollow"><strong>JSfiddle</strong></a></li>
</ul>
| javascript jquery | [3, 5] |
4,880,077 | 4,880,078 | JavaScript and PHP in code - whats the difference? | <p>I have this code in my JavaScript part:</p>
<pre><code>var opConfig = new Product.Options(<?php echo $this->getJsonConfig(); ?>);
</code></pre>
<p>The PHP call returns me some string, to make it easy, lets say the string is <em>abcd</em>. So this code results in:</p>
<pre><code>var opConfig = new Product.Options(abcd);
</code></pre>
<p>Now, some lines later, I have this code:</p>
<pre><code>this.opConfig = new Product.Options(opconfig);
</code></pre>
<p>The <code>opconfig</code> variable has the same string <code>abcd</code>, but the results are different, <code>this.opConfig</code> does not look like it looked before. So is there a difference in how I use the string as param? Something I am missing? For me, it should always be the same call, namely:</p>
<pre><code>new Product.Options(abcd)
</code></pre>
<p>Ideas?</p>
<p><strong>Addition:</strong> The full call in the JS code looks like that:</p>
<pre><code>var opConfig = new Product.Options({"16":{"26":{"price":5,"oldPrice":5,"priceValue":"5.0000","type":"fixed","excludeTax":5,"includeTax":5},"28":{"price":8,"oldPrice":8,"priceValue":"8.0000","type":"fixed","excludeTax":8,"includeTax":8},"27":{"price":10,"oldPrice":10,"priceValue":"10.0000","type":"fixed","excludeTax":10,"includeTax":10}},"14":{"price":0,"oldPrice":0,"priceValue":"0.0000","type":"fixed","excludeTax":0,"includeTax":0},"15":{"price":0,"oldPrice":0,"priceValue":"0.0000","type":"fixed","excludeTax":0,"includeTax":0}});
</code></pre>
<p>The param reaches the called function as object, no idea why. Calling it the other way, the same string seems to reach it as string. Can anybody help?</p>
| php javascript | [2, 3] |
694,952 | 694,953 | Sending json data using jquery | <p>I have a small doubt. I am trying to send json data to my back end page like this. But i am getting error. where in only $fb_list1 is json data. So how do i send it from here.</p>
<pre><code>$('.fresh_start')
.html("<div class='response1'><img src='/images/preloader.gif' alt='Loading.....'></img></div>")
.load('abc.php',{product:'lcd',type:'product_display',fb_list:"<?php echo $fb_list1 ?>"});
</code></pre>
| php jquery | [2, 5] |
5,292,849 | 5,292,850 | How to convert JavaScript `for` loop to Python? | <p>I am new to Python and want convert this small JavaScript code to Python. How can I do that?</p>
<pre><code>for (var y = 0; y < 128; y += 1024) {
for (var x = 0; x < 64; x += 1024) {
// skipped
}
}
</code></pre>
<p>I searched a lot in Google, but found nothing.</p>
| javascript python | [3, 7] |
3,562,472 | 3,562,473 | jQuery 'click' automatically fires 'live' | <p>Here is a simple piece of code:</p>
<p>HTML:</p>
<pre><code><div id="close">Click me</div>
</code></pre>
<p>JS Code:</p>
<pre><code>$("#close").click(function(){
alert("1");
$(this).attr('id','expand');
});
$("#expand").live('click', function(){
alert("2");
$(this).attr('id','close');
});
</code></pre>
<p>Problem: When I click on "close" it automatically calls live() too. See this in jsfiddle: <a href="http://jsfiddle.net/uFJkg/">http://jsfiddle.net/uFJkg/</a></p>
<p>Is it because I am changing the same element's id from "close" to "expand"? How do I fix this problem?</p>
<p>I have tried:</p>
<pre><code> $("#expand").die().live('click', function()
</code></pre>
<p>but it didn't work. I tried event.stopPropagation() but that didn't help too. I tried having a separate div with id "expand" and hide it on document.ready but for some reason it is not working too.</p>
<p>Then I have tried since I read that live() has been deprecated in jQuery 1.7+:</p>
<pre><code>$("#expand").on('click', function(){
</code></pre>
<p>and that is not working too.</p>
<p>Any thoughts? I think a fresh set of eyes will be able to spot what I am missing.</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
2,322,087 | 2,322,088 | ASP:Login - call Javascript function on wrong password/username | <p>I am using the ASP.net <code>ASP:Login</code>, and i want to call a javascript function if login fails.</p>
<p>How can I accomplish this? </p>
| c# asp.net | [0, 9] |
979,234 | 979,235 | jQuery not detecting enter key pressed in textarea | <p>My setup: jQuery 1.6.2</p>
<p>I have this HTML</p>
<pre><code><textarea class="comment_box"> Write a comment...</textarea>
</code></pre>
<p>And the following Javascript</p>
<pre><code><script>
$('.comment_box').keydown(function (e){
if(e.keyCode == 13){
alert('you pressed enter ^_^');
}
})
</script>
</code></pre>
<p>When I press the enter key in the textarea, nothing triggers</p>
<p><strong>EDIT</strong> Oops, cut and paste error, I do have <code>$</code> in my code and it still doesn't work, must be something else going on.</p>
<p>My bad, it is a user operator error, it does work. Sorry for the confusion.</p>
| javascript jquery | [3, 5] |
3,401,125 | 3,401,126 | How to get <td> value in textbox | <p>I've done some code in html and in JavaScript ... My query is when I click on <code><td></code>, whatever the value associated with it, has to be displayed in the corresponding text box ...
In front of <code><td></code> I've taken the textbox ... for an example I've taken 3 <code><td></code> and 3 textboxes </p>
<pre><code> <script type="text/javascript">
function click3(x) {
x = document.getElementById("name").innerHTML
var a = document.getElementById("txt");
a.value = x;
}
function click1(y) {
y = document.getElementById("addr").innerHTML
var b = document.getElementById("txt1");
b.value = y;
}
function click2(z) {
z = document.getElementById("email").innerHTML
var c = document.getElementById("txt2");
c.value = z;
}
</script>
</code></pre>
<p>this is my JavaScript code , I know this is not an adequate way to deal such problem, since its giving static way to deal with this problem
does anyone have a better solution for this problem ??
In JavaScript/jQuery </p>
| javascript jquery | [3, 5] |
3,763,446 | 3,763,447 | python import as equivalent in Java? | <p>I have a bunch of idl files that automatically create four packages, with a lot of java files into it.
I need to insert those java files in a com.bla. package architecture. </p>
<p>Thing is in my generated files I have imports UCO.State for example, that do not fit with my new package architecture. </p>
<p>So question is : Is there a java equivalent to 'import com.bla as bla' ?</p>
<p>The only other option I see is to import the UCO package and rename all UCO.State and other directly by State.
But that would mean refactoring hundreds of files o_O.</p>
<p>Any idea ?
Thanks !</p>
| java python | [1, 7] |
4,751,710 | 4,751,711 | Wait till image is loaded and resized before triggering animation? | <pre><code>$("#body-background").ezBgResize();
$("#nav").animate({
left: "-725px"
}, 800, "easeOutCirc" );
$("#page .home").animate({
right: "0px"
}, 800, "easeOutCirc" );
</code></pre>
<p>This is essentially my code. </p>
<p>The first line uses jQuery Easy Background Resize: (ref: <a href="http://johnpatrickgiven.com/jquery/background-resize/" rel="nofollow">http://johnpatrickgiven.com/jquery/background-resize/</a>)</p>
<p>In the HTML, you put something like this:</p>
<pre><code><!-- This gets positioned absolutely so place it anywhere. -->
<div id="body-background"><img src="image/bg.jpg" alt="Bg"></div>
</code></pre>
<p>The problem I'm having is that the image takes so long to load the first time, the animations don't fire...and skip to the end. Anyway I can delay the animation till after the resize is complete?</p>
<p>Thanks in advance.</p>
<p>Edit: The site I'm working on: <a href="http://jsc.yondershorecreative.com/" rel="nofollow">http://jsc.yondershorecreative.com/</a></p>
| javascript jquery | [3, 5] |
2,075,655 | 2,075,656 | What are some open source web portal applications in C# and ASP.NET? | <p>What are some open source web portal applications, preferably written in C# and ASP.NET, that are suitable for internal use in IT organisations?</p>
| c# asp.net | [0, 9] |
4,590,047 | 4,590,048 | Android connection in piconet | <p>Whether it is possible to stream audio signal over 7 slave device through 1 master device at same time in Android A2DP for good audio signal....If it is possible then kindly give link for source information and code to connect piconet architecture......</p>
| javascript android | [3, 4] |
4,244,851 | 4,244,852 | Angry Birds like scrolling menu | <p>When you start Angry Birds and hit play you are shown a horizontally scrolling menu with a centered line of images that once clicked on you can start the game and what not. I was wondering how to make a menu simular to this in that it scrolls sideways (horizontally) and shows tappable images? Thanks in advance!</p>
| java android | [1, 4] |
1,226,533 | 1,226,534 | Jquery Prepend: Cannot call method 'createDocumentFragment' of null | <p>During page startup I'm trying to add an element to the DOM.</p>
<p>I have the following code:</p>
<pre><code>$(document).ready(function () {
$(document).prepend("<div id=new_div style=z-index:1;></div>");
});
</code></pre>
<p>I've tested this on FF21, Chrome27 and IE10. They all return the error mentioned in the title (exact wording is from the Chrome debugger).</p>
<p>Debugging on jquery-1.10.0.js, I tracked down the problem to line 5998 where</p>
<pre><code>safeFrag = document.createDocumentFragment()
</code></pre>
<p>Apparently document is null. Going up the stack trace to <code>domManip</code> on line 6249 the object is passed as <code>this[ 0 ].ownerDocument</code>, which is null.</p>
<p>I've stripped the javascript on the page to just loading jQuery and running this command, and the issue persists.</p>
<p>See <a href="http://jsfiddle.net/jnfsmile/LWd6S/" rel="nofollow">this jsFiddle</a>, the alert doesn't pop, meaning the javascript engine got stuck on the line before.</p>
<p>Help appreciated.</p>
| javascript jquery | [3, 5] |
4,973,587 | 4,973,588 | Get escaped html from td and put it into input as value | <p>I have html</p>
<pre><code><table>
<tr><td id="cell">&lt;a href=&quot;&quot;&gt;Google.com&lt;/a&gt;</td></tr>
</table>
<div id="to"></div>
</code></pre>
<p>And I have javascript</p>
<pre><code>$(document).ready(function() {
var html = '<input type="text" value="'+$("#cell").html()+'" />'
$("#to").append(html);
});
</code></pre>
<p>I don't know why, but when executing this code I'm getting only <code><a href=</code> in input. In firebug's inspector input html appears as <code><input type="text" a&gt;="" &gt;google.com&lt;="" value="&lt;a href=" ></code> As you can see, <code>$quot;</code> are replaced with <code>"</code> - this is the problem.</p>
<p>I've tried using <code>.text()</code> instead of <code>.html()</code> - almost the same situation.</p>
<p>What is my mistake?</p>
<p>Thank you.</p>
| javascript jquery | [3, 5] |
1,217,720 | 1,217,721 | How to focus in div tag in javascript | <p>I have created a tabs using div tag in javascript. I have asp.net button on each tab. whenever I clicked on button the focus is set to first tab.</p>
<p>I am using following code in page load event.</p>
<pre><code>HtmlGenericControl content_1 = new HtmlGenericControl("content_1");
HtmlGenericControl content_2 = new HtmlGenericControl("content_2");
HtmlGenericControl content_3 = new HtmlGenericControl("content_3");
HtmlGenericControl content_4 = new HtmlGenericControl("content_4");
HtmlGenericControl content_5 = new HtmlGenericControl("content_5");
HtmlGenericControl selectedPage = new HtmlGenericControl(pageName);
content_1.Style["display"] = "none";
content_2.Style["display"] = "none";
content_3.Style["display"] = "none";
content_4.Style["display"] = "none";
content_5.Style["display"] = "none";
selectedPage.Style["display"] = "block";
selectedPage.Attributes.CssStyle.Add("class", "active");
</code></pre>
| javascript asp.net | [3, 9] |
3,226,133 | 3,226,134 | How to get the selected value and key from an html dropdown list in javascript on php | <pre><code> <select id="facetList" style="width:120px;" class="text ui-widget-content ui-corner-all">
<?php
foreach($claAddArray as $k => $v)
{
echo "<option value=\"$k\">$v</option>";
}
?>
</select>
$("#btnSubmit").click(function() {
var $fId = ?????????????????
});
</code></pre>
| php javascript jquery | [2, 3, 5] |
1,138,158 | 1,138,159 | Why is XML used for the creation of UI layouts in Android? | <p>I would like to know why we use <strong>XML for the creating user interface layouts in Android</strong>. I know that it decouples the buisness logic from the design but what is the significance of the XML other than that?</p>
<p>Also I would like to know the <strong>significance of autogenerated <code>R.java</code> file</strong> in this. All I know that it is generated according to the changes in the resources and that it helps us to access the widgets and resources through their ids.</p>
<p>It would be great if someone could give a clear idea on these two aspects.</p>
<p>P.S.: I haven't put these questions as two different ones because I believe that the answers are interelated.</p>
<p><strong>Edit</strong>:(More Info)
Unlike what everyone said about the xml being easy and efficient.Here is what i read from Hello Android from Ed Brunnette which made sense.</p>
<p>Android is optimized for mobile devices with limited memory and horsepower, so you may find it strange that it uses XML so pervasively. <strong>After all, XML is a verbose, human-readable format not known for its brevity or efficiency, right?</strong></p>
<p>Although you see XML when writing your program, <strong>the Eclipse plug-in invokes the Android resource compiler, aapt, to preprocess the XML into a compressed binary format.**It is this format, not the original XML text, that is stored on the device</strong></p>
<p>If you know more on this please add on</p>
| java android | [1, 4] |
632,569 | 632,570 | how to iterate over each row whose third cell has a rowspan attribute | <pre><code>for (var i = 0; row = tableAppointment.rows[i]; i++) {
for (var j = 0; col = row.cells[j]; j++) {
//iterate through columns
//columns would be accessed using the "col" variable assigned in the for loop.
}
}
</code></pre>
<p>How to iterate over each row whose third cell has a <code>rowspan</code> attribute.</p>
| javascript jquery | [3, 5] |
5,132,747 | 5,132,748 | how button click event works in combobox? | <p>I am trying to dynamically append options in a combo box.</p>
<p>How does button click event work in a combo box element? I am using change event. But I need button click event in the combo box. How can I 'uniquify' the combo box element in jquery?</p>
| javascript jquery | [3, 5] |
4,083,362 | 4,083,363 | how to get multiple value from one textbox in javasript? | <p>I have created web application and textbox as a textarea.i am using javascript for validation.When i enter value in text box so it should be number not alphabet i have use textmode is multiple line.</p>
<p>My problem is that how i get multiple value from textbox and store in array in javascript and check each value is number or not.I am using the web form.Please help me. </p>
| asp.net javascript | [9, 3] |
3,784,707 | 3,784,708 | Jquery Image Crop to a dynamic shape | <p>I wish to have an interface that can achieve something similar to the screen shot attached.
Is this possible in Javascript - interested to here of Jquery examples.</p>
<p><img src="http://ploader.net/files/a612027c553e7445b8fed99c4891aa11.png" alt="Screenshot"></p>
| javascript jquery | [3, 5] |
2,747,315 | 2,747,316 | Android prevent back stack from being cleared when home button is pushed | <p>My home button is clearing the back stack. So that when the user re-enters the application and pushes the back button (soft or hard) it quits the app instead of returning to the activity at the top of the back stack.</p>
<p>I have alwaysRetainTaskState set to true, and nothing else has been overriden. Why is this happening? How to stop it from being cleared!!</p>
<pre><code>@Override
public boolean onOptionsItemSelected(MenuItem item) {
Intent intent;
switch (item.getItemId()) {
case android.R.id.home:
activity.finish();
return true;
case R.id.menu_paymentLocs:
intent = new Intent(activity, PaymentLocationsPage.class);
intent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
activity.startActivity(intent);
return true;
case R.id.menu_feedback:
intent = new Intent(activity, FeedbackPage.class);
intent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
activity.startActivity(intent);
return true;
case R.id.menu_about:
intent = new Intent(activity, AboutPage.class);
intent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
activity.startActivity(intent);
return true;
case R.id.menu_changeconsumer:
new SelectConsumerDialogFragment().show(getFragmentManager(), "select_consumer");
return true;
case R.id.menu_logout:
intent = new Intent(activity, SplashPage.class);
myMeter.logout();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
activity.startActivity(intent);
return true;
}
return true;
}
</code></pre>
| java android | [1, 4] |
472,262 | 472,263 | Checkbox list checked values | <p>I have a checkbox list with 3 items in it. I would like to get all the checked values of checkbox list into a single string. I tried the following code, but it does not give correct results.
Can anyone help me in this.</p>
<pre><code><asp:checkboxlist id="interestedIN" runat="server" repeatlayout="table"
cellspacing="3" cellpadding="3" Font-Size="12px">
<asp:ListItem id= "social" runat="server" text=" Sociology" Selected="false" />
<asp:ListItem id="zoo" runat="server" text=" Zoology " Selected="false" />
<asp:ListItem id="math" runat="server" text=" mathematics " Selected="false" />
</asp:checkboxlist>
</code></pre>
<p>here is the C# i implemented:</p>
<pre><code>foreach (ListItem li in interestedIN.Items)
{
if (li.Selected)
{
interestIN = interestedIN.SelectedItem.Value + "," + interestIN;
}
}
</code></pre>
<p>Output: If user selects Sociology and Zoology, i would like to have the output as "Sociology, Zoology"
But my above code gives me following result "Sociology, Sociology".</p>
| c# asp.net | [0, 9] |
1,206,879 | 1,206,880 | please explain this jQuery statement | <p>What is this doing exactly?</p>
<pre><code>this.$blah = jQuery("<div id=blahblah1></div>");
</code></pre>
| javascript jquery | [3, 5] |
5,649,337 | 5,649,338 | Android setText with leading zero not showing the zero | <p>An example of what I'm trying to do.</p>
<pre><code>int i = 9;
if (i<10)
i = "0"+v1
</code></pre>
<p>Of course that won't work because int != String, but what would be the best way to do this, to make sure I have a leading zero appear? Convert the int to String?</p>
| java android | [1, 4] |
4,415,541 | 4,415,542 | Converting string into different variables? | <p>I'm working with a function that outputs a string that is always formatted "Month Day, Year".
With this, I'm looking to be able to convert the string into three variables. One for month, one for day, and one for year. The project is jQuery based, so if there is a more elegant solution that way, I would appreciate it.</p>
<p>Update:
Here is some of the code that i'm using. Before today, I wrote a function that used select options to choose the month, date, and year. Now I've changed to a simpler solution that uses a single text input in the format "Month Day, Year".</p>
<p>So now when I submit the form, instead of being able to use</p>
<pre><code>var sm = smonth.value;
var sd = sday.value;
var sy = syear.value;
</code></pre>
<p>I only have one variable as</p>
<pre><code>var sdate = sdate.value;
</code></pre>
<p>And what I'd like to do is be able to convert the sdate value (which is just the Month Day, Year string), back to the sm (Selected Month), sd (Selected Day), and sy (Selected Year) values. </p>
| javascript jquery | [3, 5] |
5,372,292 | 5,372,293 | Can PHP be more like python? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1266911/does-php-have-an-equivalent-to-pythons-list-comprehension-syntax">Does PHP have an equivalent to Python's list comprehension syntax?</a> </p>
</blockquote>
<p>Does PHP have any equivalent of the simple and awesome list comprehension in python? Specifically, can I do <code>a = [x for x in xrange(1,20)]</code> in PHP w/o annoying loops?</p>
| php python | [2, 7] |
3,975,002 | 3,975,003 | jQuery or JS: Select input fields with 2 level brackets? | <p>I have a dynamic form that adds users to the site, made so you can duplicate the fields to add several users on one go.</p>
<p>So, my looks like</p>
<pre><code><input name="user[1][name]" value="" />
<input name="user[1][username]" value="" />
<input name="user[1][password]" value="" />
</code></pre>
<p>And then the number is changed on the duplicated fields, eg:</p>
<pre><code><input name="user[2][name]" value="" />
<input name="user[2][username]" value="" />
<input name="user[2][password]" value="" />
</code></pre>
<p>and so on.</p>
<p>On PHP I can handle each user since it has it's own array.
But I would like to validate, for example, the username on each user via jQuery.</p>
<p>The closest I got to is</p>
<pre><code>$(this).find('input[name="user[][username]"]').each(function() {
</code></pre>
<p>But for it to work I need to explicitly write the number on the first [], eg:</p>
<pre><code>$(this).find('input[name="user[1][username]"]').each(function() {
</code></pre>
<p>Is there a way to select ALL of them? I tried putting * and * between the [] but it didn't work.</p>
<p>Thanks for your help!</p>
| javascript jquery | [3, 5] |
6,002,049 | 6,002,050 | What is the purpose/benefit of using ignored parameters in a JavaScript function? | <p>Just so there is no misunderstanding, this question is not about allowing for optional parameters in a JS function. </p>
<p>My question is motiviated by the jQuery <code>parseXML</code> function, which is defined in <code>jQuery.js</code> as follows:</p>
<pre><code>// Cross-browser xml parsing
// (xml & tmp used internally)
parseXML: function( data, xml, tmp ) {
...
}
</code></pre>
<p>Within the body of the function, the parameters <code>xml</code> and and <code>tmp</code> are both assigned before they are used. That means they are being used as local variables, so the function could have been defined like this:</p>
<pre><code>parseXML: function(data) {
var xml, tmp;
...
}
</code></pre>
<p>What is the benefit of doing it the first way, other than saving a few characters in the minified version of <code>jQuery.js</code>?</p>
| javascript jquery | [3, 5] |
4,509,009 | 4,509,010 | jQuery index of dom element? | <p>I have...</p>
<pre><code>element = document.elementFromPoint(x, y)
</code></pre>
<p>then I want to do something like...</p>
<pre><code>index = $(element).index()
</code></pre>
<p>The DOM element is a <code>li</code> and I need its position in the list. </p>
<p>Thanks!</p>
<p>EDIT: If what i'm doing is correct then something here is wrong, <a href="http://stackoverflow.com/questions/7814550/touch-events-over-two-divs/7814791">Touch events over two dom elements?</a></p>
<p>Any help is much appreciated.</p>
| javascript jquery | [3, 5] |
2,091,516 | 2,091,517 | How do I use Javascript to get the name of the UserControl it is called from? | <p>I am trying to replace postbacks with javascript client side processing whenever I can in my aspnet c# 3.5 code so as to improve the user experience. I am not using any javascript frameworks. I am using vs2008. </p>
<p>I have a usercontrol .ascx file with a dropdown list and button which is used in three places on my main screen. </p>
<p>I had been doing a postback on OnSelectedIndexChanged for the dropdown list. </p>
<p>I don’t need to postback every time though, so I tried putting in a javascript function in the usercontrol to check the item selected and only do a postback if it starts with ‘-‘. </p>
<p>However the name of the elements I need to $get in my javascript function depend on the name of the usercontrol instance which calls it, and I need to get that name at runtime, for example : uc1_ ddlLocations and uc1_ btnPostBack. </p>
<p>Here is the code: </p>
<pre><code><script type="text/javascript" language="javascript">
function ddlChange(this) {
var loc = $get("GetTheUserControlNameAndInsertHere_ddlLocations");
if (loc.value.substring(0,1)=='-' )
{
var btn = $get("GetTheUserControlNameAndInsertHere_btnPostBack ");
btn.click();
}
</script>
</code></pre>
<p>How do I do this? Can someone suggest a better way to do what I am trying to do?</p>
| asp.net javascript | [9, 3] |
5,617,252 | 5,617,253 | cycle through list, change style every x seconds | <p>I have a simple slideshow (jQuery Cycle) that displays an image every ten seconds (7 total images). In an adjacent div, I have a list with 7 bullet points. What's the easiest way to script a method in which the css/style of the appropriate bullet point changes as its accompanying image. The idea is to have all list items displayed, but 1 highlighted every 10 seconds?</p>
| javascript jquery | [3, 5] |
892,411 | 892,412 | Porting c++ to python code | <p>I want to convert this C++ code to Python v2:</p>
<pre><code>static unsigned char asConvCode[3] = {0xFC, 0xCF, 0xAB};
void asConv(char* str, int size)
{
int i = 0;
for (i = 0; n< size; n++)
{
str[i] ^= asConvCode[n % 3];
}
}
</code></pre>
<p>tried to make like that:</p>
<pre><code>def asConv(self, data):
asConvCode= [0xFC, 0xCF, 0xAB]
for i in range(len(data)):
data[i] ^= asConvCode[i % 3] # Error: Unsupported operand type(s) for ^=: ...
return data
</code></pre>
<p>I will be happy for any hint</p>
| c++ python | [6, 7] |
2,010,739 | 2,010,740 | Object ... has no method 'append' -Need help quick | <p>I am currently attempting to write a function that applies unique ids to list item dynamically by ticking checkboxes, though I have encountered a problem, when appending the unique id to the list item I get the following error message in the console:</p>
<pre><code>Uncaught TypeError: Object SpTU 4, 183:false<br /> has no method 'append'
</code></pre>
<p>Here is the code that is causing the error:</p>
<pre><code>strng += name+":"+val+"<br />";
var i = 1;
strng.append($({ type: "text", id:+i }));
</code></pre>
<p>I need help with this quickly so any help would be greatly appreciated!
Thanks in advance</p>
<p>-------EDIT----------
Here is the whole function so it is easier to understand, I am new to programming to it may be very messy and unproffesional.</p>
<pre><code>var dataToShow = {};
function check(tickbox){
dataToShow[tickbox.value] = tickbox.checked == true;
showDataOnScreen(dataToShow);
function showDataOnScreen(dataToShow){
var $strng = "";
jQuery.each(dataToShow,function(name,val){
$strng += name+":"+val+"<br />";
var i = 1;
$strng.append($({ type: "text", id:+i }));
});
jQuery("#list").html(strng);
</code></pre>
| javascript jquery | [3, 5] |
3,773,761 | 3,773,762 | Wrap all instances of word in tag? | <p>If I have a <code>div</code> containing words, like so:</p>
<pre><code><div class="content">
In condimentum facilisis porta. Sed nec diam eu diam mattis porta viverra.
</div>
</code></pre>
<p>How can I find every instance of a word, say <code>porta</code>, and wrap it with a tag, so that it becomes:</p>
<pre><code><div class="content">
In condimentum facilisis <span class="highlight">porta</span>. Sed nec diam eu diam mattis <span class="highlight">porta</span> viverra.
</div>
</code></pre>
<p>I've looked at various examples, and I think this is along the right lines:</p>
<pre><code>var elem = $(".content");
elem.text(elem.text().replace("porta", "######"));
</code></pre>
<p>But that fails every now and then, and doesn't replace every instance. I also want to stay away from using <code>REGEX</code>, as it's way too cumbersome and shouldn't be used.</p>
| javascript jquery | [3, 5] |
680,293 | 680,294 | Javascript ContextMenu in IE7 | <p>We are using div tag in aspx and javascript functions to show context menu in our web application. In IE6 the sub menus in the context menu are getting displayed at the correct x and y coordinates what we have hard-coded in our application. But in IE7 and IE8, the sub menus are getting overlapped and in some machines the menus are going behind the window. Can any one please tell what is wrong or any other alternatives to display conext menu and submenu?</p>
<pre><code><HTML>
<HEAD>
<TITLE>Nested popup windows</TITLE>
<script>
var firstPopupDiv = null;
var popup = null;
var vpopup = null;
function tag_onclick()
{
var popup = window.createPopup();
var div = popup.document.createElement("DIV");
div.style.backgroundColor = "green";
div.style.width = 200;
div.style.height = 200;
div.onclick = div_onclick;
popup.document.body.appendChild(div);
firstPopupDiv = div;
vpopup = popup.document.parentWindow;
popup.show(30, 30, 200, 200, maindiv);
}
function div_onclick()
{
var fpopup = vpopup.createPopup();
fpopup.document.body.innerHTML = "<div id=\"MarkupSubMenu\" style=\"position:relative\">&nbsp;&nbsp;Markups</div>";
fpopup.document.body.style.backgroundColor = "red";
fpopup.show(230, 30, 200, 200, firstPopupDiv); // Not shown at 230!
}
</script>
</HEAD>
<BODY>
<div id="maindiv" onclick="tag_onclick()">Click me</div>
</BODY>
</HTML>
</code></pre>
| asp.net javascript | [9, 3] |
649,038 | 649,039 | DecodeStream throwing null while storing in bitmap | <p>This is my code... I am getting exception NULL at <code>imageBitmap = BitmapFactory.decodeStream(is2,null, options);</code></p>
<p>First time it can decode but why now, decodeStream throwing null ?</p>
<pre><code> public void showImageThumb(FileInputStream is)
{
final int IMAGE_MAX_SIZE = 100;
FileInputStream is2 = is;
BitmapFactory.Options options=new BitmapFactory.Options();
options.inSampleSize = 4;
Bitmap imageBitmap = BitmapFactory.decodeStream(is,null, options);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int height = options.outHeight;
int width = options.outWidth;
int scale = 1;
if ( height > IMAGE_MAX_SIZE || width > IMAGE_MAX_SIZE)
{
scale = (int)Math.pow(2, (int) Math.round(Math.log(IMAGE_MAX_SIZE / (double) Math.max(options.outHeight, options.outWidth)) / Math.log(0.5)));
}
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
options = new BitmapFactory.Options();
options.inSampleSize = scale*2;
imageBitmap = BitmapFactory.decodeStream(is2,null, options);
height = options.outHeight;
width = options.outWidth;
imageBitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos); //ERROR HERE
imageSelectedThumb = baos.toByteArray();
</code></pre>
| java android | [1, 4] |
1,713,914 | 1,713,915 | allowing to update gridview depending on user authentication asp.net | <p>i have a web app in asp.net running on windows authentication</p>
<p>i want only a specific user to be able to update, while the other users will only be able to view.</p>
<p>how do customize the gridview so that only a specific user has the option to update?</p>
| c# asp.net | [0, 9] |
749,253 | 749,254 | Making sure my sliding panel remains centered on window resize? | <p>I have created a sliding panel that should appear in the center of any sized window, my problem however is that I have added window.resize around my css calculations which doesnt seem to work, when the page is resized then the window crashes?</p>
<p>My code is as follows:</p>
<pre><code>$(document).ready(function() {
var $userPanel = $('div.panel');
// hide div.panel then show it and slide into view
$userPanel.hide().delay(2000);
$userPanel.show('slide', { direction: 'up' });
// work out the window width / 2 to get the center and the same for div.panel
var windowWidth = $(window).width() / 2;
var panelWidth = $userPanel.width() / 2;
// subtract the div.panel width from the window width / 2
var positionCentered = windowWidth - panelWidth;
// add css to the left property of position absolute
$(window).resize($userPanel.css({ left: windowWidth - panelWidth })); // ???????????????
$('#closeMe').click(function(e) {
e.preventDefault();
$userPanel.hide('slide', { direction: 'up' });
});
});
</code></pre>
<p>Can anyone offer me some advice as to where Im going wrong?</p>
<p>Regards
Kyle</p>
| javascript jquery | [3, 5] |
1,999,881 | 1,999,882 | javascript for checkbox checked | <p>Sample of what I need: (click for full image)</p>
<p><a href="http://i.stack.imgur.com/czyQI.png" rel="nofollow"><img src="http://i.stack.imgur.com/czyQI.png" alt="sample"></a></p>
<p>I want that when I click on any of the header checkbox, all the rows below that will be checked.</p>
<p>For example: when I click on <em>select all</em> checkbox of header then all the checkbox shown in grid must be checked and vice versa. Also when I click on any select row checkbox than that particular row must be selected.</p>
<p>Also I have child and parent node as admin has role wise menu and role details then clicking on cell[1][1] that is admin row first cell, then it should check or uncheck its child node too.</p>
| c# asp.net | [0, 9] |
2,817,058 | 2,817,059 | Equal substring value does not return expected result | <p>Hi I have a problem with this substring where I expected it to be equal. Well I made a function where you will compare two names then whenever those names share a same character it will change all that characters into spaces. Can you check where is my mistake in this one? I'm having a hardtime to figure it out. Here's my code:</p>
<pre><code>name1 = name1.replace(" ","");
name2 = name2.replace(" ","");
Log.v(TAG, name1);
Log.v(TAG, name2);
Log.v(TAG, String.valueOf(name1.length()));
Log.v(TAG, String.valueOf(name2.length()));
for (int x=0; x < name1.length(); x++){
for (int y=0; y < name2.length(); y++){
Log.v(TAG, "Value of LOOP : "+"-"+String.valueOf(y) +"-"+String.valueOf(x)+"-");
Log.v(TAG,"-"+name1.substring(x)+"-"+name2.substring(y)+"-");
if (name1.substring(x) == name2.substring(y)){
Log.v(TAG, "Value of XY : "+String.valueOf(y)+","+String.valueOf(y));
name1 = name1.replace(name1.substring(x)," ");
name2 = name2.replace(name2.substring(y)," ");
}
}
}
Log.v(TAG,"LOOP SUCCESS");
String name3 = name1 + name2;
Log.v(TAG,"Name 3 Value: "+name3);
</code></pre>
| java android | [1, 4] |
122,789 | 122,790 | JQuery - Fade Out Elements After Being Created | <p>I'm currently working on a JQuery game (Just to get around with using JQuery) and on certain collisions, an "explosion" class is created. </p>
<p>Right now I'm using <code>$("#game").append("the div html code goes here")</code> to add it in the game div. Now, how do I make it so after the element is created, it fades out after being created? I tried doing something along the lines of <code>$(".explosion").load(function goes here)</code> but that doesn't seem to work :\</p>
| javascript jquery | [3, 5] |
4,738,744 | 4,738,745 | What is the first global.asax event that Session is accessible assuming the context handler is IRequiresSessionState or IReadOnlySessionState? | <p>My app sometimes calls <code>Server.Transfer</code> in the <code>Application_OnPostAuthenticateRequest</code> event of the global.asax to act as kind of url rewite. When this happens and I need to access <code>Session</code> I get an HttpException: "Session state can only be used when enableSessionState is set to true..." I am assuming this is happening because of the event I am calling <code>Server.Transfer</code>. Is that why I am getting the exception? When should I do the transfer?</p>
| c# asp.net | [0, 9] |
2,964,737 | 2,964,738 | Not able to add 15 minute to 00:00 | <p>I have written a function for adding time in a 24 hour format as given below</p>
<pre><code>for (int i = 0; i < cursor.getCount(); i++) {
String RevisedTime="00:00";
// get hour and minute from time string
StringTokenizer st1 = new StringTokenizer(RevisedTime, ":");
int j = 0;
int[] val = new int[st1.countTokens()];
// iterate through tokens
while (st1.hasMoreTokens()) {
val[j] = Integer.parseInt(st1.nextToken());
j++;
}
// call time add method with current hour, minute and minutesToAdd,
// return added time as a string
String date = addTime(val[0], val[1], 15);
}
public String addTime(int hour, int minute, int minutesToAdd) {
Calendar calendar = new GregorianCalendar(1990, 1, 1, hour, minute);
calendar.add(Calendar.MINUTE, minutesToAdd);
SimpleDateFormat sdf = new SimpleDateFormat("kk:mm");
String date = sdf.format(calendar.getTime());
return date;
}
</code></pre>
<p>The problem is that while adding 15 minutes to 00:00 I am getting the output as 12.15....</p>
<p>I need to get it as 00:15......Pleas help me.....</p>
| java android | [1, 4] |
5,576,428 | 5,576,429 | Custom dialog box to get confirmation when browser tab is closed | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2132760/how-to-ask-confirmation-when-closing-a-window">How to ask confirmation when closing a window?</a> </p>
</blockquote>
<p>I would like to display a confirmation box and a custom message when the browser tab is closed. Users can click OK to actually close the tab, and CANCEL to stay on the page.</p>
<p>The following is my code. Can someone tell me how I can make it work?</p>
<pre><code> window.onbeforeunload = function (e) {
e = e || window.event;
// For IE and Firefox prior to version 4
if (e) {
e.returnValue = 'ARE you sure?';
}
// For Safari
return 'ARE you sure?';
};
</code></pre>
| javascript jquery | [3, 5] |
1,663,439 | 1,663,440 | Find out latest version | <p>I would like to get the logic to find out latest versions among two version numbers
for e.g for blackberry mobile OS, it will return the version number like this '6.0.1'. Some other os might return 6.1 only or 6.1.2.4 something like that. I wish to get logic in C# to find the latest version of the provided version numbers.</p>
<p>for e.g.
i. Find the latest of the below</p>
<pre><code>1. 5.2.4
2. 6.1.6
</code></pre>
<p>ii. </p>
<pre><code>1. 6.1.4.6
2. 1.8.4.2
</code></pre>
| c# asp.net | [0, 9] |
2,918,548 | 2,918,549 | Pass variable and DOM element to jquery each | <p>I've been struggling with this for a while, and have tried many searches, but haven't found the right solution, nor words for the issue I have.
I wish to traverse the <code><tr></code>'s in <code><table id="Listeners"></code> with jQuery, and set the rows to either Even or Odd class.</p>
<p>The is yet saved in a variable and passed to the function, as follows:</p>
<pre><code><table id="Listeners">
<tr><td>1</td></tr>
<tr><td>2</td></tr>
</table>
</code></pre>
<p>And my jQuery:</p>
<pre><code>var Element = $("#Listeners");
$(Element+" tr").each(function(index) {
if (index%2 == 0) {
$(this).addClass("Even");
}
});
</code></pre>
<p>But that doesn't work, any thoughts on how to solve this?</p>
| javascript jquery | [3, 5] |
5,572,425 | 5,572,426 | Send message from a hotspot to a connected client | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/10777678/send-message-from-a-basic-server-to-a-specific-client">Send message from a basic server to a specific client</a> </p>
</blockquote>
<p>Here is a scenario. I have enabled a hotspot through wifi tethering on my android phone. I also have two wifi modules which connects to this hotspot. Now, I want to send a message to only 'one client' (not all) connected to my hotspot. Is that even possible in Java if I dont want to use a Server-Client Application. As the hotspot itself acts as a server.</p>
<p>Thanks for any assistance.</p>
| java android | [1, 4] |
1,296,880 | 1,296,881 | Non-smooth div animation in Firefox | <p>Referring to <a href="http://jsfiddle.net/25EsV/" rel="nofollow">this fiddle</a>. This animation is quite smooth on Chrome and IE (v9), however it is very choppy on Firefox. The whole idea is to animate the border without moving the div itself (referring back to <a href="http://stackoverflow.com/questions/6313847/jquery-animate-border-without-moving-div">this</a> question). Question is, any possible way to achieve the same animation but in a smoother fashion (like that in Chrome/IE) in Firefox? </p>
<p>This is the case even if you animate just one side of the <code>div</code>, so it's not because we are trying to animate every side at once. If we look at <a href="http://jsfiddle.net/c3Fw8/" rel="nofollow">this fiddle</a> in Firefox, it seems that the margins being animated is not too smooth, which seems to be the problem. </p>
<p>Any workout is appreciated.</p>
| javascript jquery | [3, 5] |
2,816,177 | 2,816,178 | jQuery: Can't cache onclick handler? | <p>I've got a step-by-step wizard kind of flow where after each step the information that the user entered for that step collapses down into a brief summary view, and a "Go back" link appears next to it, allowing the user to jump back to that step in the flow if they decide they want to change something.</p>
<p>The problem is, I don't want the "Go Back" links to be clickable while the wizard is animating. To accomplish this I am using a trick that I have used many times before; caching the <code>onclick</code> handler to a different property when I want it to be disabled, and then restoring it when I want it to become clickable again. This is the first time I have tried doing this with jQuery, and for some reason it is not working. My disabling code is:</p>
<pre><code> jQuery.each($("a.goBackLink"), function() {
this._oldOnclick = this.onclick;
this.onclick = function() {alert("disabled!!!");};
$(this).css("color", "lightGray ! important");
});
</code></pre>
<p>...and my enabling code is:</p>
<pre><code> jQuery.each($("a.goBackLink"), function() {
this.onclick = this._oldOnclick;
$(this).css("color", "#0000CC ! important");
});
</code></pre>
<p>I'm not sure why it's not working (these are good, old-fashioned onclick handlers defined using the <code>onclick</code> attribute on the corresponding link tags). After disabling the links I always get the "disabled!!!" message when clicking them, even after I run the code that should re-enable them. Any ideas?</p>
<p>One other minor issue with this code is that the <code>css()</code> call to change the link color also doesn't appear to be working.</p>
| javascript jquery | [3, 5] |
3,028,850 | 3,028,851 | login redirects infinitly on subdomain | <p>I have a subdomain at:
kezblu.mysite.com.</p>
<p>It is actually at mysite.com/kezblu</p>
<p>I have code that will ask a user to login if they are not:</p>
<pre><code>protected void HandleLoginRedirect()
{
if (IsRequestedPage("Login") && Authorization.IsAuthenticated())
{
Response.Redirect("default.aspx");
}
else if (!Authorization.IsAuthenticated() && !IsRequestedPage("Login"))
{
string fileName = this.Page.Request.Url.ToString();
fileName = fileName.Remove(0, fileName.LastIndexOf("/") + 1);
Response.Redirect("Login.aspx?redirect=" + fileName);
}
}
public bool IsRequestedPage(string pageName)
{
return Request.RawUrl.StartsWith("/" + pageName + ".aspx");
}
</code></pre>
<p>The problem is of I go to kezblu.mysite.com/kezblu</p>
<p>I end up with:</p>
<pre><code>http://kezblu.mysite.com/kezblu/Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=Login.aspx?redirect=default.aspx
</code></pre>
<p>I also noticed when I sign out, even if I was at kezblu.mysite.com/somewhere.aspx</p>
<p>It redirects me to the above.</p>
<p>What is wrong with my code?</p>
<p>I do not get it.</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
1,593,787 | 1,593,788 | code to run java program from website using php | <p>I have a website and want to be able to allow the user to run a Java file on the server from the website.</p>
<p>I want the user to click a button which will run the Java file on the server AND anything printed to standard-out by the Java program will be printed out on the website for the user to see.</p>
<p>How can this be done (call Java program from PHP and feed the standard out from the Java file back to the PHP website)?</p>
<p>please provide detail code...</p>
| java php | [1, 2] |
3,802,581 | 3,802,582 | What do I need to do to show the calendar when button is clicked? | <p>I am trying to do a calendar which pops out when a button (...)is clicked, but I am stuck and don't know what I have to do. Below is the code I am using. I am using visual studio 2010 and C# as my programming langauge.</p>
<pre><code><asp:textbox id="TextBox1" runat="server"></asp:textbox>
<input type="button" id="Button2" runat="server" value="...."><br>
<asp:Panel id="pnlCalendar" runat="server"
style="POSITION: absolute">
<asp:calendar id="Calendar3" runat="server" CellPadding="4"
BorderColor="#999999" Font-Names="Verdana" Font-Size="8pt"
Height="180px" ForeColor="Black" DayNameFormat="FirstLetter"
Width="200px" BackColor="White">
<TodayDayStyle ForeColor="Black" BackColor="#CCCCCC"></TodayDayStyle>
<SelectorStyle BackColor="#CCCCCC"></SelectorStyle>
<NextPrevStyle VerticalAlign="Bottom"></NextPrevStyle>
<DayHeaderStyle Font-Size="7pt" Font-Bold="True" BackColor="#CCCCCC">
</DayHeaderStyle>
<SelectedDayStyle Font-Bold="True" ForeColor="White" BackColor="#666666">
</SelectedDayStyle>
<TitleStyle Font-Bold="True" BorderColor="Black" BackColor="#999999">
</TitleStyle>
<WeekendDayStyle BackColor="LightSteelBlue"></WeekendDayStyle>
<OtherMonthDayStyle ForeColor="#808080"></OtherMonthDayStyle>
</asp:calendar>
</asp:Panel>
</code></pre>
<p><img src="http://i.stack.imgur.com/L20tT.jpg" alt="This is generated with my code"></p>
| c# asp.net | [0, 9] |
4,350,015 | 4,350,016 | call an external javascript function from python | <p>I have a javascript function that I can call with input and that returns a result.
I can integrate this javascript function into an html-document (of course).</p>
<p>Now I would like to call exactly this javascript function from python. I have a python programm and want to call the javascript function with input parameters passed to the JS function by the calling python function. And the JS function shall return some result to python.</p>
<p>This JS function has quite complex functionality and is used in a web project also. I would like to use same functionality in Python.</p>
<p>Does anyone know how to solve this? Python is quite huge so I think I only did not find the required python module up until know. I spent 2 days in searching a possibility.</p>
<p>Thanks!</p>
| javascript python | [3, 7] |
1,953,353 | 1,953,354 | Progress dialog during tab switch | <p>When the user switches from tab A to tab B it takes a long time (6 seconds), so I put in a progress dialog to let the user know that the app is working on it. The timeline is as follows:</p>
<ol>
<li>Activity B onCreate - creates ProgressDialog and puts long tasks in a background Thread.</li>
<li>Activity B onStart</li>
<li>Activity B onResume</li>
<li>Activity B appears on the screen</li>
</ol>
<p>This all works great with one "minor" snafu- the app intermittently crashes because the onResume function references something that is created by the background Thread. It is, in other words, a classic race condition.</p>
<p>To fix the race condition I did a "join" on the thread right before the reference in onResume, but that makes the progress dialog not show up until the background thread is done (i.e. it shows up for a split second and then goes away) and the app acts like it is hung while the background thread is working. Apparently the progress dialog cannot show up until onResume completes.</p>
<p>My question is this: how can I get the ProgressDialog to show up without crashing the program? Or do I need to either get the offending reference out of onResume or live with the app acting hung?</p>
| java android | [1, 4] |
494,201 | 494,202 | javascript, jQuery running a single function with two different inputs at the same time | <p>hey guys just doing some messing around and learning a few new things to kill time at the moment im fiddling with javascript and i have encountered a problem.</p>
<p>so the problem is that i have downloaded a small jQuery slideshow thing of the internet being simple fade slideshow (i have hacked it to pieces removing stuff i didn't deem necessary) and im trying to get it to run two independent slideshows at the same time. i want these slideshows to have different dimensions for width and height preferably transition time also and my problem is that the function will only run one slideshow.</p>
<pre><code>$(document).ready(function(){
$('#slideshow').fadeSlideShow({
width: 300,
height: 343,
});
</code></pre>
<p>is there a way that i can say change <code>#slideshow</code> to <code>#slideshow1</code> and then have it run on the same bit of code at the same time as <code>#slideshow</code>? obviously i could just change some names around and have a ton of text but id prefer to find a neater way.</p>
<p>im fairly novice so any advice is greatly appreciated</p>
| javascript jquery | [3, 5] |
3,913,851 | 3,913,852 | ASP.Net C# Where ID equals Cell | <p>Hi all I have this statement:</p>
<pre><code>cmd = new SqlCommand("UPDATE Comments SET Flagged = '" + "Yes" + "' WHERE Comment_ID ='" + Row.Cells[0] + "'", con);
</code></pre>
<p>Visual Studio is underlining Row.Cells[0] saying Row does not exist in current context. </p>
<p>Could you take a look and see where I am going wrong.</p>
<p>Full method Code:</p>
<pre><code>protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridView1.RowCommand += new GridViewCommandEventHandler(GridView1_RowCommand);
if (e.CommandName == "cmdFlag")
{
con.Open();
cmd = new SqlCommand("UPDATE Comments SET Flagged = '" + "Yes" + "' WHERE Comment_ID ='" + Row.Cells[0] + "'", con);
cmd.ExecuteNonQuery();
Response.Redirect("~/renteronly/flagset.aspx");
}
}
</code></pre>
| c# asp.net | [0, 9] |
1,911,324 | 1,911,325 | Re-using programatically created Textviews | <p>I've written code to perform a search and display the results below the search form in the XML file.</p>
<p>However, by creating TextViews dynamically, it keeps adding more TextViews so the number of TextViews increases by 5 everytime I perform a search. How could I re-use the TextViews so I can update the text to be displayed rather than creating more TextViews?</p>
<pre><code>for(int i=0; i<5; i++) {
TextView altName = new TextView(getApplicationContext());
altName.setText("blah");
altName.setLayoutParams(new TableRow.LayoutParams(1));
altName.setTextAppearance(getApplicationContext(), R.style.textSize);
TableRow altNameTr = new TableRow(getApplicationContext());
altNameTr.addView(altName);
table.addView(altNameTr);
}
</code></pre>
| java android | [1, 4] |
2,069,117 | 2,069,118 | Domain name resolution in Android | <p>Does anyone know the DNS query implementation from a low level? I mean, in Android, if I call <code>InetAddress.getByName()</code>, what is the underlying call stack to get the IP address of the queried domain name?</p>
| java android | [1, 4] |
2,899,399 | 2,899,400 | Press home button to stop service | <p>i want to if the user press home button my service will be stop , this is my code but it's not working for me, please help me:</p>
<pre><code>@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_HOME) {
stopService(new Intent(this, MyService.class));
return true;
}
return super.onKeyDown(keyCode, event);
}
</code></pre>
<p>Thanks</p>
| java android | [1, 4] |
2,429,281 | 2,429,282 | Add javascript in php code and php code in Javascript | <p>I am trying to get the info from a PHP variable in to JavaScript while in the PHP <code>if</code> statement. I am not sure what is wrong. I tried to escape the PHP code then I thought I cannot have PHP code tags with in PHP code.</p>
<p><strong>Here is my code but this does not work:</strong></p>
<pre class="lang-php prettyprint-override"><code>$user =& JFactory::getUser();
if ($user->guest)
echo '<script type="text/javascript">_gaq.push([\'_setCustomVar\',1,\'User_Status\',\'Guest\',1])</script>';
echo '<script type="text/javascript">_gaq.push([\'_setCustomVar\',2,\'UserID\',\'GuestUser\',1])</script>';
} else {
echo '<script type="text/javascript">_gaq.push([\'_setCustomVar\',1,\'User_Status\',\'LoggedIn\',1])</script>';
echo '<script type="text/javascript">_gaq.push([\'_setCustomVar\',2,\'UserID\',\' "echo $user->id "\', 1])</script>';
}
</code></pre>
<p>Can you please help?<br>
Many Thanks<br>
Jai</p>
| php javascript | [2, 3] |
1,438,345 | 1,438,346 | How to make my flash file on website non-clickable? | <p>I have a few /swf files on my site - i'm posting them that way:</p>
<pre><code> <div class="cvreation" style="padding-top:25px;" >
<object class="flash_banner" type="application/x-shockwave-flash" data="/prod_bann/flashfile.swf" ></object>
</div>
</code></pre>
<p>It works great - but when I click on this flash object - it gets me into currenturl/undefined.
How to make these banners not clickable?</p>
| php javascript jquery | [2, 3, 5] |
1,451,134 | 1,451,135 | jquery catching QUnit.done | <p>How can I catch QUnit.done from jquery.testHelper.js
<a href="https://github.com/jquery/jquery-mobile/blob/master/tests/jquery.testHelper.js" rel="nofollow">https://github.com/jquery/jquery-mobile/blob/master/tests/jquery.testHelper.js</a></p>
<p>I tried to define </p>
<pre><code>QUnit.done = function ( failed, passed, total, runtime ) {
alert("test");
}
</code></pre>
<p>but it's giving me "Uncaught ReferenceError: QUnit is not defined"</p>
| javascript jquery | [3, 5] |
3,507,846 | 3,507,847 | Can Android applications have their variables read/set maliciously? | <p>This does not deal with apk piracy what I'm asking about is the code in the apk file.</p>
<p>I know that if you use shared memory and set the mode to public people can change the values that are saved but what about the code in the application? For example if I set a variable to public static int in a game could an outside application change those values?</p>
<p>Another question I have is if I have my application access a remote server could a 3rd party application possibly change the return value that my server would send back?</p>
<p>Thanks in advance</p>
| java android | [1, 4] |
1,858,930 | 1,858,931 | javascript focus to an element | <p>I have a page that scrolls across multiple screens using jQuery's animate function. I am using tab indeces set by jQuery for the form. The problem is that when I give focus to the first element of the form using</p>
<pre><code>$('#myforminput1').focus();
</code></pre>
<p>the page automatically scrolls to the element that has focus, even though it is on the third screen. I don't want the #myforminput1 to have focus until after it scrolls to page three. What happens when I add it to the code is that the page jumps to the focused element, and then animates to move the amount to page 3 so it overshoots the form. It might work if I could set the focus after the animation stops. </p>
<p>There is a similar problem with IE7 in that when a select box is selected using tabs, the page scrolls so that the select box is on the left part of a page. It seems like this problem might be related.</p>
| javascript jquery | [3, 5] |
6,027,319 | 6,027,320 | How to get portion of the attribute value using jquery | <p>I have attribute value as:</p>
<pre><code><div id = "2fComponents-2fPromotion-2f" class = "promotion">
</code></pre>
<p>Now I want to get only portion of it, say <code>Promotion</code> and its value <code>2f</code>, how can I get this using jquery ? Do we have built in function for it ?</p>
| javascript jquery | [3, 5] |
2,899,773 | 2,899,774 | Difference between AsyncPostBackTrigger and PostBackTrigger on UpdatePanel? | <p>I have a <code>GridView</code>(ucLAD) in my <code>UpdatePanel</code>(upnlListing). Inside my <code>ucLAD</code> I have a checkbox and an action for <code>rowClicked</code>:</p>
<pre><code><asp:UpdatePanel ID="upnlListing" runat="server" >
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ucLAD"/>
<%-- <asp:PostBackTrigger ControlID="ucLAD"/> --%>
</Triggers>
<ContentTemplate>
<asp:Panel ID="pnlRequest" runat="server" style="margin-top:15px; height: auto;">
<ucgv:BaseGrid runat="server" ID="ucLAD"/>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</code></pre>
<p>When I use the <code>PostBackTrigger</code> the action performed would be the <code>rowClicked</code> same thing happen when I check the checkbox but when I use the <code>AsyncPostBackTrigger</code>, I can check the checkboxes but when I click the row, the action for <code>rowClicked</code> don't trigger. How can I fix this?</p>
| c# asp.net | [0, 9] |
691,795 | 691,796 | How can I wrap header text in Gridview? | <p>Hi I am writing some code to display some records in Grid view. I am using Firefox as my Default browser. I wish to wrap a header text. but Firefox is not supporting the wrap property. How can I achieve this?</p>
| c# asp.net | [0, 9] |
3,397,295 | 3,397,296 | Problems with unbinding a function by handler | <p>I have html like this:</p>
<pre><code><div>
<input type="checkbox" id="checkbox", checked="checked"/>
<label for="checkbox">Copy values</label>
</div>
<div>
<input id="source" type="text"/>
</div>
<div>
<input id="target" type="text"/>
</div>
</code></pre>
<p>And I'm trying to implement jQuery code to copy value from <code>source</code> input to <code>target</code> one, only when the checkbox is checked. Here's my code:</p>
<pre><code>var checkbox = $("#checkbox");
var source = $("#source");
var target = $("#target");
var bindFunction = function () {
var copyValue = function () {console.log("asd");
target.val(source.val());
}
if (checkbox.is(":checked")) {
source.bind("keyup", copyValue);
}
else {
source.unbind("keyup", copyValue);
}
}
checkbox.bind("change", bindFunction);
bindFunction();
</code></pre>
<p>However, it does not work as expected - for some reason the <code>copyValue</code> function doesn't get unbound. What am I doing wrong?</p>
<p>Here's a <a href="http://jsfiddle.net/5b93H/" rel="nofollow">jsFiddle</a>.</p>
| javascript jquery | [3, 5] |
544,789 | 544,790 | Camera Preview Example | <p>I know this is really basic but it is a error that I cannot find a solution to.</p>
<p><a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html" rel="nofollow">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html</a></p>
<p>I have 2 errors and I dont know what Im doning wrong.</p>
<pre><code>public boolean onCreateOptionsMenu(Menu menu) {
// Inflate our menu which can gather user input for switching camera
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.camera_menu, menu);
return true;
}
</code></pre>
<p>Im getting an error at "menu" in "R.menue..."</p>
<p>error 2:</p>
<pre><code>public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.switch_cam:
// check for availability of multiple cameras
if (numberOfCameras == 1) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
/**builder.setMessage(this.getString(R.string.camera_alert))
.setNeutralButton("Close", null);*/
AlertDialog alert = builder.create();
alert.show();
return true;
}
</code></pre>
<p>Im getting an error on "id" in "case R.id..."</p>
<p>Thanks</p>
| java android | [1, 4] |
2,249,970 | 2,249,971 | jquery Element to DOM Element returns empty string by function | <p>Why does this code:</p>
<pre><code>function fn(el){ return $(el)[0].style.width };
fn('#someElementIdId'); // return -> ""
</code></pre>
<p>But this code...</p>
<pre><code>function fn(el){ return $(el).width() } ;
fn('#someElement'); // return -> correct width
</code></pre>
<p>I have tried different things, but all have the same result...</p>
<p>How can I make the first code work?</p>
<p><strong>CODE HERE :: <a href="http://jsfiddle.net/A2VpH/18/" rel="nofollow">http://jsfiddle.net/A2VpH/18/</a></strong></p>
| javascript jquery | [3, 5] |
495,740 | 495,741 | Automatically check checbox when submitting a form | <p>I have a form with a check box and a submit button. I would like the checkbox to be checked automatically when I submit the form.</p>
<p>How can I do that with jquery or javascript?</p>
| javascript jquery | [3, 5] |
3,947,896 | 3,947,897 | how to dynamically (re)position an element according to the bottom of the page using JS / Jquery? | <p><strong>the back story:</strong> i have a tab section on a page which when navigated through displays sections (divs) of varying height. </p>
<p><strong>the result,</strong> is that certain inputs (which are strangely positioned for reasons i can't change) on this page reposition themselves problematically. </p>
<p><strong>the proposed solution:</strong> as the page height changes, have these problem inputs repositioned according to the page bottom (from which their appropriate distances are always a constant). </p>
<p>what i'm thinking is that i need some js that does something like,</p>
<p><strong>page height change triggers input position from bottom to = x.</strong> </p>
<p>there are two inputs if that's at all relevant. :)</p>
<p>if only there was css for this (i know there is under normal circumstances, but trust me -- not in this case).</p>
<p>thanks for your time & help i've been struggling with this for weeks!</p>
| javascript jquery | [3, 5] |
5,373,260 | 5,373,261 | How to show the text at lock screen in Android | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7569812/how-can-i-interact-with-the-lockscreen-layout-to-display-text-into-it-like-this">How can I interact with the Lockscreen layout to display text into it, like this app:</a> </p>
</blockquote>
<p>I want to show some text to the Android lock screen same as like 'I Like It' android app has implemented. You can see the app on Google play from <a href="https://play.google.com/store/apps/details?id=com.ilikeit.main" rel="nofollow">https://play.google.com/store/apps/details?id=com.ilikeit.main</a></p>
| java android | [1, 4] |
5,083,897 | 5,083,898 | asp.net checkbox in gridview - checked property is missing | <p>In this asp.net gridview control, the checked property is always missing. I need to access the checked property via jquery</p>
<pre><code>Gridview source:
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkSelected" runat="server" class="chkSummarySelection" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</code></pre>
<p>Renders as :</p>
<pre><code><input type="checkbox" name="ctl00$ContentPlaceHolder1$gv$ctl02$SelectedCheckBox" id="ctl00_ContentPlaceHolder1_gv_ctl02_SelectedCheckBox">
</code></pre>
<p>There is no checked property to access.
I have tried</p>
<pre><code>$(".chkSummarySelection").click(function () {
var chk;
chk = $(this).prop("checked");
chk = $(this).attr("checked");
chk = $(this).is(":checked");
chk = $(this).attr("value");
chk = $(this).val();
chk = jQuery(this).is(':checked');
});
</code></pre>
<p>but nothing is working</p>
| javascript jquery asp.net | [3, 5, 9] |
5,254,101 | 5,254,102 | Convert Datatable to PDF | <p>Can I get a code for converting datatable to pdf in Asp.net Web application. I want to have functionality to export <code>datatable</code> into <code>PDF</code>. I found <a href="http://www.aspsnippets.com/Articles/Export-DataSet-or-DataTable-to-Word-Excel-PDF-and-CSV-Formats.aspx" rel="nofollow">this</a> article but it is using <code>gridview</code> for exporting </p>
| c# asp.net | [0, 9] |
129,321 | 129,322 | JS Include File From ASP.Net User Control | <p>This maybe a very basic question but for the life of me I cannot figure it out. So I have a user control that gets loaded on a page. Well, in this user control, I'm wanting to include a js file for some functions that are only specific to that user control. Inside this js file let's say I have a function called 'MyFunction'. In the onclick event of a div I'm wanting to call that function and I am unable to. Any help would be greatly appreciated.</p>
<p>I'm using the <code>ClientScriptManager</code> of the page object and I'm supposedly successfully including the file on the page using the following call:</p>
<pre><code>page.ClientScript.RegisterClientScriptInclude(scriptTitle,
page.ResolveUrl(scriptUrl))
</code></pre>
<p>Now, after this, I'm wondering, is there anything special I need to do to be able to call a function that's in the include file? like in my div:</p>
<pre><code><div class="someClass" onclick="MyFunction();">Click Me</div>
</code></pre>
| asp.net javascript | [9, 3] |
3,436,643 | 3,436,644 | Long running thread + lifecycle | <p>I have a long-running thread which I start on app startup:</p>
<pre><code>public class MyHelper extends Thread {
private AtomicBoolean mRun;
public void run() {
while (mRun.get()) {
...
}
}
}
public class App extends Application {
private MyHelper mHelper;
public void onCreate() {
mHelper = new MyHelper();
mHelper.start();
}
}
</code></pre>
<p>We don't get any "app terminate" signal in Android though, so is the above keeping my app running forever in the background? There's no good place for me to know when to shut the thread down. </p>
<p>I wonder if the user pops the last activity from the stack (by hitting the back button), will my Application instance get destroyed even though the Thread is still possibly in a waiting state?</p>
<p>Thanks</p>
| java android | [1, 4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.