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 |
|---|---|---|---|---|---|
649,222
| 649,223
|
String was not recognized as a valid DateTime
|
<p>Please help me with the issue . I have tried lot many solution and they are not working .</p>
<pre><code>rd["DOB"].ToString() = "9/19/1946";
DateTime dt1 = DateTime.ParseExact(rd["DOB"].ToString(), "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture);
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,055,703
| 2,055,704
|
Jquery function to find out max height of <li>
|
<p>I want to find out that out of the given <code><li></code> which <code>li</code> has the maximum height?
how do i write such function?</p>
<p>If there are n <code><li></code> elements of different size, content and height. I want to figure out the maximum height of the biggest <code><li></code> element. </p>
|
javascript jquery
|
[3, 5]
|
2,858,862
| 2,858,863
|
Dynamic Text Box value comparison?
|
<p>I am generating dynamic text boxes in my application. I need to compare the values in each dynamic text boxes when I click the submit button.</p>
<p>Can any one please help me by providing some ideas or sample codes to solve this task?</p>
<p>The solution might either be in jQuery, Javascript or C# asp.net</p>
|
javascript asp.net jquery
|
[3, 9, 5]
|
3,712,424
| 3,712,425
|
Is there an equivalent of ucwords in java
|
<p>In php, the method <code>ucwords</code> converts any string in a string where each words first character is in uppercase, and all other characters are lower case. </p>
<p>I always end up making my own implementation, and I'm wondering if a standard method exists. </p>
|
java php android
|
[1, 2, 4]
|
5,294,348
| 5,294,349
|
Understanding what appears to be an instantiation of a method
|
<p>I am currently trying to understand how well regarded lightbox, ColorBox, works so that I can attempt to make a development to it. However I am struggling with a couple of concepts within the code. The following is where I am stuck:</p>
<p>I have the following function being declared:</p>
<pre><code>publicMethod = function() {…}
</code></pre>
<p>Then after all that this function:</p>
<pre><code>publicMethod.init = function() {…}
</code></pre>
<p>And finally at the end of the script the following command is run:</p>
<pre><code>$(publicMethod.init);
</code></pre>
<p>Now I am not 100% sure what this last command is doing, I assume it is instanciating the method. But I would assume that you should be able to do that by just doing:</p>
<p>publicMethod.init;</p>
<p>Why is it wrapped inside a jQuery parentheses? What is the result of this?</p>
<p>Also, if I am correct in saying that it is instanciating <code>publicMethod.init</code>, does that mean that <code>publicMethod</code> is being instanciated first before <code>publicMethod.init</code>?</p>
|
javascript jquery
|
[3, 5]
|
5,394,001
| 5,394,002
|
ASP.NET: How to handle all page redirection?
|
<p>In an ASP.NET page, are there any practical ways to handle all of these following:</p>
<ol>
<li>PostBack</li>
<li>Redirection when user click a link in the page</li>
<li>Redirection when user change url field in the browser</li>
</ol>
<p>with just a single web control (or method)?</p>
<p>TQ</p>
|
c# asp.net
|
[0, 9]
|
2,917,661
| 2,917,662
|
Programatically created events in RowDataBound not firing
|
<p>I have a GridView which is populated from a database, and includes a textbox. Through the code behind, I want to subscribe the textbox on each row to a certain event, but only if a field of the row matches some if statement.</p>
<p>So I have the following:</p>
<pre><code>protected void grdRates_RowDataBound(object sender, GridViewRowEventArgs e)
{
TextBox txt = (TextBox)e.Row.FindControl("txtValue");
DataRowView dataView = (DataRowView)e.Row.DataItem;
if ((bool)dataView["isAuto"])
{
txt.AutoPostBack = true;
txt.TextChanged += new EventHandler(txt_TextChanged);
}
}
protected void txt_TextChanged(object sender, EventArgs e)
{
//Other stuff here
}
</code></pre>
<p>The problem is, the text changed event never fires - the AutoPostBack property is being set, as the page posts back when they move out of the TextBox, but the text changed event does not fire. Am I missing something here?</p>
|
c# asp.net
|
[0, 9]
|
2,308,755
| 2,308,756
|
jquery tree traversal issue
|
<pre><code>$('.field').blur(function()
$('*').not('.adress').click(function(e) {
foo = $(this).data('events').click;
if(foo.length <= 1) {
// $(this').next('.spacer').children().removeClass("visible");
}
$(this).unbind(e);
});
});
</code></pre>
<p>I'm trying to remove a class "visible, whenever I'm bluring a field classed .field, unless if I click an element with the class .adress. </p>
<p>The field blur and adress-click is working as it should(I tired it with alert) but not the removal of class, does anyone know why?</p>
<p>The removal of class works if the not(".adress")-function is removed!
Like this:</p>
<pre><code>$('.field').blur(function() {
(this).next('.spacer').children().removeClass("visible");
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,644,070
| 5,644,071
|
Using jQuery to clone form elements with dynamically added values
|
<p>I have a form that is similar to this:</p>
<pre><code><fieldset id="user">
<input type="text" id="firstName">
<input type="text" id="lastName">
</fieldset>
</code></pre>
<p>Then I do an Ajax call to fill the values of those two fields. At this point I want to save the current state of the form (with the populated values) in case the user needs to revert back after making a change.</p>
<p>I've tried this:</p>
<pre><code>$("#user").clone(true).html()
</code></pre>
<p>As well as this:</p>
<pre><code>$("#user").html()
</code></pre>
<p>both return the original html from the dom that was created before the fields were populated. Is there a way to grab the html with the values after they have been populated with JS?</p>
|
javascript jquery
|
[3, 5]
|
15,782
| 15,783
|
Is it possible to copy javascript with javascript?
|
<p>Is it possible to copy javascript with javascript? For example:</p>
<pre><code><div class="copyThis">
<script language="javascript">
$(function()
{
$("#click").click(function(e){
$('.copyThis').clone().appendTo('#copyArea');
e.preventDefault();
});
});
</script>
CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT
<div style="width: 200px; height: 50px; background-color: gray;">
<a id="click" href="">click here to copy</a>
</div>
<div id="copyArea">
Put here:
</div>
</div>
</code></pre>
<p>But this doesn't copy the tag and its content. At least, not that I know of.</p>
<p><strong>NOTE:</strong>
I came upon this question in relationship to a different question I had posted here: <a href="http://stackoverflow.com/questions/4453593/infinite-loop-question-is-it-possible-to-make-a-copy-this-code-to-share-with">Infinite-loop question: Is it possible to make a "Copy this code to share", with a "copy this code to share" inside of it?</a>
I hope it's ok to post this question separately as it's sort of a curiosity thing.</p>
|
javascript jquery
|
[3, 5]
|
5,008,342
| 5,008,343
|
Andriond send event from first activity and receive on the second
|
<p>I have two activities. The first activity display list of the users with short info. And after select some user I go to the second activity for display full info about this user. For send event I used <code>startActivityForResult();</code> for receive event in socond activity and added <code>public void onActivityResult(int requestCode, int resultCode, Intent data)</code>. After start project I send intend from first activity and I do not receive in the second :(. How I can receive sent event in second activity?
Thank you...</p>
|
java android
|
[1, 4]
|
5,552,248
| 5,552,249
|
jQuery: Why can't I access the event object in my scroll event?
|
<p>I want to access the original event object but the object returns undefined..</p>
<pre><code>$(window).scroll(function(event) {
alert(event.pageX);
});
</code></pre>
<p>I'm just trying this out if it will work. The example is as basic as possible so I can work out other events too.</p>
|
javascript jquery
|
[3, 5]
|
5,552,477
| 5,552,478
|
Alert Box with specific functionality
|
<p>I am getting a JS Alert-box When I am leaving my tabs 1st time.
But would like to get it as windows alert - any idea on basis of my code.
Also that should have a OK and Cancel Button - Ok > Next Tab
Cancel> Same tab </p>
<pre><code>$(document).ready(function () {
B.initB();
var 3firstTimeMsg = true;
var 4FirstTimeMsg = true;
$(".3a-tab").click(function(){
if(3firstTimeMsg == true)
{
alert("If you leave this page, any information you've entered will be lost.");
3firstTimeMsg = false;
}
});
$(".3b-tab").click(function(){
if(4FirstTimeMsg == true)
{
alert("If you leave this page, any information you've entered will be lost.");
4FirstTimeMsg = false;
}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,110,403
| 5,110,404
|
Javascript event not bubbling
|
<p>I have the markup below:<img src="http://i.stack.imgur.com/WQ8dU.png" alt="enter image description here"></p>
<p>And I have some jQuery I just added to toggle the row color:
<img src="http://i.stack.imgur.com/I9oEU.png" alt="enter image description here"></p>
<p>Clicking anywhere in the row switches the view, as below:</p>
<p><img src="http://i.stack.imgur.com/tjXG5.png" alt="enter image description here"></p>
<p>The problem is that since I added the toggle function the links don't work. The toggle handler seems to capture the event. I would expect the link to get the event first and then the row, so the link should work fine.</p>
<p>Does anyone see the problem?</p>
<p>Thanks </p>
|
javascript jquery
|
[3, 5]
|
1,458,694
| 1,458,695
|
How to change Width of Android's Switch track?
|
<p>I'm going crazy with this tiny problem. I have a 'switch' Form widget, but no matter how much I try, I cannot make it narrower. Even if I have one character instead of 'ON' or 'OFF', the size of switch remains the same. The 'thumb' becomes small, but it has to be dragged over the same distance as before. Changing the 'layout_width' to a smaller value simply cuts off the remaining track. 'minWidth' doesnt seem to do anything. </p>
<p>Anybody knows how I can do this? Ideally I want just an empty thumb and I'll colour code both thumb to know which is which. </p>
<p>XML code: </p>
<blockquote>
<pre><code><Switch
android:id="@+id/switch3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Switch"
android:textOff=" "
android:textOn=" " />
</code></pre>
</blockquote>
<p>I am gettin this: <img src="http://i.stack.imgur.com/XeJ8T.png" alt="enter image description here"></p>
<p>but I want something like this:
<img src="http://i.stack.imgur.com/tfYKm.png" alt="enter image description here"></p>
|
java android
|
[1, 4]
|
5,757,596
| 5,757,597
|
Java analogous to Python os.path.expanduser / os.path.expandvars
|
<p>Is there such a thing as Python's <code>os.path.expanduser</code> and <code>os.path.expandvars</code> (<a href="http://docs.python.org/library/os.path.html" rel="nofollow">documentation</a>) in Java?</p>
<p>If not, is there a library somewhere that does this?</p>
|
java python
|
[1, 7]
|
1,845,770
| 1,845,771
|
jquery increment id and name of children within appended rows
|
<p>Hey all. I am adding a "More Rows" button to a table within a long, complex form, and to add the rows, I am cloning an existing row in the table, modifying it, then appending it to the end of the table. </p>
<p>The row contains inputs that have id and name attributes that are numbered sequentially (e.g. id="Item_Name1" and name="Item_Name1" for the first row, id="Item_Name2" and name="Item_Name2" for the second row, etc.). I am looking for the best way of continuing this numbering sequence in the appended rows.</p>
<p>Here's the jQuery:</p>
<pre><code>jQuery.noConflict();
jQuery(document).ready(function($){
var i = $("table#table-id tbody tr").length;
$("button#more-rows").click(function() {
var clonedRow = $("table#table-id tbody tr:first").clone();
i++;
$("*[name*='1']", clonedRow).attr('id', function() {
var attrval = $(this).attr("id");
var attrval = attrval.replace( /\d/g , "" );
return attrval + i
});
$("table#table-id").append(clonedRow);
});
});
</code></pre>
<p>This works for the id's, but how do I also increment the name attributes? Any tips on writing this more simply and/or more performantly are also appreciated.</p>
|
javascript jquery
|
[3, 5]
|
5,725,125
| 5,725,126
|
content appended with jquery is not part of the DOM
|
<p>I have an empty div <code><div id="content"></div></code> to which I add content via jquery append.</p>
<pre><code>$('#content').append('<div class="sub">sub1</div>');
$('#content').append('<div class="sub">sub2</div>');
$('#content').append('<div class="sub">sub3</div>');
</code></pre>
<p>When I click a button I want to run a jquery that reads the content of each sub, but I get nothing, I think because the div elements were added via javascript, so they're not really on the page. </p>
<pre><code>$('.sub').each(function(){
alert($(this).text());
}
</code></pre>
<p>How can I still operate on html added via javascript? </p>
|
javascript jquery
|
[3, 5]
|
1,742,113
| 1,742,114
|
What is an in-depth ASP.NET book?
|
<p>I'm wondering what a good book to read describing how ASP.NET works. I'm thinking something similar to CLR via C# but focused on ASP.NET.</p>
<p><strong>Clarification:</strong> I'm interested in ASP.NET as a platform including things like httphandlers, httpmodules, state management (SessionStateModule), and caching. I'm not looking for information on Visual Studio, ADO.NET, XML, or specific controls.</p>
<p>What do you recommend?</p>
|
c# asp.net
|
[0, 9]
|
1,831,687
| 1,831,688
|
What jquery experssion would give me ['a','b'] for the doc <tag att1='a' /><tag att1='b'/>
|
<p>What jquery experssion would give me <code>['a','b']</code> for the doc <code><tag att1='a' /><tag att1='b' /></code>.</p>
<p>Even though the question seems straight forward enough, I've added more info here to pass the automated quality standards on the question submission form.</p>
<p>The actual case I'm working on is to list an array of all the images used in an html doc (not the tags, but the actual locations of the images). So the desired result will be something like <code>["http://mywebsite.com/path_to_image_1.jpg", ...]</code> for a document that contains snippets like:</p>
<pre><code><img src="http://mywebsite.com/path_to_image_1.jpg" />
<img src="http://mywebsite.com/path_to_image_2.jpg" />
</code></pre>
<p>I really don't want to have to list all the tags, then iterate manually to get the src attribute.</p>
|
javascript jquery
|
[3, 5]
|
2,288,121
| 2,288,122
|
If I start a thread in the application startup process, will it keep running?
|
<p>If I start a thread in the Application_Startup event of my web application in ASP .NET and it contains an infinite loop doing some background work using sleep methods too, will it continue running forever, assuming no exceptions occur?</p>
|
c# asp.net
|
[0, 9]
|
2,025,025
| 2,025,026
|
Open a pdf after the viewer agrees to a disclaimer using jquery
|
<p>Before the viewer could see the pdf from a link, he/she has to agree to a disclaimer, that I have created as a pop-up. The pop-up works but the pdf does-not open after that. I think the syntax is wrong, So someone please correct it. Thanks.</p>
<pre><code><script type="text/javascript" src="../../Scripts/jquery.cookie.js" ></script>
<script type="text/javascript">
$(document).ready(function () {
if ($.cookie("Interm") == "1")
{
$('#mask').hide();
$('.window').hide();
$('a[href$="blah blah blah.pdf"]').attr('target', '_blank');
}
else{
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(document).width();
//Set heigth and width to mask to fill up the whole screen
$('#mask').css({ 'width': maskWidth, 'height': maskHeight });
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
$('#dialog').css('top', winH / 2 - $('#dialog').height() / 2);
$('#dialog').css('left', winW / 2 - $('#dialog').width() / 2);
document.getElementById("dialog").style.display = "block";
$('.window .close').click(function (e)
{
//expires after browser closes
$.cookie("Interm", "1");
e.preventDefault();
$('#mask').hide();
$('.window').hide();
$('a[href$="blah blah blah.pdf"]').attr('target', '_blank');
});
}
});
</code></pre>
<p>
</p>
|
javascript jquery
|
[3, 5]
|
5,643,310
| 5,643,311
|
Get simple name for the running application
|
<p>How can i make my code to show only the name of running application which i can kill, because in my code it show the package name and that is very confusing for the user. And also, i want it to have an icon beside the application so that the user will identify it easily. i got this code from the internet and i used it for my project. Here is my code:</p>
<pre><code> private List<TaskObject> getTasksToKill() {
List<TaskObject> tol = new ArrayList<TaskObject>();
for (int i = 0; i < adapter.getCount(); i++) {
TaskObject to = adapter.getItem(i);
if (to.isToKill()) {
tol.add(to);
}
}
return tol;
}
public void loadRunningProcesses() {
ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> appinfolist = activityManager
.getRunningAppProcesses();
Log.d(TAG, "AppInfoList Size: " + appinfolist.size());
for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : appinfolist) {
TaskObject runningtask = new TaskObject();
runningtask.setPid(runningAppProcessInfo.pid);
runningtask.setProcessName(runningAppProcessInfo.processName);
adapter.addTask(runningtask);
}
}
class TaskObject {
int pid;
String processName;
private boolean toKill;
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public boolean isToKill() {
return toKill;
}
public void setToKill(boolean toKill) {
this.toKill = toKill;
}
}
}
}
</code></pre>
<p>Hoping for all of your answers and recommendation. Thank you for all of your help :) </p>
|
java android
|
[1, 4]
|
1,227,384
| 1,227,385
|
Back navigation with pushstate and load in jQuery
|
<p>I'm currently using jQuery to dynamically load content into a holder div and then updating the url with pushstate.</p>
<p>I have the following code so far (some excluded for example simplicity):</p>
<pre><code>$("body").on("click", "a:not(.noclick)", function(){
history.pushState({path: $(this).attr("href")}, "", $(this).attr("href"));
$("#main").load($(this).attr("href"));
return false
});
</code></pre>
<p>It works as expected and the url changes to what it should be on new content load but the back button is currently unfunctional, when back is pressed the url changes to the previous but nothing else happens.</p>
<p>I have pages built in a way that you can either use the site with jQuery to load content without headers or without any javascript and pages display from their urls so there's no issue in that part.</p>
<p>Is there a way I could use load on back navigation to load the last pushstate history? I'd prefer to not use hashing but not sure if it's possible without?</p>
<p>Facebook seems to do this with their navigation if that helps?</p>
|
javascript jquery
|
[3, 5]
|
1,096,387
| 1,096,388
|
Distance of Lat & Long in android
|
<p>I have an doubt in java..hope i need a code for my application.
Consider a taxi application, i want to get distance between two travelled places by taxi using latitude and longitutude..</p>
<p>I saw some examples in stack overflow,it is not sufficient to do my application...</p>
<p>Assume there are two buttons,
start & stop </p>
<p>if i press start,it needs to start monitoring the distance
if i press stop,it needs to stop monitoring the distance and calculate overall distance</p>
<p>for example:
i am starting from 'a' & distance is 0000
i stopped in 'b' & distance is 0364</p>
<p>i want to get display like above mentioned in example
I want in android pls suggest me to get results
Results would be show as TextView..</p>
|
java android
|
[1, 4]
|
2,563,079
| 2,563,080
|
how to execute a web server app on a client machine
|
<p>I have some code that should do a system check to see if a machine is compatible with software. its uploaded to a web server. how can I get it to be run on a client machine if some one tries to do the system check on our website? </p>
<p>the code works as it should but I am not sure how to get it running on the website. Thanks for any help given. </p>
<p>its a scenario where You visit on a website, and want to know if your computer can run their software. You should be able to click a button which activates the check and displays the results. my code is in c#.</p>
|
c# asp.net
|
[0, 9]
|
1,487,921
| 1,487,922
|
Is there an error in this jquery file?
|
<pre><code>$(document).ready(function(){
/* fetch elements and stop form event */
var submitData = $("form.follow-form").submit(function (e) {
/* stop event */
e.preventDefault();
/* "on request" */
$(this).find('i').addClass('active');
/* send ajax request */
$.ajax({
type: "POST",
url: "recycle.php",
data: submitData,
dataType: "html",
success: function(msg){
if(parseInt(msg)!=0)
{
/* find and hide button, create element */
$(e.currentTarget)
.find('button').hide()
.after('<span class="following"><span></span>Recycled!</span>');
}
}
});
});
});
</code></pre>
<p>I think there is an error in this jquery syntax and or it could be my php code, I cant seem to find it!!</p>
<p>this is the recycle.php</p>
<pre><code><?php session_start();
include_once ('includes/connect.php');
$id = $_POST['id'];
$tweet =$_POST['tweet'];
mysql_query("INSERT INTO notes SET user_note='".$_POST['tweet']."',dt=NOW(),recycle_id='".$id."', user_id = '".$_SESSION['user_id']."' ");
?>
</code></pre>
<p>and this is the html code</p>
<pre><code><form class="follow-form" method="post" action="recycle.php">
<input name="id" value="$id" type="hidden">
<input name="tweet" value="$tweet" type="hidden">
<button type="submit" value="Actions" class="btn follow" title="123456">
<i></i><span>recyle</span>
</button>
</form>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,346,745
| 5,346,746
|
Open a new window using Hyperlink NavigateUrl property inside gridview
|
<p>I have a grid.<br>
Inside the grid I have a column name as <code>Document name</code>, this document contains all documents with file name <code>indra.pdf</code>.<br>
My requirement is when I click on document name I want to open the document in a new window.<br>
While I am saving my documents in Tables I am also saving in client side folder.</p>
<p>Please any can help me.</p>
|
javascript asp.net
|
[3, 9]
|
829,984
| 829,985
|
Trigger Pusher event from javascript
|
<p>I am using <a href="http://pusher.com/docs/quickstart" rel="nofollow">Pusher</a> for real-time page update for my static JavaScript app. when i tried to invoke trigger event its not responding anythin. here is my code</p>
<pre><code>var pusher = new Pusher('5f5ebdf0612fbafff349');
var myChannel = pusher.subscribe('channel_1')
myChannel.trigger("say_hello", {'name':"Jai", 'age':22});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,515,763
| 3,515,764
|
How to validate a textbox to check if the value entered is in multiples of 100 only
|
<p>I want to validate that the value entered by a user in a textbox is a multiple of 100 using jQuery. How can I do that?</p>
|
javascript jquery
|
[3, 5]
|
2,048,379
| 2,048,380
|
Get item from entity framework by ID
|
<p>Simple question. I have entity Customer in my edmx model. I need to get the customer with Id = 20 in c#. How do I do that?</p>
|
c# asp.net
|
[0, 9]
|
1,238,441
| 1,238,442
|
storing a dynamic array of values inside an object looped within a for statement
|
<p>I am looking to create a set of dynamically created arrays stored inside an object. the outcome would be something similar to this... </p>
<pre><code>object.array0.length = 5, object.array1.length = 4, etc
</code></pre>
<p>the name of the array would be generated from within a for loop based on a numerical value declared elsewhere in the application.</p>
<p>Here is the code that I have...</p>
<pre><code>var obj = {};
var weekNum = 4;
for(i=0; i < weekNum.length;i++) {
obj['week'+i] = [];
obj['week'+i].push(day);
console.log('days stored in week0: '+obj.week0.length);
}
</code></pre>
<p>What seems to be happening is that <code>obj['week'+i]</code> doesn't realize that it is an array, and the push command doesn't seem to be enough to make it think so. So as a resulting value of <code>obj.week0.length</code> is always 1 with the actual value just being replaced each time as opposed to the array being incremented.</p>
<p>Also fyi,
The parameter <code>day</code> in the above code would be passed in from another function representing any chosen day (Mon, Tues, etc)... However, the sequence and the amount of days passed in could differ but will never exceed 5 (m-f).</p>
|
javascript jquery
|
[3, 5]
|
1,455,637
| 1,455,638
|
Change picture on mouse hover
|
<p>How to set in <code>ASP.NET</code> for <code>ImageButton</code> to change picture on mouse hover?</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,550,436
| 2,550,437
|
Check if first time someone goes to asp.net website?
|
<p>Hello I am creating a basic counter that adds +1 everytime someone accesses the website. The problem is it adds 1 everytime someone goes to another page on the site, not when the person goes to the site for the first time, making the data very inaccurate (ex. One user that accesses the site may go to 8 different pages, therefore adding 8 to the counter, insead of 1). Is there a way to detect when a user is accessing the site on the first initial load?</p>
<p>I'm using asp.net 3.5 in C#.</p>
|
c# asp.net
|
[0, 9]
|
3,786,895
| 3,786,896
|
How to remove PROTOCOL from URI
|
<p>how can I remove the protocol from URI? i.e. remove HTTP</p>
<p>thanks</p>
|
c# asp.net
|
[0, 9]
|
1,347,079
| 1,347,080
|
Java webpage from a java class or method
|
<p>Say I have a java class with a method in that class which returns an integer. Now I want to have a webpage (Eg. HTML page) which would access this class and then method and display the result. </p>
<p>how do I do this? What do i learn to do it? first of all what's this called? servlet? applet? what?</p>
<p>Sorry. I know basic java.. but new to this thing...</p>
|
java javascript
|
[1, 3]
|
4,993,447
| 4,993,448
|
jQuery $.ajax function stops mid execution
|
<p>I'm making an attempt at a RESTful application but my $.ajax function stops in the middle of its execution.</p>
<pre><code>function addEntry()
{
$.ajax({
type: 'POST',
contentType: 'application/json',
url: passAPI,
dataType: "json",
data: dataToJSON(),
success: hideform
})
}
function hideform()
{
$('#form').hide();
}
</code></pre>
<p>The data is put correctly in the database but the form doesn't get hidden. Anyone know why that happens ?</p>
|
javascript jquery
|
[3, 5]
|
1,029,844
| 1,029,845
|
Tutorial for porting php app to Android?
|
<p>Does anyone know a tutorial or book that gives a good step-by-step for porting a web browser based PHP application to an Android app? I've seen some stuff for the various steps that are required but nothing that ties it all together. Basically, I have a PHP app that works fine in my browser on my PC, but I want to create an app for Android phones. Here's what it does in Chrome:</p>
<ol>
<li>User logs in (if not yet logged in), hosted (remote) database looks
up UserID and sets a cookie on the client. If a user doesn't have an
account, they can register an email address and password to create
an account.</li>
<li>UserID is used to pull n rows of data and display them on a page, ie 3 rows with 3 columns in each row. This is dynamic and could be 12 rows of 3 columns.</li>
<li>User can click on any row to get a detail view of that row information.</li>
<li>Android camera using QR Reader app (can I build this into my app?) can snapshot a QR code, which leads to a URL that updates a row in the remote database, returns updated row information to the client (ie row 5 column 3 gets set to a value of +1 or -10)</li>
<li>It would be handy to store the database values locally on the Android device, but it's absolutely required to be updated in the remote database. Therefore a local sqlLite db isn't really needed.</li>
</ol>
<p>That's pretty much it. Also, I assume the trickiest part here is working with the QR code. I've tried running the app through the Android browser but it always caches and I can't add anything to the URL string because the QR code is set to a specific URL, so I need to totally refresh the browser activity each time for the database change to take effect. I'd also like to keep the URL stuff hidden so that people can't update the data without the QR code (by just refreshing the browser).</p>
<p>If anyone knows on online example/tutorial of this or even a book that deals with porting PHP stuff (or any server-side scripting) to Android, I'd appreciate it.</p>
<p>Thanks in advance!</p>
|
php android
|
[2, 4]
|
2,162,262
| 2,162,263
|
Making a Javascript game, Having a little problem with scrolling
|
<p>I have a <code>#wrapper</code> div and a <code>#grid</code> div nested inside. currently I can scroll around with this function below.</p>
<pre><code>getCursorPos : function(){
// set the empty cursor object
var cursor = {};
//get the offset from the left of the grid container
var grid
//offset loop
$(function getCursorPos(){
grid = $('#grid').offset();
setTimeout(getCursorPos, game.loopSpeed);
});
//continuosly get the position
var that = this;
$(document).mousemove(function(e){
//if game mode is menu exit
if(game.mode === 'menu'){
return;
}
// NOTE: this looks a litle over done but don't remove anything
// its like this because javascript uses floating points
// and so in order to line up to the nearest hunderedth I
// had to make the cursor and div position intergers by
// muliplying by ten. one the two are added I reduced them
// and rounded them.
that.x = Math.round(((e.pageX * 10) - (grid.left * 10)) / 10);
that.y = Math.round(((e.pageY * 10) - (grid.top * 10)) / 10);
});
},
</code></pre>
<p>the problem is that the mouse coordinates only update when the mouse moves. is there any way to get the coordinates with out moving the mouse?</p>
|
javascript jquery
|
[3, 5]
|
5,709,964
| 5,709,965
|
How to disable initial mouseover
|
<p>With jQuery (or pure javascript), if you set a <code>mouseover</code> handler, it will be triggered even if the mouse is initially on the element. How to disable that?</p>
<p>For example, look at facebook - place your mouse over the name of a friend in the feed. A hovercard appears. Now refresh the page (without moving the mouse; F5) - the hovercard does not appear.</p>
|
javascript jquery
|
[3, 5]
|
2,887,043
| 2,887,044
|
Using jquery, how to I animate adding a new list item to a list?
|
<p>I have a simple javascript function that allows me to add an item to a list. Note that I use JQuery...</p>
<pre><code>function prependListItem(listName, listItemHTML)
{
//Shift down list items...
$("#" + listName + " li:first").slideDown("slow");
//Add new item to list...
$(listItemHTML).prependTo("#" + listName)
}
</code></pre>
<p>The 'listName' is simply an <code><ul></code> with some <code><li></code>'s.</p>
<p>The prepending works fine, but I can't get the slideDown effect to work. I would like the list items to slide down and the new item to then appear on top. Any ideas how to accomplish this? I'm still new to JQuery...</p>
|
javascript jquery
|
[3, 5]
|
2,818,284
| 2,818,285
|
android to create a with device name as filename in php server and updating it every one hour
|
<p>I need an android code to create a file in php server with file name as device imei no and update it every one hour with out creating any local file in device..Please help me in this . . i need the php code also . . dont ve exp in writing php scripts.</p>
|
php android
|
[2, 4]
|
5,299,408
| 5,299,409
|
How to compare two dates in JQuery?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/492994/compare-2-dates-with-javascript">Compare 2 dates with JavaScript</a><br>
<a href="http://stackoverflow.com/questions/1657733/compare-two-dates-in-javascript">Compare two dates in JavaScript</a> </p>
</blockquote>
<p>I am new to jQuery and I want to compare two dates,</p>
<p>e.g. <code>var date1 = '2011-01-12';
var date2 = '2011-01-15';</code></p>
<p>I tried but could't find a solution. </p>
|
javascript jquery
|
[3, 5]
|
5,939,746
| 5,939,747
|
jQuery infinite loop w/ tablesorter
|
<p>Got myself in a funny situation: page has three tables. Using sortEnd, any time you sort one table, it sorts the other three. However, since I bound sortEnd to the function that does the sorting, you get a infinite loop of sorting/resorting. It looks like:</p>
<pre><code>$("table.tablesorter").tablesorter({widgets: ['zebra']}).bind("sortEnd", function() {
$(this).find("th.headerSortDown,.headerSortUp").each(function(i) {
index = $(this).attr("cellIndex");
order = ($(this).is(".headerSortDown")) ? 1 : 0;
$("table.tablesorter").tablesorter({sortList: [[index,order]]});
});
});
</code></pre>
<p>Any tips on how to clean this up?</p>
<p><strong>Based on feedback below from <a href="http://stackoverflow.com/users/13249/nick-craver">Nick Craver</a>, the following code seems to work well:</strong></p>
<pre><code>$("table.tablesorter").tablesorter({widgets: ['zebra']}).bind("sortEnd", function() {
var current = $(this);
if (current.data("sorting")) {
current.data("sorting", false);
return false;
}
$(this).find("th.headerSortDown,.headerSortUp").each(function(i) {
index = $(this).attr("cellIndex");
order = ($(this).is(".headerSortDown")) ? 1 : 0;
$("table.tablesorter").not(current).data("sorting", true).trigger("sorton", [[[index,order]]]);
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,505,193
| 2,505,194
|
how do i wrap the input with a div with jquery
|
<p>I have this format</p>
<pre><code><td class="value">
<input type="text" size="30" name="application[name]" id="application_name" data-validate="true" class="name">
</td>
</code></pre>
<p>and with jquery i need the final result to be this</p>
<pre><code><td class="value">
<div class="field_with_errors">
<input type="text" size="30" name="application[name]" id="application_name" data-validate="true" class="name">
<label style="color: rgb(204, 0, 0);" class="message" for="application_name">Required</label>
</div>
</td>
</code></pre>
<p>As you can see i have a wrapping div....i dont think i can achieve this with prepend. Here is my jquery so far and as you can see i have the input</p>
<pre><code> var form = $(".applications_form");
var company_name = form.find(".name");
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,491,460
| 4,491,461
|
Why doesn't this JavaScript evaluation work?
|
<p>I only want to execure a ceratin code IF three input fields do not have empty values. So why doesn't this code work:</p>
<pre><code>if($("#field1").val() != "" && $("#field2").val() != "" && $("#field3").val() != "")
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,698,961
| 1,698,962
|
javascript jquery .each() problem
|
<p>I have some form input elements with class <em>.commission_plan</em> and different IDs. I need to sum up this element's values. I use this code:</p>
<pre><code>jQuery(document).ready(function() {
var total = 0;
$('.commission_plan').each(function() {
total = total + parseFloat($(this).val());
});
$('#payment_total_amount_hidden').val(total);
$('#payment_total_amount').text('Total: ' + total);
}):
</code></pre>
<p>In my input fields are the values 3.45 and 4.65. But why does <em>#payment_total_amount</em> contain 8.100000000000001? Very strange behavior.</p>
|
javascript jquery
|
[3, 5]
|
1,549,131
| 1,549,132
|
How can I create Editable GridView like Spreadsheet?
|
<p>How can I create Editable GridView like Spreadsheet? (On asp.net 2005)</p>
|
c# asp.net
|
[0, 9]
|
39,882
| 39,883
|
How to change/ get new Session value in a click?
|
<p>I have a session value and stored it in a text box.
and i want to change/get new value on that by a click on a link of any button.
{
</p>
<p> </p>
<pre><code> <td valign="top">
<input type="button" id="msg" name="msg"style="background:url(images/bg7.jpg) no-repeat; border: none; color:#FFFFFF; font-family:Arial, Helvetica, sans-serif; width:100px; height:35px;font-size:28px;" value="<?php echo $_SESSION['security_code'];?>" />
</td>
</code></pre>
<p></p>
<pre><code><td height="30" valign="top" ><small>Can't read the image?</small> </td>
<td valign="top">click <a href=''><small>here</small></a><small>to refresh</small></td>
</tr>
</code></pre>
<p>}</p>
<p>If you find any solution, please let me know.</p>
|
php javascript
|
[2, 3]
|
1,258,345
| 1,258,346
|
"state information is invalid for this page" error
|
<p>I have an error comes up in aspx page:</p>
<p>The state information is invalid for this page and might be corrupted.</p>
<p>What would be the problem?</p>
|
c# asp.net
|
[0, 9]
|
5,423,463
| 5,423,464
|
How do I make the website execute links?
|
<p>I'm making a small webpage that is going to execute links, en specifics magnet links. But the webserveruserrole does not carry enough mojo (rights, <code>Process.Start()</code>) to make that happen.</p>
<p>I've tried to look for this user role but could not find it.</p>
<p>How do I make the webserver execute/start <code>magnet:?xt</code> links?</p>
|
c# asp.net
|
[0, 9]
|
5,219,156
| 5,219,157
|
Filtering by date and time C#
|
<p>I'm creating reports in C# ASP.Net, whereby in the reports I can filter data created between two different dates (e.g Start date: 15th July and End date: 17th July) but when it comes to filtering data created on a particular day (e.g StartDate: 15th July and End Date: 15th July) the query doesn't retrieve anything...</p>
<pre><code>//Code from OutletDistributor.aspx.cs
ReportManager master = ObjectFactory.GetInstance<ReportManager>();
ReportResponse responce = new ReportResponse();
if (ddDistributor == Guid.Empty)
responce = master.GetAllOutletDistributor(sDate, EDate);
else
responce = master.GetOutletDistributor(sDate, EDate, ddDistributor);
ReportViewer1.Reset();
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.ProcessingMode = ProcessingMode.Local;
var stream = Assembly.GetAssembly(typeof(SampleReport)).GetManifestResourceStream(responce.ReportResource);
ReportDataSource reportDataSource = new ReportDataSource(responce.ReportDataSet, responce.ReportDataSource);
stream = RdlcReportHelper.TranslateReport(stream);
ReportViewer1.LocalReport.DataSources.Add(reportDataSource);
ReportViewer1.LocalReport.LoadReportDefinition(stream);
ReportViewer1.LocalReport.DisplayName = ResourceHelper.GetText(null, "hq.rpt.outletdist.heading");
ReportViewer1.LocalReport.Refresh();
//Code from ReportManager.cs
//Filter All Outlet Distributor
public ReportResponse GetAllOutletDistributor(DateTime StartDate, DateTime EndDate) {
ReportResponse report = new ReportResponse();
report.ReportResource = "Distributr.HQ.Lib.Reports.RcdlFiles.OutletDistributor.rdlc";
List<OutletReportItem> Report = _outletReport.GetAllOutlets()
.Where(p => p.CreationDate >= StartDate && p.CreationDate <= EndDate).ToList();
Report.ForEach(n => report.ReportDataSource.Add(n));
report.ReportDataSet = "dsOutletDistributor";
return report;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,507,619
| 2,507,620
|
how to get respective image in url for asp.net website
|
<p>I need to get our company image before the url in asp.net website
for example in google <a href="http://www.google.co.in/" rel="nofollow">before</a> google image appeears</p>
|
javascript asp.net
|
[3, 9]
|
4,857,913
| 4,857,914
|
canvas.drawText question
|
<p>i am drawing text in my custom view in android using canvas.drawtext. i need to change back color, and want text right aligned. for example i want to print the text in a 10, 10, 100, 20 rectangle of color yellow and text color red and right aligned. how can i do that ?</p>
|
java android
|
[1, 4]
|
5,745,077
| 5,745,078
|
Automatically call common method whenever request made for any method of that class
|
<p>I am working in maintenance for one ASP.net + c# [.net version 3.5] application. Requirement is, through out the application whatever string variable passed to the DAL layer must be checked for some specified words and symbols. </p>
<p>In this case I have to go on each method and then each string parameter to check specific words and symbol and this will take a lot of time. So I am thinking one approach which I don't know possible or not like </p>
<p>Whenever request made to call any method of DAL layer class from BLL layer, common method which defined under DAL layer must be call automatically with all arguments which were passing to actual DAL method
(This common method I supposed to resisted on constructor of DAL).
In common method I supposed to check all string parameters and change their value if required and then after returning from this method actual method will call with changed value.</p>
<p>Please suggest me any other approach if this is not possible which has minimum effort.</p>
|
c# asp.net
|
[0, 9]
|
5,529,114
| 5,529,115
|
Jquery to a asp.net control
|
<p>I am trying to use jquery on an Asp.net control. In asp.net id get generated from server.
so I am trying to write a selector to use jquery.</p>
<pre><code> $(document).ready(function() {
$("#ctl00$cphBody$fv$txtDescription").val('blah');
});
</code></pre>
<p>I need if the id <strong>contains</strong> 'txtDescription', I need to change the value of that textbox.
Please suggest a selector for that</p>
|
jquery asp.net
|
[5, 9]
|
4,442,055
| 4,442,056
|
i'm getting CultureInfo.InvariantCulture format for MM/dd/yyyy. but i want to get dd/MM/yyyy format what i do that
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/12986114/get-the-system-date-and-split-day-month-and-year">get the system date and split day,month and year</a> </p>
</blockquote>
<p>getting CultureInfo.InvariantCulture format for MM/dd/yyyy. but i want to get dd/MM/yyyy format and i want to split the day and month and year.</p>
<p>Here is my code :</p>
<pre><code>string sDate = string.Empty;
DateTime _date = DateTime.Now;
DateTime dateFormat = Convert.ToDateTime(_date.ToString(CultureInfo.InvariantCulture));
int count = 0;
string format = "dd/MM/yyyy";
sDate = dateFormat.ToString(format);
string[] Words = sDate.Split(new char[] { '/' });
foreach (string Word in Words)
{
count += 1;
if (count == 1) { Day = Word; }
if (count == 2) { Month = Word; }
if (count == 3) { Year = Word; }
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
457,135
| 457,136
|
ASP.NET : What exactly is affected when Javascript is off?
|
<p>I've heard different stories about ASP.NET and JavaScript: that it works fine with Javascript turned off, that only some parts don't work, and that nothing works at all.</p>
<p>How exactly are ASP.NET applications affected if JavaScript is turned off in a client's browser? What parts don't work (if any)?</p>
<p>For example, will RequiredFieldValidators still work? What about UploadControls? AJAX UpdatePanels and AsyncPostBack's? FileUploads? Do page codebehinds still run?</p>
<p>Forgive my ignorance, I can't seem to find much about the issue that is in-depth.</p>
|
asp.net javascript
|
[9, 3]
|
1,871,711
| 1,871,712
|
String.fromCharCode & CharacterSets
|
<p>I recently tried to mirror some input within input(text) fields.
Using</p>
<pre><code> String.fromCharCode(event.which)
</code></pre>
<p>for instance, translates all 'standard' characters correctly. Well it translates them all
to uppercase, but that you can easily catch by looking up the shift key aswell.</p>
<p>My Problem is, it can't translate characters like dots, commas, questionmarks etc.
First guess was that I have to define a character encoding set, but that does not seem to help. Maybe it'm completly off?</p>
<p>Kind Regards</p>
<p>--Andy</p>
|
javascript jquery
|
[3, 5]
|
4,970,215
| 4,970,216
|
What is equivalent to a php page setup in asp.net
|
<p>I program php, but I am trying to get into c# asp.net. In php I can make forms, custom html, etc into a seperate php file and just <code>include</code> it on the page that I desire. I understand asp.net has a master page which allows you to set the template for the whole website, but what If I want just a row of buttons to be on SOME pages, and not all? something separate to the master page that can be included on any page i desire? Also when its controllers is that when I use .ascx?</p>
|
c# php asp.net
|
[0, 2, 9]
|
3,048,575
| 3,048,576
|
Moving Beyond Factories in Python
|
<p>Coming to Python from Java, I've been told that factories are not Pythonic. Thus, I'm looking for <strike>a</strike> the Python way to do something like the following. (I'm oversimplifying my goal so that I don't have to describe my entire program, which is very complicated).</p>
<p>My script will read in names of people (along with some information about them) and, from this, construct objects of type Person. The names may be repeated, and I only want one Person instance per name. These People may also belong to subclasses Man and Woman.</p>
<p>One way to do this would be to create a PersonFactory which would either return a newly instantiated Man or Woman <em>or</em> a reference to the previously instantiated Man/Woman with the same name. The other would be to create a set of all Person objects and check each time for the presence of a Person with the given name before instantiating a new object. Neither approach strikes me as Pythonic, though. The first seems a bit too cumbersome for Python (creating a whole class just to handle creation of another object? Really?) and the second will get expensive quickly, as I have a lot of names to process.</p>
|
java python
|
[1, 7]
|
4,227,910
| 4,227,911
|
Is it necessary to understand C# before going into ASP.NET?
|
<p>Do I have to get some C# class before taking ASP.Net programming lessons?</p>
|
c# asp.net
|
[0, 9]
|
1,918,196
| 1,918,197
|
Sort two Lists<T> together as one?
|
<p>I have two List which I am accessing by index (e.g. <code>Name[10]</code>, <code>Date[10]</code>). They're closely tied, so <code>Name[10]</code> is related to <code>Date[10]</code> and vice versa. </p>
<p>This design has worked well but now I need to sort them. I can sort them both individually but obviously that would remove the relationship between the two lists and make them worthless. </p>
<p>I thought about using a <code>Dictionary<string, DateTime></code> instead but it seems I can only access that by Key (which is also unworkable). Essentially I need three things, two values and one index which I can iterate through numerically (not <code>foreach</code>). </p>
<p>Can anyone help? It seems I either need to change data-structure or work out how to sort two distinct <code>List<T></code> together... </p>
<pre><code>public class Results
{
public List<string> Name { get; set; }
public List<DateTime> Date{ get; set; }
}
for (int x = 0; x < results; x++)
{ z.N = results.Name[X]; z.D = results.Date[x]; }
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,076,473
| 4,076,474
|
What are the pros and cons of calling jQuery functionality via these 2 different methods?
|
<p>I'm trying to understand what the differences are (if any) between these 2 ways of calling JavaScript/jQuery functions.</p>
<p>Method 1, in <code>document.ready()</code>:</p>
<pre><code>$('body').on('click', 'a.popup', popup);
</code></pre>
<p>then</p>
<pre><code>function popup() {
$(this) // do something
}
</code></pre>
<p>Method 2, in <code>document.ready()</code>:</p>
<pre><code>popup();
</code></pre>
<p>then</p>
<pre><code>function popup() {
$("a.popup").click(function (e) {
// do something here
});
}
</code></pre>
<p>All advice appreciated.</p>
|
javascript jquery
|
[3, 5]
|
4,895,022
| 4,895,023
|
Strange behavior when converting a double to String in Java
|
<p>I have a crash in my Android application coming from a strange behavior in a SQL query string construction. Here is the error:</p>
<pre><code>Caused by: android.database.sqlite.SQLiteException: near ")": syntax error: , while
compiling: SELECT [...], (0.6773931613745379*coslat*(coslng*0.9999276712889913
+sinlng*0.012027143*)+0.7356211694364222*sinlat) [...]
</code></pre>
<p>The errors comes precisely from here: <code>sinlng*0.012027143*)</code> <== *) at the end</p>
<p>This string is builded by the following function:</p>
<pre><code>public static String buildDistanceQuery(double latitude, double longitude) {
final double coslat = Math.cos(MathUtils.deg2rad(latitude));
final double sinlat = Math.sin(MathUtils.deg2rad(latitude));
final double coslng = Math.cos(MathUtils.deg2rad(longitude));
final double sinlng = Math.sin(MathUtils.deg2rad(longitude));
return "(" + coslat + "*" + LocationColumns.COSLAT
+ "*(" + LocationColumns.COSLNG + "*" + coslng
+ "+" + LocationColumns.SINLNG + "*" + sinlng
+ ")+" + sinlat + "*" + LocationColumns.SINLAT
+ ")";
}
</code></pre>
<p>As you can see, <code>LocationColumns.SINLNG + "*" + sinlng + ")"</code> becomes <code>sinlng*0.012027143*)</code> and I really don't see how this could be possible as sinlng is a double...</p>
<p>I cannot reproduce the problem, the crash comes from Android Market console and I do not have all the context. It is not a unique crash, I got multiple occurences.</p>
<p>I can try to use a StringBuilder() but I'm not sure it will correct the issue.</p>
<p>Do someone has a clue of how a double can generate a "*" when converted to String?</p>
|
java android
|
[1, 4]
|
3,844,057
| 3,844,058
|
ASP.NET .aspx page: how to send extra data back via Javascript?
|
<p>I have an old-fashioned ASP.NET plain .aspx page.
It has some server-side controls, some buttons to postback, etc.</p>
<p>I'm going to add some Javascript on the client side to create a list of extra data that the user builds.
I don't know beforehand how much of this extra data will be sent. So I can't, for example, just add 10 hidden input fields and check their values in the codebehind.</p>
<p>There might be 20 values sent back, there might be 100.</p>
<p>What's the best way to POST this extra data back to the server?</p>
<p>One way I can imagine it working is to add some dummy hidden list controls, to be filled in by JS on the client. It feels hacky, but I think I could make it work.</p>
<p><strong>Is there a better way?</strong></p>
<p>Some things to note:</p>
<ul>
<li>I'm not using MVC or AJAX</li>
<li>Not using JQuery (though I could, I suppose)</li>
</ul>
<p>I'm really just trying to get a handle on my options.</p>
<p>Thanks!</p>
|
javascript asp.net
|
[3, 9]
|
4,017,153
| 4,017,154
|
Game Programming as Hobby, should I use Java or C++
|
<p>Presently, i am learning Java from the book The Art and Science of Java and following Standford's Programming Methodology Course.</p>
<p>I would like to do game programming, but only as a hobby. </p>
<p>I was thinking, would Java be a good choice or is C++ the defacto in game programming. </p>
|
java c++
|
[1, 6]
|
3,852,477
| 3,852,478
|
Get number of pictures using URL and Directory.GetFiles
|
<p>I want to get the number of pictures that is in a folder on a website. But I can't find a way to do it.</p>
<p>I have tried to use </p>
<pre><code>string a = Request.QueryString["nr"];
string[] filePaths = Directory.GetFiles(@"URL" + a, a + "_profil*");
</code></pre>
<p>But it doesn't work. I get the error:</p>
<p>Exception Details: System.ArgumentException: URI formats are not supported.</p>
|
c# asp.net
|
[0, 9]
|
1,095,767
| 1,095,768
|
state of activity saving in android when home button pressed
|
<p>I am having an issue related to home key . when i press home key all current activity gets hidden . but when i press the executable it again starts from the fisrt screen . I have overidden all methods onsaveInstaceState opPause onStop onResume
but there are still issues what is the right way to handle those conditions .
When i am pressing home button i am storing the widgets state in database and when i again click the exectable i am checking the database state and starting the new Intent as saved when user presses the home button .Is it the right way to do that as i am facing the problem when user does the same and again presses the back button , there is already on intent available in stack of activity .
Thanks in advance.</p>
|
java android
|
[1, 4]
|
3,920,777
| 3,920,778
|
Publishing website project, database date format will be the same or converted to the default host date format?
|
<p>I'm developing a web application and I'm using a gridview and sqldatasource.</p>
<pre><code>I have some columns with type : Date.
</code></pre>
<p>In my control panel I set the format of the date for my country wich is : <code>dd.mm.yyyy</code> </p>
<ul>
<li>In this case , the Table Data of the database in c# will have the
format for date : <code>dd.mm.yyyy</code></li>
</ul>
<p>I'm planing to publish my website on a host when I'll finish the project.</p>
<ul>
<li>But my question is :</li>
</ul>
<p>If in my database the columns with Date are in format dd.mm.yyyy , if I publish the database and use it with the website on the host , the dates will be dd.mm.yyyy or converted to the default format of the host?</p>
|
c# asp.net
|
[0, 9]
|
3,313,158
| 3,313,159
|
javascript: Avoid browser scrolling back to top on content insertion
|
<p>I thought this would be very easy to solve, but I can`t seem to find a solution anywhere.
It's a very annoying javascript 'feature?'. Every time I add content to a div the document gets scrolled back to top. How can I avoid this annoying behaviour?</p>
<pre><code>n = 0;
function addContent() {
div = document.getElementById('content');
for(var i = 0; i < 100; i++) {
n++;
div.innerHTML = div.innerHTML + n + '<br />';
}
}
</script>
</head>
<body>
<div id="content"></div>
<a href="#" onclick="addContent()">more content</a>
</code></pre>
<p>Ex: <a href="http://jsfiddle.net/hQP2q/" rel="nofollow">http://jsfiddle.net/hQP2q/</a></p>
|
javascript jquery
|
[3, 5]
|
1,614,530
| 1,614,531
|
BlockUI Prevent any rendering until unblock?
|
<p>I am using JQuery BlockUI plugin.
<a href="http://www.malsup.com/jquery/block/" rel="nofollow">http://www.malsup.com/jquery/block/</a></p>
<pre><code>eventDrop: function (event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {
$.blockUI();
$.ajax({
type: "POST",
url: "CalendarServices.aspx/UpdateDrop",
data: 'id=' + event.realid + '&start=' + $.fullCalendar.formatDate(event.start, 'yyyy-MM-dd') + '&resource=' + event.resource,
success: function (data) {
$('#calendar').fullCalendar('refetchEvents');
$.unblockUI();
},
error: function () {
$('#calendar').fullCalendar('refetchEvents');
$.unblockUI();
}
});
},
</code></pre>
<p>But it does not quite do what I need right now. I need it to prevent rendering rather than showing a message. This is because default rendering is called followed by my ajax call's rendering which looks odd. I only want to see the final result. Is there anything in BlockUI that can just block rendering of any new elements?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
2,783,895
| 2,783,896
|
How to assign and work with DOM elements as variables
|
<p>I would like to be able to assign an html element to a variable and then to work with it just like I'm working with the actual DOM element. </p>
<p>In this example, I want it so when showAlert() function gets called, it'll take the ID that is being passed, show the div, since it's default is hidden and set a text value inside the DIV. </p>
<p>What is the best way to do this?</p>
<p>HTML:</p>
<pre><code><div class="alert" id="myCustomAlert12345" style="display:none" >
</div>
</code></pre>
<p>Javascript:</p>
<pre><code>function showAlert(alertDivID, alertMessage, alerttype){
if(alertDivID&& alertMessage){
currentDiv = $('#'+alertDivID);
currentDiv.show();
currentDiv.html(alertMessage);
}
}
showAlert("myCustomAlert12345","some error message goes here","error");
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,764,615
| 5,764,616
|
Android Subclass Listview problem
|
<p>I have a subclass of ListView. My only problem is I can't get it to work (not the listview code, but the code to <em>use</em> the listview. Android won't inflate it (app crashes). I'm sure there is a simple way to get this to work, but I don't know how.</p>
<pre><code>PullToRefreshListView list;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.cliplistmain);
context = this;
list = (PullToRefreshListView)findViewById(R.id.clipListMain);
list.setOnItemClickListener(this);
list.setOnScrollListener(this);
list.setOnRefreshListener(new OnRefreshListener(){
@Override
public void onRefresh()
{
ClipStore.getInstance().getClips(SugarLoafContext.currentCamera);
}
});
Button btn = (Button)findViewById(R.id.findclipsbtn);
btn.setOnClickListener(this);
SugarLoafContext.lastView = SugarLoafContext.LAST_VIEW_CLIP_LIST;
}
</code></pre>
<p>Here is my xml:</p>
<pre><code><ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/clipListMain" >
</code></pre>
<p></p>
|
java android
|
[1, 4]
|
5,010,444
| 5,010,445
|
Advice, resources for developing first Android app
|
<p>So I have decided to develop my first app, it will essentially be an app for tracking your jogging times. You will create a "journy",name it,give the distance etc.You can create multiple journys. And in the journeys you will run a stopwatch and it will store your time when finished. You will be able to look at your current week and months average time. And each time you submit a time you will be told your time and whether you are improving or not,km/h etc.</p>
<p>Hopefully i would like all your times displayed in a certain way. Once you have created your journey,you should be able to click it and view a calender of current and previous months,with the times you ran under the days you ran them.</p>
<p>I am still thinking about the actual design of all these features.</p>
<p>But I have some questions for anyone here experienced in android development:</p>
<ol>
<li><p>What in your opinion, is the best forum/resource available for android development?</p></li>
<li><p>Android versions.The phone i will be getting and therefore doing the initial testing on will be 2.3 gingerbread. Should i be developing for a lower version android to ensure compatability on more phones? Will developing for a lower version limit the things I can do code wise?</p></li>
</ol>
<p>And any further advice you have for taking on my first project I would appreciate :)</p>
|
java android
|
[1, 4]
|
3,383,332
| 3,383,333
|
Add Session Value to HiddenField placed in web control
|
<pre><code><asp:HiddenField ID="mypostID" runat="server" Value=""/>
</code></pre>
<p>I wanted to ask if I could do something like:</p>
<pre><code><asp:HiddenField ID="mypostID" runat="server" Value="<% Response.Write(Session["ïd"])%>"/>
</code></pre>
<p>I cannot access the session from the user control code behind but if I put a Respose.Write on the page itself it shows the session value.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
3,623,911
| 3,623,912
|
WordPress Jquery Fade in, Fade out effect
|
<p>I'm following <a href="http://hv-designs.co.uk/2010/01/13/learn-how-to-add-a-jquery-fade-in-and-out-effect/" rel="nofollow">a tutorial</a>.</p>
<p>I've included the hover.js with the following code:</p>
<pre><code>$(function() {
// OPACITY OF BUTTON SET TO 50%
$(".imgopacity").css("opacity","0.5");
// ON MOUSE OVER
$(".imgopacity").hover(function () {
// SET OPACITY TO 100%
$(this).stop().animate({
opacity: 1.0
}, "slow");
},
// ON MOUSE OUT
function () {
// SET OPACITY BACK TO 50%
$(this).stop().animate({
opacity: 0.5
}, "slow");
});
});
</code></pre>
<p>But it doesn't work, on chrome it says:
<a href="http://i52.tinypic.com/4jnsdd.png" rel="nofollow">http://i52.tinypic.com/4jnsdd.png</a></p>
<p>Here's the site i'm working on: <a href="http://goo.gl/dlB1u" rel="nofollow">http://goo.gl/dlB1u</a></p>
<p>and this is the image wherein i applied the effect/css class:
<a href="http://i54.tinypic.com/6h1ds0.png" rel="nofollow">http://i54.tinypic.com/6h1ds0.png</a></p>
<p><em>sorry for posting image urls it says i can't post images yet on stackexchange</em></p>
|
jquery javascript
|
[5, 3]
|
5,830,711
| 5,830,712
|
jQuery / PHP mix up
|
<p>I have the following jQuery function in my PHP:</p>
<pre><code>echo '
function myFunction() {
return $.ajax({
type: "POST",
url: "mypage.php",
data: "name=John&location=Boston"
});
}
$.when(myFunction()).then(function(data) {
// handle data return
someOtherFunction(data);
// need to set "data" var into PHP SESSION
}, function(error) {
// handle ajax error.
});
';
</code></pre>
<p>After my AJAX does the majic it returns a value (data), which I pass into another function. In addition I need to be able to set that value into a PHP session:
<strong>$_SESSION['project'][data] = data;</strong></p>
<p>How do I do that? The switching between PHP and JS confuses me for some reason...</p>
|
php jquery
|
[2, 5]
|
1,627,035
| 1,627,036
|
Why parent element is undefined in Firefox only when onerror event of IMG tag is called?
|
<p>I am trying to unhide a DIV element if my extension in Firefox is not installed. </p>
<p>For this purpose i am using the following technique.</p>
<p>This doesn't work in Firefox. it says</p>
<p><strong>ExtensionNeeded is undefined.</strong> </p>
<p>I get the alert though. Please have a look at my code.</p>
<pre><code><div style="display: none;" class="alert alert-error" id="ExtensionNeeded">
<img style="visibility: hidden;
font-family: arial;" onerror="this.src='';alert('hello'); ExtensionNeeded.setAttribute('style','display:none;');" id="ffExt" src="">
<a onclick="ExtensionNeeded.setAttribute('style','display:none;');" data-dismiss="alert" class="close" id="CloseButton">×</a>
<h4 class="alert-heading">
Browser Extension Needed</h4>
<p>
SmartSignin needs browser extensions to work. Download the extensions by clicking
on the button below
</p>
<p>
<a onclick="window.location=('../Installer_files/release.xpi');ExtensionNeeded.setAttribute('style','display:none;');" class="btn btn-danger" id="ExtensionDownload" href="#">Download Extension!</a>
<a onclick="ExtensionNeeded.setAttribute('style','display:none;');" class="btn" id="DownloadLater" href="#">Download Later</a>
</p>
</div>
</code></pre>
<p>Please help. I am picking my hair out on this.</p>
|
javascript asp.net
|
[3, 9]
|
2,547,977
| 2,547,978
|
How is the "jQuery" var a function and an object?
|
<p>For example, when you use <code>jQuery('someDiv');</code>, it's a function, but you can also use <code>jQuery.ajax(...);</code>.</p>
<p>How is it possible?</p>
|
javascript jquery
|
[3, 5]
|
5,000,040
| 5,000,041
|
Asp.net webparts or portlet like functionality
|
<p>What is the best way to let other parties use your website as their own content using their own style ?</p>
<p>We have build a small website for a customer, asp.net, .net framework 3.0. Now the customer wants other parties to be aple to use our website in their own websites while maintaining the styling of the costumers website. </p>
<p>I have done nothing like this before and don't even know what to google, so any help is appriciated.</p>
<ul>
<li>I know you can do this with sharepoint, but to use sharepoint for such a small site seems like a lot of overkill</li>
<li>it sounds that portlets is a good name for what they want. but googling portlets draws me in the world of java and doesn't give me a lot of info on what the other parties would have to do to make it work.</li>
<li>a simple Iframe would probably take me a long way, but how can you get the styling done within an Iframe</li>
<li>webparts also sound interesting , but they seem more for in project sharing then letting people use them in their own site. </li>
</ul>
<p>It is a small website and the logic and backend communication is pretty good contained, so a complete rework of the frond-end is not a big problem.</p>
<p>Once again, any help is appreciated !</p>
|
c# asp.net
|
[0, 9]
|
3,295,213
| 3,295,214
|
jQuery focus not working with the plugin chosen
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/8281627/jquery-chosen-focus-on-page-load-onload">Jquery Chosen focus on page load (onLoad?)</a> </p>
</blockquote>
<p>i am using a jQuery plugin chosen (http://harvesthq.github.com/chosen/) to create more useful select boxes.</p>
<p>however, jQuery focus event is not working with this plugin.</p>
<p>my html code:</p>
<pre><code><select class="product">
<option value="1">Product One</option>
<option value="2">Product Two</option>
</select>
</code></pre>
<p>and javascript code:</p>
<pre><code>$('.product').chosen().focus();
</code></pre>
<p>it is not focusing the element..</p>
<p>here is my jsFiddle: <a href="http://jsfiddle.net/JigneshManek/queZ6/11/" rel="nofollow">http://jsfiddle.net/JigneshManek/queZ6/11/</a></p>
<p>is there any other method or event specified in the plugin to focus the element?</p>
|
javascript jquery
|
[3, 5]
|
5,233,820
| 5,233,821
|
Find exact value with jquery or javascript?
|
<p>I have a table that has a hidden column that contains ids. I use the value in this column and send it to the server so I can grab the correct record.</p>
<p>I am not using datatables.net and I allow the user to update the row. So they click on an edit button and a dialog pops up and they edit it. Once they hit update I send all the values back including the id(stored in a hidden text field).</p>
<p>So I need to update the datatable and the fast way I found is use a plugin for it that allows you to take an html row and pass it to the datatable(instead of passing each column value in an array).</p>
<p>So first I need to delete the row then add the newly update row.</p>
<p>I have one problem though I don't know how to figure out which row to delete.</p>
<p>I could have some global variable that would store the row object and when it is time to delete it use that object. However I really don't want to do this as I don't want a global variable just flying around if I can help it.</p>
<p>So the hidden column with the value has a class name that I use as a slector(class ="hidden").</p>
<p>So I am wondering how could I do a search to filter down to only table cells that have this class name, has the exact value(say 55 that I can use from the hidden textbox).</p>
<p>I was thinking of using jquery contains but that might get stuff that might have that number. I want an exact match.</p>
|
javascript jquery
|
[3, 5]
|
4,294,522
| 4,294,523
|
How does browser read the JavaScripts, which should come first (set on the top):event? function? or sub function
|
<p>A simple question.</p>
<p>I have a web project includes multi JavaScripts.</p>
<p>JS:</p>
<pre><code>// (1) Event
$('.input').keyup(function()
{
keyUpFunction();
});
// (2) Function
function keyUpFunction(){ ... }
</code></pre>
<p>(1),(2) which should come first in one javascript file? If the browser read the function first, does it store the funtion in memory and invoke it when scan the event. </p>
<p>In some case, the same function is defined in multi javascript . e.g.</p>
<pre><code>prm.add_endRequest(function() {
fn1();
fn2();
});
$(document).ready(.......)
</code></pre>
<p>Should I duplicate the function name and define each component in each js file.
or keep the function declare in one file and invoke sub-function composite the function?</p>
|
javascript jquery
|
[3, 5]
|
595,538
| 595,539
|
Can someone point me towards a practice C# / ASP.net website
|
<p>I'm looking for a C# / ASP.net website that I can download the source code and practice on, ideally it will come with documentation and hopefully some "bugs" or feature requests to try fixing. </p>
<p>Dose anyone know where to find such a website?</p>
|
c# asp.net
|
[0, 9]
|
5,270,185
| 5,270,186
|
How to display an alert if none of the case statements match?
|
<p>I have a case statement below where it checks for a file type in a file input which works correctly:</p>
<pre><code>function imageValidation(imageuploadform) {
var val = $(imageuploadform).find(".fileImage").val();
switch(val.substring(val.lastIndexOf('.') + 1).toLowerCase()){
case 'gif':
case 'jpg':
case 'jpeg':
case 'pjpeg':
case 'png':
return true;
default:
$(imageuploadform).find(".fileImage").val();
// error message here
alert("To upload an image, please select an Image File");
return false;
}
return false;
}
</code></pre>
<p>Now what happens is that if it matches one of the case statements then it returns true and by default it returns an alert which I want to use if file input is blank.</p>
<p>But how can I display this alert: </p>
<pre><code>alert("Image File Type is Incorrect. Must be either: \n (jpg, jpeg, pjpeg, gif)")
</code></pre>
<p>If the file input does not match with one of the file type cases above?</p>
|
javascript jquery
|
[3, 5]
|
3,236,357
| 3,236,358
|
c# for loop error in code
|
<p>I have the following code in c# and I am getting compilation error. Can anyone please help me?</p>
<p><strong>Update</strong></p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|OID.mdb;Persist Security Info=False;");
//OleDbConnection con = new OleDbConnection("Data Source=sml; User ID=sml; Password=sml; provider=OraOLEDB.Oracle");
OleDbCommand cmd = new OleDbCommand();
//cmd.CommandText = "Select * from EMAILS WHERE EMAIL= '" + GlobalData.Email + "'";
cmd.CommandText = "Select * from EMAILS";
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
foreach (DataRow row in ds.Tables[0].Rows)
{
String email = row["email"].ToString();
if (email == GlobalData.Email)
{
Label2.Text = GlobalData.Email;
Label1.Text = GlobalData.Name;
Label3.Text = GlobalData.LastName;
}
else
{
Response.Redirect("login.aspx");
}
}
}
</code></pre>
<p>Now it is directly going to else section after the loop what will be error now</p>
|
c# asp.net
|
[0, 9]
|
5,295,756
| 5,295,757
|
urlConnection.getInputStream() throwing EOFException
|
<p>I am executing the following code and always get an EOFException in urlConnection.getInputStream(). I know that the webserver is not returning proper headers, but if I use the same url in a web browser I get the expected content back.</p>
<pre><code>URL url1;
try
{
url1 = new URL("http://63.255.173.242/get_public_tbl.cgi?A=1");
HttpURLConnection urlConnection = (HttpURLConnection) url1.openConnection();
try
{
InputStream in = new BufferedInputStream(urlConnection.getInputStream());
readStream(in);
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
urlConnection.disconnect();
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
</code></pre>
<p>Any ideas?</p>
<p><strong>Edit 1:</strong></p>
<p>I thought I was on to a possible solution. I found that using Android 2.3 I can read the response by calling getHeaderFields() (even though there is no header), but if I use Android 4.1 getHeaderFields() returns null. Any ideas?</p>
<pre><code>url1 = new URL("http://63.255.173.242/get_public_tbl.cgi?A=1");
URLConnection urlConnection = url1.openConnection();
Map<String, List<String>> fields = urlConnection.getHeaderFields();
</code></pre>
|
java android
|
[1, 4]
|
1,326,388
| 1,326,389
|
extend 2 classes problem android
|
<p>i'm a junior programmer. I have a base class that extends activity, i use this class to set up the menu in my app. All my activity classes extends this base class. Now, i have a new class which extend ExpandableListActivity this class's purpose is to show an expandable list and of course when the user is viewing this activity the menu becomes unavailable. So how can i do to be able to use the menu while viewing the expandable list. I know that it's impossible to extend more than one class in Java, so what's the trick?</p>
<p>Thanks in advance </p>
|
java android
|
[1, 4]
|
5,891,613
| 5,891,614
|
Multi-line list view populated with arrays?
|
<p>I have three arrays and I want to populate list view with them, till now I managed to populate list view with one array and array adapter, but now I need to put all three arrays in every item of list view.
Simple code would help lots.
Thank you in advance.</p>
|
java android
|
[1, 4]
|
1,948,871
| 1,948,872
|
how to remove a method with a callback or otherwise
|
<p>I have the following code that animates an object with a delay of 800 ms:</p>
<pre><code>$('#navMenu').mousemove(function (e) {
thisX = e.pageX
if (thisX >= 1625) {
$('#prbBtnHolder').animate({ left: '-=150' }, 300).delay(800);
}
});
</code></pre>
<p>If the <code>#prbBtnHolder</code> has a certain <code>css left</code> property i want to be able to remove the <code>delay()</code>method and stop the animation. How do i do this? This is what I've tried so far:</p>
<pre><code>//...
$('#prbBtnHolder').animate({ left: '-=150' }, 300).delay(800);
if ($('#prbBtnHolder').css('left') < -100) {
$(this).animate({left: '-=0px'});
}
</code></pre>
<p>But this does not remove the <code>delay</code> method nor does it achieve the desired effect. Any other ideas?</p>
|
javascript jquery
|
[3, 5]
|
4,231,956
| 4,231,957
|
how to bring drag and drop operations for controls in runtime?
|
<p>For example i've developed a website which contains some controls like button,treeview,etc....Then how can i drag and drop those controls....while running that application....</p>
|
c# asp.net
|
[0, 9]
|
2,076,110
| 2,076,111
|
Set checkbox value from database in C# asp.net
|
<p>I have 8 <code>checkboxes</code>.<br/>
On the <code>page load</code> event I want to write the code such that<br/>
if the <code>value</code> in the <code>database</code> is <code>"Submitted"</code> the <code>checkbox</code> will appear <code>checked</code>.<br/>
If the <code>value</code> is <code>"Not Submitted"</code> it will appear <code>unchecked</code>.</p>
|
c# asp.net
|
[0, 9]
|
236,946
| 236,947
|
Toggle in javascript - Div toggle possibility
|
<p>What i want is that making an div toggle. Visible it or not.</p>
<p>this is my div</p>
<pre><code><div id="kullanici_ara" style="display:none;">
<form action="kullanicilar.php" method="get">
<label>Aramak istediğiniz kullanıcının adını giriniz</label><br />
<input type="text" name="ara"/>
<input type="radio" name="type" value="nick" checked="checked">Pasaj Adı</input>
<input type="radio" name="type" value="id" />Id</input>
<input type="radio" name="type" value="name" />Ad-Soyad</input>
<input type="radio" name="type" value="email" />E-posta</input>
<input type="radio" name="type" value="city" />Şehir</input>
<br /><br />
<label>Kullanıcıları puanlarına göre büyükten->küçüğe sıralamak için seçiniz.</label><br />
<input type="checkbox" value="puan" name="puansort"><br /><br />
<input type="submit" value="Ara" />
</form><br /><br />
</div>
</code></pre>
<p>Is there a way to toggle div according to id ? I mean a have a code like that</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("div").toggle();
});
});
</script>
</code></pre>
<p>Is there a way to write above code a id ? </p>
|
javascript jquery
|
[3, 5]
|
4,912,051
| 4,912,052
|
Dynamic select array in PHP
|
<p>I have a standard form array in PHP like this. I need to account for up to 10 hours of labor in 15 minute increments with 10 as a value for every 15 min or 40 per hour. Is it possible to automate this into some sort of array with PHP instead of hardcoding each of these values? It just seems like there should be a better way and I have no idea how to start?</p>
<pre><code><select size="1" name="labor" id="labor">
<option value="80">2 Hours</option>
<option value="70">1 Hour 45 min.</option>
<option value="60">1 Hour 30 min.</option>
<option value="50">1 Hour 15 min.</option>
<option value="40">1 Hour</option>
<option value="30">45 Minutes</option>
<option value="20">30 Minutes</option>
<option value="10">15 Minutes</option>
</select>
</code></pre>
|
php javascript
|
[2, 3]
|
1,623,220
| 1,623,221
|
whats wrong with this jquery
|
<p>I'm getting syntax error in firebug here is the code :</p>
<pre><code>$('#moderator-attention').live('toogle', function(){
function () {
$(".moderator-tex").show();
},
function () {
$(".moderator-tex").hide();
}
});
</code></pre>
<p>I want to create a toogle function, when button is clicked then textarea with class <code>moderator-tex</code> should appear .. and if other button is clicked then should be hidden .. </p>
|
javascript jquery
|
[3, 5]
|
5,074,686
| 5,074,687
|
prepend a div and hide it with this object
|
<pre><code><div id="newsSubmit"><b>Add random snippet</b></div>
<script>
$("#newsSubmit").click(function(){
$("body").append("<div class='lol'>Ok, DELETE this snippet (click here)</div>");
});
$(".lol").click(function(){
$(this).fadeOut();
});
</script>
</code></pre>
<p><a href="http://jsfiddle.net/apzdt/6/" rel="nofollow">http://jsfiddle.net/apzdt/6/</a></p>
<p>How can I fix it? It's not working</p>
|
javascript jquery
|
[3, 5]
|
2,017,049
| 2,017,050
|
search words highlight code not working correct
|
<p>i have used a piece of jQuery to highlight the search results, it works nice but i want to match all single words not the whole phrase that i have entered, if i search for "lorem ipsum dolor" it looks for this matching phrase, but i want that the script highlightes all of the single words and not the whole phrase</p>
<p>heres my jQuery code</p>
<pre><code> $("#main-search-input").bind('keyup', function(e){
var text = $.trim($(this).val());
if(text !== '' && text !== ' '){
var pattern = new RegExp(text, "gi");
}
$('.sr-results a').each(function(i){
var str = this;
var orgText = $(str).text();
orgText = orgText.replace(pattern, function($1){
return "<b class='sr-highlight'>" + $1 + "</b>";
});
$(str).html(orgText);
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,327,305
| 1,327,306
|
How to escape single quote in url query string with asp net
|
<p>I am building the url in my web application and I am trying to pass a name as a query string, Bob O'Neal, which to my surprise does not seemed to be escaped properly with UrlEncode and there seems to be nothing on the net which talks about how to handle this?</p>
<p>Is there an elegant solution to properly handle escaping single quotes in query strings?</p>
|
c# asp.net
|
[0, 9]
|
6,002,384
| 6,002,385
|
Prevent ddl from triggering unsaved changes warning while still executing OnSelectedIndexChanged event
|
<p>I'm using this jquery code to detect unsaved changes and warn users before they navigate away.</p>
<pre><code> var _changesMade = false;
$(document).ready(function () {
$('form').bind($.browser.msie ? 'propertychange' : 'change', function () {
_changesMade = true;
});
$(window).bind('beforeunload', function () {
if (_changesMade)
return 'There are unsaved changes which will be lost if you continue.';
});
});
</code></pre>
<p>It works fine except on a page where I have a cascading dropdownlist. I added this code to the asp:DropDownList control</p>
<pre><code>onChange = "_changesMade=false; return false;"
</code></pre>
<p>and it stops the warning, but it also stops the OnSelectedIndexChanged server code from executing, so now the second drop down is not being populated with the correct data. How can I prevent the popup and still execute the server code when the dropdownlist is changed?</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.