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 |
---|---|---|---|---|---|
3,489,520 | 3,489,521 | How should I give text to textbox which will displayed in textbox at runtime | <p>This is my aspx code </p>
<pre><code><asp:TemplateField HeaderText="Column Name">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" AutoPostBack="false" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</code></pre>
<p>this is my cs code</p>
<pre><code> int rowIndex =0;
TextBox box1=new TextBox();
box1.Text = ((TextBox)Gridview1.Rows[rowIndex].Cells[2].FindControl("TextBox1")).Text;
</code></pre>
<p>Normally if we want to give value to textbox we give lkie this</p>
<pre><code> <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="false" Text="SomeText"></asp:TextBox>
</code></pre>
<p>but now I have textbox in gridview so I am accessing that as written above cs code. I want to give text to textbox from cs code. then How should I give text to textbox which will displayed in textbox at runtime..</p>
| c# asp.net | [0, 9] |
3,649,156 | 3,649,157 | Call javascript function on page_load event | <p>In asp.net website, inside <strong>.aspx</strong> i have following code</p>
<pre><code><script type="text/javascript">
function callme(option) {
document.getElementById("t1").value = option;
}
</script>
<div id="content" runat="server"></div>
<input type="text" id="t1" />
</code></pre>
<p>On code behind file inside <strong>Page_Load</strong>:</p>
<pre><code>content.InnerHtml = MyClassObject.MyMethod(...);
</code></pre>
<p>Inside <strong>MyClass</strong>:</p>
<pre><code>public String MyMethod(...)
{
... //some code
String str1 ="<select id=\"s1\" onchange=\"callme(this.value)\">" +
" <option value=\"1\">One</option>"+
" <option value=\"2\">Two</option>" +
" <option value=\"3\">Three</option>" +
"</select>";
... // some code
return str1;
</code></pre>
<p>Whenever i select any option from dropdownlist it reflects its value inside the textbox t1.
But at page load the textbox remains empty. I cannot use default value as the values of the dropdownlist are changing at runtime.
How can I add first value of dropdownlist to textbox t1 on page load?</p>
| javascript asp.net | [3, 9] |
2,232,431 | 2,232,432 | use javascript to find parameter in url and then apply if then logic | <p>I am trying to make my page perform an action only if it sees that a particular parameter is present in the url.</p>
<p>I essentially want the javascript code to do this:</p>
<p>consider an example page such as: <a href="http://www.mysite.com?track=yes" rel="nofollow">http://www.mysite.com?track=yes</a></p>
<p>If a page loads that contains the parameter 'track' within the url, print 'track exists', else if the 'track' paramater doesn't exist print 'track does not exist'</p>
<p>Thanks in advance for your help.</p>
| javascript jquery | [3, 5] |
1,434,476 | 1,434,477 | Is it possible to open another Web Browser form the current browser. | <p><strong>Is it possible to Open another web Browser from current web browser using JavaScript...??</strong></p>
<p>For Eg :If i am using Mozilla Firefox to view a web site and while clicking on a particular link (like an online payment mechanism), it must switch the browser to the Internet Explorer even if its not been given as a default browser.</p>
<p>Thanks in advance </p>
| java javascript | [1, 3] |
3,216,333 | 3,216,334 | jQuery closest() not selecting class added dynamically | <p>I have the <a href="http://jsfiddle.net/WFawp/" rel="nofollow">following jsFiddle</a> which has a <code>.tab</code> class (on a span) that is supposed to remove/replace the open (or close) class on the <code>.container</code> onclick -- and although my console logs are showing that successfully, using <code>closest()</code> I'm not able to grab the specific class in question to change/toggle that class. </p>
<p>I've tried quite a few variations, but am not sure if I am selecting this wrong.</p>
<p>Any pointers would be greatly appreciated. Thanks!</p>
| javascript jquery | [3, 5] |
3,748,598 | 3,748,599 | Help with ternary operator | <p>I don't think I am using the ternary operator correctly as I am not getting the results am I after:</p>
<pre><code>buildHTML.push("<a href='http://mysite/user?screen_name=" + data.friend == null ? data.user.me : data.friend + "'>" + data.friend == null ? data.user.me : data.friend + "</a>");
</code></pre>
<p>This gives me <code>null</code> if <code>friend</code> is <code>null</code>, and gives me <code>friend</code> if <code>friend</code> is <code>not null</code></p>
<p>It should be giving me <code>me</code> if <code>friend</code> is <code>null</code> and <code>friend</code> if <code>friend</code> is <code>not null</code>.</p>
<p>What am I doing wrong?</p>
| javascript jquery | [3, 5] |
5,775,625 | 5,775,626 | What is the equivalent to python equivalent to using Class.getResource() | <p>In java if I want to read a file that contains resource data for my algorithms how do I do it so the path is correctly referenced.</p>
<p>Clarification
I am trying to understand how in the Python world one packages data along with code in a module.</p>
<p>For example I might be writing some code that looks at a string and tries to classify the language the text is written in. For this to work I need to have a file that contains data about language models.</p>
<p>So when my code is called I would like to load a file (or files) that is packaged along with the module. I am not clear on how I should do that in Python.</p>
<p>TIA.</p>
| java python | [1, 7] |
113,035 | 113,036 | Setting the width of columns with an array as parameter | <p>I have the following function:</p>
<pre><code>function LoadColWidth(thewidtharray) {
for (i = 0; i < thewidtharray.length; i++)
{
$('#MyGrid .tr:first').eq(i).width(thewidtharray[i]);
}
};
var NarrowWidth = new Array(70, 72, 97, 72, 97, 72, 96, 76, 76, 76, 76, 75);
</code></pre>
<p>I'm calling LoadColWidth with different arrays as the parameter and the goal is to resize the width of columns. I'm struggling with the jquery call: it's supposed to loop through each columns by index but it's not working. Any suggestions?</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
2,869,188 | 2,869,189 | convert string to php array, jquery serialize on form | <p>I have a form and am sending the data to a backend php script using:</p>
<pre><code>var fields = $('#myform').serializeArray();
</code></pre>
<p>And then doing a post. Some of my inputs are named as arrays so when the data gets posted, I have an array like below. How do I convert the attribute pieces back into one attribute array with sub arrays?</p>
<pre><code>[1]=>
array(2) {
["name"]=>
string(20) "attribute[26][higher]"
["value"]=>
string(2) "21"
}
[2]=>
array(2) {
["name"]=>
string(20) "attribute[27][higher]"
["value"]=>
string(2) "20"
}
</code></pre>
| php jquery | [2, 5] |
4,307,891 | 4,307,892 | Focus lost with jAlert plugin | <p>I'm calling jAlert with this function</p>
<pre><code>$('.stcommentdelete').live("click",function() {
var ID = $(this).attr("id");
var dataString = 'com_id='+ ID;
jConfirm('Oled sa kindel, et tahad kustutada??', '', function(r){
if(r==true){
$.ajax({
type: "POST",
url: "delete_comment_ajax.php",
data: dataString,
cache: false,
success: function(html){
$("#stcommentbody"+ID).slideUp();
}
});
}
});
});
</code></pre>
<p>If i have for example 15 comments and i would delete last comment, it scrolls up. But i need that it stays focused on this place where i delete comment.</p>
<p>Omerimuni</p>
| javascript jquery | [3, 5] |
551,937 | 551,938 | ASP.net download page | <p>I have a Reports.aspx ASP.NET page that allows users to download excel report files by clicking on several hyperlinks. When a report hyperlink is clicked, I open a new window using the javascript window.open method and navigate off to the download.aspx page. The code-behind for the download page creates a excel file on the fly using openxml(in memory) and send it back to the browser. Here is some code from the download.aspx page:</p>
<pre><code> byte[] outputFileBytes = CreateExcelReport().ToArray();
Response.Clear();
Response.BufferOutput = true;
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}", "tempReport.xlsx"));
Response.BinaryWrite(outputFileBytes);
Response.Flush();
Response.Close();
Response.End();
</code></pre>
<p>My problem : Some of these reports take some time to generate. I would like to display a loading.gif file on my Reports.aspx page, while the download.aspx page is requested. Once the page request is completed, the loading.gif file should be made invisible.</p>
<p>Is there a way to achieve this. Perhaps some kind of event. I have mootools to my disposal.</p>
<p>Thanks</p>
<p>PS. I know that generating reports like this is not ideal, but thats a different story all together...</p>
| asp.net javascript | [9, 3] |
1,471,311 | 1,471,312 | access preloaded images | <p>I have found a script <a href="http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript" rel="nofollow">here</a> that preloads images, but I dont know how can to access them.</p>
<pre><code>(function($) {
var cache = [];
// Arguments are image paths relative to the current page.
$.preLoadImages = function() {
var args_len = arguments.length;
for (var i = args_len; i--;) {
var cacheImage = document.createElement('img');
cacheImage.src = arguments[i];
cache.push(cacheImage);
}
}
})(jQuery)
</code></pre>
<p>In other words I would take chace[i] - when the preload finished - and append to a div. Any ideas?</p>
| javascript jquery | [3, 5] |
5,489,789 | 5,489,790 | Run a function in timeout looping | <p>I have the following code:</p>
<pre><code>// After 8 seconds change the slide...
var timeout = setTimeout("changeSlide()", 8000);
$('div.slideshow').mouseover(function() {
// If the user hovers the slideshow then reset the setTimeout
clearTimeout(timeout);
});
$('div.slideshow').mouseleave(function() {
clearTimeout(timeout);
var timeout = setTimeout("changeSlide()", 8000);
});
</code></pre>
<p>What I want to happen is make the function changeSlide run EVERY 8 seconds in a loop unless someone hovers the slideshow div. When they remove the cursor then do the timeout again!</p>
<p>However the loop only happens once and the hover doesn't stop the timeout or start it again :/</p>
<p>EDIT:</p>
<p>This loops great but the hover on and off causes the function to run multiple times:</p>
<pre><code>// After 8 seconds change the slide...
var timeout = setInterval(changeSlide, 2000);
$('div.slide').mouseover(function() {
// If the user hovers the slideshow then reset the setTimeout
clearInterval(timeout);
});
$('div.slide').mouseleave(function() {
clearInterval(timeout);
var timeout = setInterval(changeSlide, 2000);
});
</code></pre>
| javascript jquery | [3, 5] |
346,622 | 346,623 | $.ajax JQuery progress bar | <p>I have a sql queries being executed via an ajax call, but I need to be able to check the progress of it and update a progress bar.</p>
<p>Here's my simple ajax call (using JQuery):</p>
<pre><code>var strResult = (($.ajax({url: URL,async: true}).responseText));
</code></pre>
<p>Any ideas how I listen for changes to update the bar?</p>
<p>PS. This question is nothing to do with SQL.</p>
| php javascript jquery | [2, 3, 5] |
3,211,302 | 3,211,303 | Selecting first item in GridView can't be clicked | <p>I have Button with background images (instead of ImageViews) so i get my position using
selectedIndex = (Integer) v.getTag();
somehow i can't click the first one , but after i click the remaining images the index 0 image will show up even when you clicked the other images.</p>
<pre><code>Button buttonView;
if (convertView == null) { // if it's not recycled, initialize some
// attributes
buttonView = new Button(mContext);
} else {
buttonView = (Button) convertView;
}
buttonView.setLayoutParams(new GridView.LayoutParams(95, 95));
if (chartWidth > 0 && chartWidth <= 240)
buttonView.setLayoutParams(new GridView.LayoutParams(55, 55));
buttonView.setPadding(3, 3, 3, 3);
buttonView.setTag(position);
// buttonView.setBackgroundResource(mThumbIds[position]);
try {
Class<drawable> res = R.drawable.class;
Field field = res.getField(iconnames[position]);
int drawableId = field.getInt(null);
buttonView.setBackgroundResource(drawableId);
} catch (Exception e) {
// Log.e("MyTag", "Failure to get drawable id.", e);
}
buttonView.setOnClickListener(SCCreateSelectIconView.this);
buttonView.setId(R.id.iconButton);
return buttonView;
</code></pre>
| java android | [1, 4] |
2,151,171 | 2,151,172 | Validation for input boxes in jQuery or in Javascript | <p>I have 4 input boxes , and I want user enter only one number from 1, 2, 3, 4 in that boxes.
If user enter number 1 in one box then he not use 1 number in other box, i.e user enter one number at one time, if list of input boxes goes to increase, this logic is not fail.
The image is shown below, user use only 1 to 4 number, and he use one number at once.</p>
<p><img src="http://i.stack.imgur.com/EJYTU.png" alt="enter image description here"></p>
| javascript jquery | [3, 5] |
4,699,050 | 4,699,051 | Parse String to byte array C# | <p>I have done the following to convert the byte array to string to store in the db</p>
<pre><code>byte[] value;
String stValue = BitConverter.ToString(value);
</code></pre>
<p>Now I just want do do the opposite</p>
<pre><code>String stValue;
byte[] value= (Convert) stValue ???
</code></pre>
<p>How to do this??</p>
| c# asp.net | [0, 9] |
5,691,242 | 5,691,243 | Help for arrays: converting php code to python | <p>For the first time this is not python => php but php => python.
I've got small problem with arrays in python.
(I've already been to docs.python.org)</p>
<p>Here's my problem:
I get in python couples of strings like this:</p>
<pre><code>(People 1):
<criteria a> <data of the criteria>
<criteria b> <data of the criteria>
<criteria c> <data of the criteria>
<criteria d> <data of the criteria>
(People 2):
<criteria a> <data of the criteria>
<criteria b> <data of the criteria>
<criteria d> <data of the criteria>
...
</code></pre>
<p>(note for people 2 criteria c doesn't exist)
So i'd like do that (in php it's very easy):</p>
<pre><code>array_push( tab[ "criteria a" ],
array("People1", "data of the criteria")
);
</code></pre>
<p>Then I'd like to show all a list of the criterias that exists, and use the array to create a nice "insert SQL query" for my database.</p>
<p>Any idea how to do this?
Where should I look?
I miss string indexed arrays....</p>
| php python | [2, 7] |
2,258,561 | 2,258,562 | creating an options menu with quit application function | <p>I'm writing an application for android and I would like to insert an options menu, that would have only one function and that is to quit an application.</p>
<p>My options_menu.xml looks like this (I created a new folder under res called menu - just like the instructions said):</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/quit"
android:icon="@drawable/ic_quit"
android:title="@string/quit" />
</menu>
</code></pre>
<p>Than I added the following code to my java class file:</p>
<pre><code>@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.options_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.quit:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
</code></pre>
<p>I also defined the @string/quit in values - strings.xml file, but it still says that there is an error:</p>
<pre><code>C:\Users\Domen\workspace\Lovne Dobe1.1\res\menu\options_menu.xml:3: error: Error: No resource found that matches the given name (at 'title' with value '@string/quit')
</code></pre>
<p>So if anybody can help I would be very grateful.</p>
| java android | [1, 4] |
3,111,639 | 3,111,640 | What would be the best control/easiest way to output a single record with many columns? | <p>This is a continuation from this:
<a href="http://stackoverflow.com/questions/8407025/is-there-an-easy-way-to-check-multiple-columns-to-see-if-the-value-is-null">Is there an easy way to check multiple columns to see if the value is null?</a></p>
<p>Now that I've got my single product, it's far too wide to display on my webform with a gridview. What do you guys recommend that I use? I thought about outputting it as a table with two columns: the first will state what the data represents and the second column will have the actual data. Is this a bad idea? If not, I'm not really sure how I would do this anyway.</p>
| c# asp.net | [0, 9] |
2,946,854 | 2,946,855 | jQuery Show/Hide cookie button | <p>I am looking for a simple jQuery show/hide script that is cookie based. If anyone can provide me with a script, that would be great. </p>
<p>Below is the guide on what I am trying to achieve. </p>
<ul>
<li>if cookie is not set
<ul>
<li>Set all div's with a class of admin as visible</li>
<li>Display hide link</li>
</ul></li>
<li>If cookie is set
<ul>
<li>Hide div's with admin class</li>
<li>Display Show link</li>
</ul></li>
</ul>
<p>Thanks</p>
| javascript jquery | [3, 5] |
3,724,548 | 3,724,549 | Is there any limit on how much text asp:label control can hold? | <p>Should I use it if I wanna store really long text?</p>
| c# asp.net | [0, 9] |
3,277,396 | 3,277,397 | Mono for Android Release error | <p>I'm using Mono for Android (C#). I'm trying to get the .apk file using MonoDevelop, but when I set project for release (using this guide: <a href="http://docs.xamarin.com/Android/Guides/Deployment,_Testing,_and_Metrics/publishing_an_application/Part_1_-_Preparing_an_Application_for_Release" rel="nofollow">LINK</a>) I get this Error:</p>
<blockquote>
<p>Error MSB4018: The "GenerateJavaStubs" task failed unexpectedly.
System.InvalidOperationException: /manifest/@package attribute MUST
contain a period ('.'). at
Xamarin.Android.Tasks.ManifestDocument.Merge(List<code>1 subclasses, List</code>1
selectedWhitelistAssemblies, Boolean embed) at
Xamarin.Android.Tasks.GenerateJavaStubs.Execute() at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at
Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost
taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost
taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask,
Boolean& taskResult) (MSB4018)</p>
</blockquote>
| c# android | [0, 4] |
1,492,269 | 1,492,270 | How do I allow the user to move an absolutely positioned div? | <p>I am using jQuery to create a "dialog" that should show up in the center of the page on top of everything and should remain centered at all times unless the user moves it. It has a header area (like a title bar) and I would like the user to be able to click there and drag the dialog "window" around. It is an absolutely positioned div. What is the best way to do this?</p>
<p>EDIT: I failed to mention that I would like to do it without jQuery UI if it's not terribly difficult. But I will look into how jQuery UI does it though. I may end up using it.</p>
| javascript jquery | [3, 5] |
3,347,177 | 3,347,178 | Alternative method to display content | <p>The selected radio button will show its corresponding dropdown box.</p>
<p>For example, upon the selected radio button ‘Ontario’, a dropdown box with matching cities will show up.</p>
<p>I have the following working code for the above example:</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$("#searchForm input:radio").change(function() {
var buttonPressed = $('[name="Region"]:radio:checked').val();
var cityElmntBox = document.getElementById("dispalyCityBox");
if(buttonPressed == 'Ontario'){
cityElmntBox.style.display='block';
} else {
cityElmntBox.style.display='none';
}
});
});
</script>
</code></pre>
<p>Instead of the sudden effect (<code>display='block'</code>), I wanted to use for the selected elements the <code>slideDown()</code> method.</p>
<p>So I replaced:</p>
<pre><code>cityElmntBox.style.display='block';
</code></pre>
<p>with:</p>
<pre><code>cityElmntBox.slideDown(500);
</code></pre>
<p>But this doesn’t work…, please can someone help me get it working?</p>
| javascript jquery | [3, 5] |
3,773,455 | 3,773,456 | How to get the value of a javascript object? | <p>I have an object and inside that object are further objects. I want to get the value of those objects. Thanks!</p>
<pre><code> foreach($query as $row){
$vehicles[$row->deviceID] = Array(
'description' => $row->description,
'deviceID' => $row->deviceID
);
}
</code></pre>
<p>and then I pass it to the view and stored it to a global javascript variable.</p>
<pre><code> var vehicleList = <?php echo $vehicleList; ?>;
</code></pre>
<p>here is the output of my console.log if I type vehicleList in my console log in chrome:</p>
<pre><code>vehicleList
>Object
>11292: Object
description: "Bus 1"
>11293: Object
description: "Bus 2"
>11294: Object
description: "Bus 1"
</code></pre>
<p>The value I want to get is the description.
Is it also possible to store another value to the object 11292? If yes, how?</p>
<p>Thanks!</p>
| php javascript | [2, 3] |
3,778,965 | 3,778,966 | jQuery - choosing sum at random | <p>I am creating a "whack-a-mole" style game for primary school children where they have to click on the correct number in correspondence to the sum given. </p>
<p>At the moment the program is generating addition sums like this.</p>
<pre><code>function createPlusSum(total) {
console.log(total)
var int1 = Math.ceil(Math.random() * total);
var int2 = total - int1;
$('#target').html(int1 + ' + ' + int2 + ' = ?');
}
</code></pre>
<p>I have done this again for subtraction and it works, but I don't know where to go from here in regards to randomizing whether an addition or subtraction question is produced. Here is the function to produce a subtraction question.</p>
<pre><code>function createTakeSum(total) {
console.log(total)
var int1 = Math.ceil(Math.random() * total);
var int2 = total + int1;
$('#target').html(int2 + ' - ' + int1 + ' = ?');
}
</code></pre>
<p>I use this to create the addition sums</p>
<pre><code>createPlusSum(total);
</code></pre>
<p>How would I say I want </p>
<pre><code>createPlusSum(total);
</code></pre>
<p>or </p>
<pre><code>createTakeSum(total);
</code></pre>
| javascript jquery | [3, 5] |
5,169,841 | 5,169,842 | How to remove validation from a jQuery script | <p>I found this script from a tutorial but I don't want the validation part, just the posting part.. I tried to delete the validation related commands but it doesn't work. Maybe I did it wrongly, but my thought is if all of these are needed to run the submitHandler.</p>
<p>Thank you.</p>
<pre><code>$(document).ready(function(){
$("#myform").validate({
debug: false,
rules: {
name: "required",
message: "required",
email: {
required: true,
email: true
}
},
messages: {
name: "Please let us know who you are.",
email: "A valid email will help us get in touch with you.",
message: "Please write a subject."
},
submitHandler: function(form) {
$.post('mailme.php', $("#myform").serialize(), function(data) {
$('#results').hide().html(data).fadeIn('slow');
});
}
});
});
</code></pre>
| javascript jquery | [3, 5] |
3,590,761 | 3,590,762 | jQuery - programming style - many bindings vs. conditional single one | <p>I frequently see code like that:</p>
<pre><code>$("#foo").live("mouseover mouseout", function(e) {
if (e.type == "mouseover") {
$("#foo").append("<div id='bar'>");
} else {
$("#bar").remove();
}
});
</code></pre>
<p>instead of more self-explanatory in my opinion:</p>
<pre><code>$("#foo").live("mouseover", function(e) {
$("#foo").append("<div id='bar'>");
})
.live("mouseout", function(e) {
$("#bar").remove();
});
</code></pre>
<p>the same goes with</p>
<pre><code>$('#contentPageID, #itemURL').change ( function () {
if ( $(this).is('#contentPageID') )
...
else
...
});
</code></pre>
<p>does it have any purpose or is it just different coding style (counter intuitive in my point of view) ?</p>
| javascript jquery | [3, 5] |
5,755,116 | 5,755,117 | Going from PHP to Java | <p>Having been programming in PHP for a year, I now want to start learning Java. I am in a Windows environment. </p>
<p>I want to develop a GUI with Java that would query a MySQL database. I know I would use JFC to accomplish this, but my questions are: </p>
<ul>
<li>Will it be difficult to adapt to Java?</li>
<li>Do I benefit for learning Java because I know PHP?</li>
</ul>
| java php | [1, 2] |
2,614,474 | 2,614,475 | How do I set my 2nd datepicker one day ahead of the 1st? | <p>I have 2 datepicker textfields: one of them is #from, the other is #to.
Right now, my users can have the same date for #from and #to. </p>
<p>How do I make the #to datepicker start at #from + 1 day?</p>
<p>Here's my current code:</p>
<pre><code> var dates = $( "#from, #to" ).datepicker({
numberOfMonths: 2,
minDate: 0,
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
});
</code></pre>
| javascript jquery | [3, 5] |
1,093,735 | 1,093,736 | Loop through numerous variables | <p>I have 48 variables (TextViews), like tv1, tv2, tv3, tv4...tv48.</p>
<p>I want to set a value for these variables, with a for loop, since I do not want to write down the same row 48 times.</p>
<p>Something like this:</p>
<pre><code>for (int i=1; i<49; i++)
{
"tv"+i.setText(i);
}
</code></pre>
<p>How to achieve this?</p>
| java android | [1, 4] |
5,191,289 | 5,191,290 | How do I pull data from another thread or process (Android/Java) | <p>I know of concepts that allow inter-process communication. My program needs to launch a second thread. I know how to pass or "push" data from one thread to another from Java/Android, but I have not seen a lot of information regarding "pulling" data. The child thread needs to grab data on the parent thread every so often. How is this done?</p>
| java android | [1, 4] |
179,958 | 179,959 | Help me understand whats wrong with my javascript | <p>If I do this-</p>
<pre><code>alert(anchor);
</code></pre>
<p>I get this-</p>
<blockquote>
<p>"[object HTMLLIElement]"</p>
</blockquote>
<p>... ok, yep, it is the element I want. So I want to get that elements ID.</p>
<p>So I test it like this:</p>
<pre><code>alert(anchor.attr("id"));
</code></pre>
<p>... but I don't get any alert, nothing. I must not be selecting an element. What am I doing wrong, what don't I understand?</p>
| javascript jquery | [3, 5] |
5,305,376 | 5,305,377 | Monthly Archives | <p>Say I've got a database with about 5,000 blog posts from the last 2 years, I'm trying to create 'monthly' archives so I can display the data in a much more logical way.</p>
<p>For some reason I've never really had to work with date's all that much and my knowledge is lacking.</p>
<p>I'm using Linq/C#; can someone point me in the right direction to learn how to do this?</p>
<p>Cheers</p>
<p>Matt</p>
| c# asp.net | [0, 9] |
1,714,297 | 1,714,298 | Server.UrlEncode vs. HttpUtility.UrlEncode | <p>Is there a difference between Server.UrlEncode and HttpUtility.UrlEncode?</p>
| c# asp.net | [0, 9] |
3,329,719 | 3,329,720 | JavaScript Variable Operators | <p>Are these possible in Javascript?</p>
<p>I've got something like this:</p>
<pre><code>var op1 = "<";
var op2 = ">";
if (x op1 xval && y op2 yval) {
console.log('yay');
}
</code></pre>
<p>Basically I need the user to input the operator, its coming from a select box. </p>
| javascript jquery | [3, 5] |
2,855,021 | 2,855,022 | Checkbox onclick uncheck other checkboxes | <p>I have 6 checkboxes, one for each business day and one that says 'all'.</p>
<p>What i want to be able to do is uncheck all the other boxes if someone clicks the 'all' checkbox if that makes sense.</p>
<p>For example, if someone has clicked monday and wednesday ... then they come in and click the 'all' checkbox, then the monday and wednesday checkbox should uncheck.</p>
<p>Cheers,</p>
| php javascript jquery | [2, 3, 5] |
5,824,096 | 5,824,097 | Should one bind data with Eval on aspx or override ItemDataBound in code-behind? | <p>For data bound controls (Repeater, ListView, GridView, etc.), what's the preferred way of binding data?</p>
<p>I've seen it where people use Eval() directly on the aspx/ascx inside the data bound control to pull the data field, but to me, it just seems so...inelegant. It seems particularly inelegant when the data needs to be manipulated so you wind up with shim methods like <code><%# FormatMyData(DataBinder.Eval(Container.DataItem, "DataField")) %></code> inside your control.</p>
<p>Personally, I prefer to put in Literal controls (or other appropriate controls) and attach to the OnItemDataBound event for the control and populate all the data to their appropriate fields in the code-behind.</p>
<p>Are there any advantages of doing one over the other? I prefer the latter, because to me it makes sense to compartmentalize the data binding logic and the presentation layer. But maybe that's just me.</p>
| c# asp.net | [0, 9] |
4,997,732 | 4,997,733 | jquery loading animation with php form that submits back to itself | <p>I have a PHP file that contains a form and which submits back to itself. Is there any way to show a loading animation after the form is submitted and run until the page is loaded?</p>
| php jquery | [2, 5] |
4,370,501 | 4,370,502 | to perform validation for amout(price) in ASP.net | <p>I'm using 'Amount' as a column in my datatable for my application.</p>
<p>I want to perform the following validations w.r.t 'Amount' which is a string variable.</p>
<p>1) i want to check if the amount has more than 2 digits after the decimal point</p>
<p>2) if the amount is positive or negative .. (as in case of negative error message needs to be flashed)</p>
<p>Can u help in this with short and efficient code snippets ???</p>
<p>EDIT:</p>
<p>@Peter:</p>
<p>But checking digits after decimal shows error even for numbers of kind 1986, 200134
which are given as inputs...... what to do ?</p>
| c# asp.net | [0, 9] |
555,094 | 555,095 | Trying to number objects in jQuery | <p>I'm trying to number objects, which can be added to a cart with drag'n'drop. So, this snippet should check the current number written in <code>span.amountVal</code>, and easily add ´+1´ to this number, but the result is always ´1´. When I uncomment the ´alert(i++);´, the snippet work like I want to. I'm confused, what is this about?</p>
<pre><code>$.favList.find("div[data-asset-id="+ _itemID +"]").each(function() {
var i = $(this).find("span.amountVal").text();
// alert(i++);
$(this).find("span.amountVal").text(i++);
});
</code></pre>
<p>Thank you.</p>
| javascript jquery | [3, 5] |
3,421,951 | 3,421,952 | Check different date formats | <p>I have function:</p>
<pre><code>sample(date){
//operations, for example add one week (7 days)
return date;
}
var one = new Date('2012-07-16');
var two = new Date('07/16/2012');
var new = sample(one); // or sample(two)
var day = new.getDate();
var month = new.getMonth();
var year = new.gerYear();
alert(day + month + year);
</code></pre>
<p>and now i would like show this date, but how can i check format this date?
For example:</p>
<pre><code>alert(sample(one));
</code></pre>
<p>should show me date with format <strong>2012-07-23</strong>
and if </p>
<pre><code>alert(sample(one));
</code></pre>
<p>should show me <strong>07/23/2012</strong></p>
<p>but how can i check format current date? is this possible?</p>
| javascript jquery | [3, 5] |
5,984,828 | 5,984,829 | Trying to replace 2011 with getFullYear in copyright div | <p>I am trying to replace the year 2011 in a footer that contains the copyright with the current year.</p>
<p>Currently I have successfully replaced '2003-2011' with '2003-2012' like this:</p>
<pre><code> $(document).ready (function (function(){
$('div.footer').html($('div.footer').html() .replace('2003-2011','2003-2012'));
});
</code></pre>
<p>But I wanted to replace '2011' with the current year so you don't have to change the script every year.</p>
<p>Doing this doesn't work:</p>
<pre><code> var year=getFullYear();
$(document).ready (function(){
$('div.footer').html($('div.footer').html() .replace('2011','year'));
});
</code></pre>
<p>As always, thank you very much for your help.</p>
| javascript jquery | [3, 5] |
2,588,119 | 2,588,120 | jquery cycle to vertically scroll through table | <p>Okay I have a table that I am populating with 25 rows of information. I want to use Jquery cycle or something similar to create a vertical scrolling effect, so the rows constantly scroll vertically upwards through a container that can display roughly five rows at a time. </p>
<p>I have used jquery cycle for numerous things, but for some reason I am at a dead end on trying to get it to work for a table.</p>
<p>I think my confusion is probably on how I need to set up my table/container structurally so cycle knows what children or elements to apply to:</p>
<pre><code>$(document).ready(function() {
$('#table_container').cycle({ //Will this even work for a table???
fx:'scrollVert',
continuous: 1
});
});
</code></pre>
<p>So how do I structure the table elements so cycle influences them? </p>
<p>More on <a href="http://jquery.malsup.com/cycle/" rel="nofollow">Jquery Cycle</a>, from their website:</p>
<p>The plugin provides a method called cycle which is invoked on a container element. Each child element of the container becomes a "slide". Options control how and when the slides are transitioned.</p>
| javascript jquery | [3, 5] |
1,702,000 | 1,702,001 | android: Unable to access struct static data members | <p>I'm having the next kind of error when linking the application:</p>
<pre><code>undefined reference to 'MyStructure::K_VARIABLE_A
undefined reference to 'MyStructure::K_VARIABLE_B
...
</code></pre>
<p>The structure is defined inside "MyStructure.h" as:</p>
<pre><code>struct MyStructure
{
const static int K_VARIABLE_A=1;
const static int K_VARIABLE_B=2;
...
}
</code></pre>
<p>How can i get rid of this error?</p>
<p>My source code compiles successfully for Windows platform but I get the error mentioned above when compiling for the android platform. </p>
<p>The header of this structure is properly included in the .cpp file.</p>
<p>Thanks in advance.</p>
| android c++ | [4, 6] |
5,383,564 | 5,383,565 | Listview with detailview in android | <p>Help!!</p>
<p>I have a listadapter with a detail view, the problem that I am having is trying to pass values from an xml file to the second view. I can currently do this but only if I show those values in the first view. What I am trying to acheive is on the firstview have just a title and when you click on that title it takes you to a detail view with more information about it. </p>
<p>here is the code that I currently have.</p>
<pre><code>ListAdapter adapter = new SimpleAdapter(this, menuItems,
R.layout.list_item,
new String[] { KEY_USERADDRESS, KEY_DATEDUE}, new int[] {
R.id.name, R.id.cost });
setListAdapter(adapter);
// selecting single ListView item
ListView lv = getListView();
lv.setOnItemClickListener(new OnItemClickListener() {
//@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// getting values from selected ListItem
// String name = ((TextView) view.findViewById(R.id.name)).getText().toString();
String cost = ((TextView)view.findViewById(R.id.cost)).getText().toString();
// String description = ((TextView) view.findViewById(R.id.desciption)).getText().toString();
// Starting new intent
Intent in = new Intent(getApplicationContext(), SingleMenuItemActivity.class);
//in.putExtra(KEY_USERADDRESS, name);
in.putExtra(KEY_DATEDUE, cost);
//in.putExtra(KEY_DESC, description);
startActivity(in);
}
});
}
</code></pre>
<p>As you can see I have a list adapter,I only want to show the contents of the KEY_USERADDRESS on the first view and when they click it then the rest will be shown. If I add the rest of the Textviews to the listadapter it makes the textviews to big.</p>
<p>Sorry if I am a little confusing, I'm still a rookie when it comes to android development. </p>
<p>Any help will be appreciated!!</p>
| java android | [1, 4] |
3,789,737 | 3,789,738 | Remote poll using jQuery/javascript | <p>I want to let my users create their own polls so they could paste my code somewhere on their website and users may rate their own game characters (with 1-5 stars rating).</p>
<p>I want to use jQuery or javascript for this purposes, but I have no idea how to start developing something like that. It should be free from being spoofed in any way, so I'd like to store the poll records in my database table (MySQL).</p>
<p>You probably had some experiences on this case, so I'm waiting for your suggestions.</p>
| javascript jquery | [3, 5] |
2,185,143 | 2,185,144 | facebook comment jquery load | <p>I have problem loading facebook comments via jquery <code>.load()</code>.</p>
<p>Loading:</p>
<pre><code><div id="comfb" ></div>
<div id="fb-root"></div>
<script>
$(document).ready(function(){
$('#comfb').load('/engine/comments.html');
FB.XFBML.parse( );
});
</script>
</code></pre>
<p>Script to load:</p>
<pre><code><center>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/ka_GE/all.js#xfbml=1&appId=274658785972380";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:comments href="http://bbullett.tk<?=$_SESSION['curloc']?>"" num_posts="3" width="500"></fb:comments>
<script>FB.XFBML.parse();</script>
</center>
</code></pre>
<p>If you would like visit <a href="http://bbullett.tk" rel="nofollow">http://bbullett.tk</a> open first news and you'll see. Sometimes it happens so that it works fine, especially when entering direct address in address bar.
Here is image <a href="http://i074.radikal.ru/1212/75/965b0f258d09.jpg" rel="nofollow">http://i074.radikal.ru/1212/75/965b0f258d09.jpg</a></p>
| javascript jquery | [3, 5] |
3,128,120 | 3,128,121 | apply JavaScript to all elements with id | <pre><code><a id="link" href="http://www.google.co.uk">link</a>
<a id="link" href="http://stackoverflow.com">link</a>
</code></pre>
<p>the javascript only replaces the first <code>href</code> but i want it to apply to any and all <code><a></code> with the <code>id="link"</code> <strong>OR</strong> do you have a <strong>jQuery</strong> alternative?</p>
<pre><code><script>
var link = document.getElementById('link');
var src = link.getAttribute('href');
var paramurl = encodeURIComponent(src);
link.setAttribute("href", "http://mysite.com/?url=" + paramurl);
</script>
</code></pre>
| javascript jquery | [3, 5] |
2,730,102 | 2,730,103 | Why put javascript in asp.net? | <p>I have been asked about JavaScript and am unsure on a few points that I mentioned.</p>
<p>After use of ASP.net I have found that the term used for handling events it the code behind method.</p>
<p>But in other cases I have found that JavaScript is used in asp.net pages.</p>
<p>My question is, is this done as the javascript file is an external .js file and could be accessed from any where or is there a different reason for it?</p>
<p>Thanks for any reply's.</p>
| javascript asp.net | [3, 9] |
5,655,648 | 5,655,649 | Difference between this.href and $(this).attr("href") | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6977049/this-href-vs-this-attrhref">this.href vs $(this).attr('href')</a> </p>
</blockquote>
<p>Here is my code:</p>
<pre><code> $(function () {
$("a.Delete").click(function () {
console.log(this.href);
console.log($(this).attr("href"));
return false;
});
</code></pre>
<p>and here is my link</p>
<pre><code><a class="Delete" href="/Contact/Delete/10402">Delete</a>
</code></pre>
<p>Here is my output:</p>
<pre><code>http://localhost:59485/Contact/Delete/10402
/Contact/Delete/10402
</code></pre>
<p>Why the difference doesn't the attr method just get the attribute. Isn't that what this.href does? Is the href property special in some way that it actually gives you the absolute url?</p>
| javascript jquery | [3, 5] |
1,658,732 | 1,658,733 | how to encrypt third party api key in a website | <p>I got an api key from yelp. I am still learning how to use this api in my website.
As of now my api key is in java script which is visible to everyone. I am using visual studio for developing this website.</p>
<p>can anyone tell me how to encrypt this api key? </p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
2,524,731 | 2,524,732 | why is jQuery selector property undefined within each()? | <p>Given the following code, why does the selector property work in the first instance but not the second? Aren't they both jQuery objects?</p>
<pre><code><span class='tst'>span</span>
var tst = $('.tst');
console.log(tst.selector);
// prints '.tst'
$('.tst').each(function() { console.log(this.selector);});
// prints undefined
</code></pre>
| javascript jquery | [3, 5] |
4,226,086 | 4,226,087 | Javascript event like window.onload for subsequent loads | <p>We have a function that changes the iframe height at the window.onload event so we can adjust it to the page contents. The problem is that after clicking in an asp:menu the height its restored to its default and the window.onload event doesnt fire...so we need the event that would fire in subsequent loads (tried window.unload but didnt trigger) </p>
<p>The resize function cant be called on the asp:menu click because the window wouldnt have finished loading so the height calculation would fail...</p>
<p>Any ideas??</p>
| c# javascript asp.net | [0, 3, 9] |
1,126,721 | 1,126,722 | what is a good test environment to test JQuery | <p>I find that I constantly want to test little snippets of JQuery and i would love a good method. Currently I go to the page that I am trying to test and open up firebug and enter the snippet and it should appear in the console. I was wondering if there is a better place or method that can help</p>
| javascript jquery | [3, 5] |
2,571,156 | 2,571,157 | Why an Android may delete data saved under Media.EXTERNAL_CONTENT_URI? | <p>Why an Android may delete data saved under Media.EXTERNAL_CONTENT_URI after unmount/mount SD card action? How to avoid this?</p>
<p>I save ringtones using this URI and the default content resolver from context.</p>
<p>The code is similar to that:</p>
<pre><code>ContentValues values = new ContentValues();
values.put(Media.DATA, AudikoFileStorageAccessor.getInstance().getAbsolutePathForRingtone(ringtone.getId()));
values.put(Media.TITLE, ringtone.mSong);
values.put(Media.DISPLAY_NAME, ringtone.mSong);
values.put(Media.ARTIST, ringtone.mArtist);
values.put(Media.MIME_TYPE, "audio/mpeg");
values.put(Media.SIZE, ringtone.mSize * 1024);
values.put(Media.IS_RINGTONE, (RingtoneManager.TYPE_RINGTONE == type || type == 0));
values.put(Media.IS_NOTIFICATION, (RingtoneManager.TYPE_NOTIFICATION == type));
values.put(Media.IS_ALARM, (RingtoneManager.TYPE_ALARM == type));
values.put(Media.IS_MUSIC, false);
Uri newUri = mContext.getContentResolver().insert(
Media.getContentUriForPath(AudikoFileStorageAccessor.getInstance().getAbsolutePathForRingtone(
ringtone.getId())), values);
RingtoneManager.setActualDefaultRingtoneUri(mContext, type, newUri);
</code></pre>
<p>Everything works fine, but after I unmount SD card and then mount it again this ringtone doesn't exist anymore and couldn't be found within this table.</p>
<p>Should I handle UNMOUNT event and backup somehow my saved data and restore it as soon as SD card is available again?</p>
| java android | [1, 4] |
5,976,808 | 5,976,809 | Append to window.opener.location? | <p>Friends,</p>
<p>Is it possible to append a string to the window.opener.location from the opened window? Ideally, the opener does not refresh, but gets "&t=test" added to then end of it.</p>
<p>Thanks so much!</p>
| javascript jquery | [3, 5] |
4,587,027 | 4,587,028 | cloning only a specific item in a list using .clone() in Jquery | <p>I am trying to add only select items of a list to a new list. So for example, I only wish to add banana to my second list, the following code in my function adds all the items in coll-selected-list to coll-grouped-list. How may I only make a clone of a specific item. Any tips would be great.</p>
<p>jQuery:</p>
<pre><code>$("#coll-selected-list li").clone().appendTo("#coll-grouped-list");
</code></pre>
<p>Markup:</p>
<pre><code><ul id="coll-selected-list" class="droptrue sort-drop ui-sortable">
<li class="sorted">apple</li>
<li class="sorted">pear</li>
<li class="sorted">banana</li>
<li class="sorted">grape</li>
<li class="sorted">guava</li>
</ul>
<ul id="coll-grouped-list">
</ul>
</code></pre>
| javascript jquery | [3, 5] |
545,512 | 545,513 | How do I set my environment up for TopCoder? | <p>I tried out TopCoder today. While I liked the problem, the Java editor didn't work for me. The remote compiling time and the lack of unit tests also made it difficult to complete the task.</p>
<p>I ended up coding the solution in Eclipse and the pasting it into the TopCoder window. I tried out EclipseCoder, but it didn't suit my needs either.</p>
<p>What tools do you use and how do you hook up your development environment with TopCoder? How does TopCoder handle submissions, and is there any way to speed up the time it takes to process them?</p>
| java c++ | [1, 6] |
5,049,073 | 5,049,074 | passing values to nest activity from diff lists | <p>i have a problem of passing two values in different <code>ArrayList</code>s.</p>
<p>I made a listView and fetched to it list2 elements. when click on the listView item want to pass the selected item and the element in the list1 at the same position. The problem in next code that its pass only the selected item from listView?? how can i make it work to pass both values to next activity?</p>
<pre><code>lv = getListView();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, names);
setListAdapter(adapter);
lv.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> parent, View view,
int position, long id)
{
//int c=parent.getSelectedItemPosition();
String bb=parent.getItemAtPosition(position).toString();
Intent i = new Intent(LastActivity.this, Details.class);
String ur=links.get(position).toString();
// String x=edt.getText().toString();
i.putExtra("name",bb);
i.putExtra("link",ur);
// starting new activity
startActivity(i);
}
});
</code></pre>
| java android | [1, 4] |
2,082,395 | 2,082,396 | jQuery lazy loading image with throttling? | <p>I've been given a design for a commercial affiliate-related website where the homepage has 2500+ images on it. Two directions I'm thinking about to ease the loading of the images is to utilize a lazy image loading script.</p>
<p>I've been messing with the jQuery JAIL (Async Image Loader) script. I have it set so that it loads all the visible images when the page loads. Then after a couple seconds it begins downloading all the rest of the images on the page that are below the fold. This is typically like 2400+ images.</p>
<p>The problem is that when the browser is told to download 2400 images it basically freezes up, or at least freezes up the scrollbar until it's done.</p>
<p>Are there any jQuery image loading scripts that are similar to the JAIL but that allow for some type of throttling? Anything really to help from freezing up the page.</p>
<p>I'm also looking into css sprites but for various technical reasons and time constraints it might not be feasible.</p>
| javascript jquery | [3, 5] |
4,148,258 | 4,148,259 | Japanese characters :Convert lowerCase to upperCase using jquery | <p>I tried using toUppercase() method to convert japanese characters to uppercase but it return same string with out conversion.</p>
<p>Is there any other way to do this using jquery or javascript.</p>
<pre><code>fieldValue = "ショウコ"; //japanese string.
function convertToUppercase(fieldValue)
{
convertedValue = fieldValue.toUpperCase();
return convertedValue;
}
</code></pre>
<p>Any help would be greatly appreciated!</p>
| javascript jquery | [3, 5] |
1,889,620 | 1,889,621 | Issue with callback functions | <p>I have three dropdowns I am trying to dynamically populate when an HTML form loads. They all use API callback functions provided by a third-party cloud database provider to retrieve the data and populate the dropdowns. The problem I am encountering is that only the last one populates. Here is how I'm calling the functions:</p>
<pre><code>$(function ()
{
PopulateDropdown('OwnerList');
});
$(function()
{
PopulateDropdown('ClientList');
});
$(function ()
{
PopulateDropdown('AssignedToList');
});
</code></pre>
<p>The text inside the parentheses are the IDs of the dropdowns (select elements) in the HTML.</p>
<p>The only dropdown that ever gets populated is whichever the last one in the list is. The code as shown above populates only the AssignedToList dropdown. If I move the call to populate the AssignedToList to the top, moving the ClientList to the bottom, only the ClientList dropdown populates. I am fairly new to JavaScript and jQuery, so I'm sure there's a way to ensure all three calls work properly. I have Googled everything I can think of but haven't been able to find anything to help. I'm not even real sure what it is I need to Google! Any help would be greatly appreciated!</p>
| javascript jquery | [3, 5] |
665,793 | 665,794 | Is jQuery.change("callBackFunction") better than jQuery.on("change","callBackFunction") | <p>Is jQuery.change("callBackFunction") better than jQuery.on("change","callBackFunction") or is it the other way around? If so why is that so?</p>
<p><strong>Edit</strong>
I now know that <a href="http://api.jquery.com/change/" rel="nofollow">http://api.jquery.com/change/</a> says both are same, courtesy to Alexeyss. I was wondering if there is a difference in performance, or browser related issues etc.,</p>
| javascript jquery | [3, 5] |
5,733,898 | 5,733,899 | Going from Java desktop programming to Android Application Developement | <p>I know similar questions have been asked before but i think this is slightly different. for about a year Ive been learning Java. I have been building a few applications on the desktop using my-eclipse and swing GUI. Now i want to start programming for the android. I understand how to do what i want in Java but it all seems very different on android. Does anyone know of any good tutorials or videos out there with step by step instructions showing examples of android applications so that i can learn and build off of them? Most of my programs are simple and for the most part i just need to understand how to interact with the interface (IE the buttons, label or text views i think they call them and so on). I've searched all day and I cant find anything good.</p>
| java android | [1, 4] |
2,258,772 | 2,258,773 | append json objects into json array | <p>I have an form and would like to append the contents of it to an existing array. <br />
I am using <code>JSON.stringify( $('#myForm').serializeObject() )</code> to convert my form elements into <code>json</code> objects. <br />
The form has user info that i would like to append into <code>myArr</code> then append this list into an existing array. <br /><br />
<code>myArr</code> is populating fine, its just appending that into <code>existingJsonArray</code> i seem to be having problems with.<br /><br />
I <a href="http://stackoverflow.com/questions/617036/appending-to-a-json-object">saw this</a> but since <code>JSON.stringify</code> creates the full json array would i need to knock out the <code>[{</code> and <code>}]</code> ?<br /><br />
Is this the correct approach?</p>
<pre><code>var existingJsonArray = [];
var myArr = [];
myArr.unshift( JSON.stringify( $('#myForm').serializeObject() ) );
existingJsonArray.unshift(myArr);
</code></pre>
| javascript jquery | [3, 5] |
2,142,568 | 2,142,569 | Evaluate a JQUERY statement | <p>I use this kind of script to evaluate my javascript code that is injected in the DOM</p>
<pre><code>function wilEval(source) {
if ('function' == typeof source) {
source = '(' + source + ')();'
}
var script = document.createElement('script');
script.setAttribute("type", "text/javascript");
script.textContent = source;
document.body.appendChild(script);
if (window.execScript) {
window.execScript(source);
}
}
</code></pre>
<p>it works in IE and other major browsers but my problem is the code to be evaluated is a jquery code like this <code>$("#<?php echo "utm".$thr_id; ?>").effect("highlight", {}, 1000);</code> So how can evaluate it like a normal javascript code? thanks</p>
<p>P.S. the php echo just produce a dynamic element id =)</p>
| javascript jquery | [3, 5] |
4,631,646 | 4,631,647 | Javascript to back button | <p>I have one GridView with Employee search results in it.</p>
<p>This GridView shows results of EmpNo, EmpName, Salary. For each EmpNo cell in the GridView, there is a link to ManageEmployee.aspx page.</p>
<p>Till here okay, no problem.</p>
<p>In ManageEmployee.aspx page there are two buttons 1.Update, 2.Cancel</p>
<p>When user clicks on Cancel button, the page should navigate to Employee results page.</p>
<p>Can anybody give suggestion how to do this?</p>
| javascript asp.net | [3, 9] |
3,980,068 | 3,980,069 | JQuery best practices | <p>Ok guys, three questions here. They are all pretty noobish, but I just want to get your guys' thoughts on them.</p>
<p><strong>1)</strong> When writing a jquery script, should I include type?</p>
<p>IE: </p>
<pre><code><script type="text/javascript" charset="utf-8">
//Jquery here
</script>
</code></pre>
<p>or is just an opening and closing script tag acceptable?</p>
<p><strong>2)</strong> I know it's a best practice to include all JQuery just before the closing body tag, but does this also mean I include the actual jquery.js file just before body as well?</p>
<p><strong>3)</strong> What if my page is reliant on jquery to look how it should (not just action events/ajax/etc). For example, I'm using a jquery plugin called datatables, which sorts through my specified database and automatically paginates/sorts/etc. I find that because I include all the scripts after the DOM loads, I see a raw format of the datatable until my datatables.js file and corresponding constructor loads. Would it be acceptable to include this before my body loads, so that this doesn't happen?</p>
| javascript jquery | [3, 5] |
15,808 | 15,809 | This RadioGroup layout or its LinearLayout parent is useless | <p>I am trying to embed <code>RadioGroup</code> with <code>LinearLayout</code>, so to add elements dynamically to my Layout. My code goes here</p>
<p>`</p>
<p></p>
<pre><code><RadioButton
android:id="@+id/dailyCheck"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/dailyCheck"/>
<RadioButton
android:id="@+id/selectedCheck"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/selectedCheck" />
<RadioButton
android:id="@+id/specificCheck"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/specificCheck" />
</code></pre>
<p>
`</p>
<p>Doing this shows an exception:</p>
<p><code>This RadioGroup layout or its LinearLayout parent is useless</code></p>
<p>Please suggest me what to do.</p>
<p>Why can't <code>LinearLayout</code> and <code>RadioGroup</code> be together in one file.</p>
| java android | [1, 4] |
1,157,789 | 1,157,790 | Get GridView row index from a template field button | <p>first question:</p>
<p>I have a gridview 'gvSnacks' with a list of snacks and prices. The first column of the gridview is a templatefield with the button 'btnAdd'.</p>
<p>When one of the add buttons is clicked I want it to assign that rows value to an integer so I can retrieve additional data from that row.</p>
<p>This is what I have, but I've hit a dead end.</p>
<pre><code>protected void btnAdd_Click(object sender, EventArgs e)
{
int intRow = gvSnacks.SelectedRow.RowIndex;
string strDescription = gvSnacks.Rows[intRow].Cells[2].Text;
string strPrice = gvSnacks.Rows[intRow].Cells[3].Text;
}
</code></pre>
<p>Appreciate any help!</p>
| c# asp.net | [0, 9] |
5,809,635 | 5,809,636 | String manipulation in java to get another string | <p>I have the String <code>content://com.android.contact/data/5032</code> in a variable <code>Str1</code>. I want to manipulate <code>Str1</code> so that I will get <code>5032</code> in another string variable. </p>
<p>Can anyone suggest the answer?</p>
| java android | [1, 4] |
2,671,200 | 2,671,201 | Opening a file of any extension in an iframe | <p>I have a web application in which i need to open any files in standard formats such as .doc/docx/.csv/.txt/.xls in an iframe . How can I achieve this ? I tried using the sample code below but it is not opening all the file formats in the iframe. I am getting some XML error.</p>
<pre><code>var ext = GetExtension(fileName);
switch (ext)
{
case "pdf":
Response.ContentType = "Application/pdf";
break;
case "htm":
case "html":
Response.ContentType = "text/html";
break;
case "txt":
Response.ContentType = "text/plain";
break;
case "doc":
Response.ContentType = "Application/vnd.ms-word";
break;
case "xls":
case "csv":
Response.ContentType = "Application/vnd.ms-excel";
break;
case "ppt":
case "pps":
Response.ContentType = "Application/vnd.ms-powerpoint";
break;
default:
Response.ContentType = "Application/unknown";
break;
}
if (Response.ContentType != "Application/unknown")
{
Response.Flush();
Response.WriteFile(fileName);
Response.End();
}
</code></pre>
| c# asp.net | [0, 9] |
3,765,996 | 3,765,997 | Android - Can't draw image at coordinates using matrix | <p>Okay, I have a method that takes the variables: an image, int x, int y, float angle.</p>
<p>I am using a canvas, and I am using a <code>Matrix transform = new Matrix();</code> to rotate the image at it's center. However, I want the image to be drawn at the coordinates of <code>x</code> and <code>y</code>. For some reason, all the different methods I have used have not worked. Sometimes it draws it at 0,0 or it doesn't even show up on the screen.</p>
<p>Here's my pseudo-code:</p>
<pre class="lang-java prettyprint-override"><code>//pseudo-code: img_width, img_height
public void drawImage(Bitmap img, int x, int y, float angle)
{
transform.setTranslate(x, y);
transform.setRotate(angle, img_width/2, img_height/2);
canvas.drawBitmap(img, transform, null);
}
</code></pre>
<p>I have gotten the image to rotate, but I want the image to be drawn at the specified coordinates: x,y.</p>
<p>I have tried swapping all the variables, used <code>transform.preRotate</code>, and basically spent 1 hour trying to figure out why nothing will work. I have lots of other images being drawn to the canvas, and they appear where they should, but when I want to rotate, it won't draw at the specified coordinates.</p>
<p>I've read about 5 SO questions and answers related to this, but none give me what I need.</p>
<p>I really need an answer and code urgently, thank you.</p>
| java android | [1, 4] |
3,047,763 | 3,047,764 | How to rotate an image clockwise or counterclockwise, whichever is shorter? | <p>I'm making a web page that includes a clock with an arrow in the center. When the user clicks on an hour, the arrow rotates to point to what he/she has clicked.</p>
<p>I'm using a jQuery image rotate plugin (jQueryRotate) to rotate the arrow.</p>
<p>Here is the current code to compute the number of degrees to rotate:</p>
<pre><code>var numTiles = $("ul li").size(); // Number of tiles is however many are listed in the UL, which is 12
var sel = 0; // Default hour selection
var rot = 0; // Default rotation is at the top (0 degrees)
var gap = 360 / numTiles; // Degrees between each tile
function rotateArrow(num) {
rot = num * gap;
$("#arrow").rotateAnimation(rot);
sel = num;
}
</code></pre>
<p>When the user clicks one of the hours, it passes num as a value of 1 through 12.</p>
<p>It works fine, but the problem is that if the arrow is pointing to 1 o'clock, and the user clicks 11 o'clock, the arrow rotates clockwise 300 degrees, when it would make more sense to rotate 60 degrees counterclockwise.</p>
<p>So, how can I write an equation to take the current hour (num) and the hour clicked (sel), and output a value as a positive or negative number, which equals the number of degrees to rotate that is most efficient, rather than just rotate only in one direction?</p>
<p>Any advice is appreciated. Let me know if you have any questions. Thanks!</p>
| javascript jquery | [3, 5] |
5,428,339 | 5,428,340 | Uploading files in dedicated server with asp.net | <p>I upload files and convert it into bytes and saved it in Database. It works correctly in my local system. but I hosted it in dedicated server, it cannot convert path into bytes. It shows an error </p>
<blockquote>
<p>'Could not find a part of the path 'C:\fakepath\1003.pdf'.</p>
</blockquote>
<p>Code:</p>
<pre><code>//byte[] bContent = myWebClient.DownloadData(@strFileUploadSubSplit[3]);
byte[] bContent = null;
// Open file for reading
System.IO.FileStream _FileStream = new System.IO.FileStream(strFileUploadSubSplit[3].ToString(), System.IO.FileMode.Open, System.IO.FileAccess.Read);
// attach filestream to binary reader
System.IO.BinaryReader _BinaryReader = new System.IO.BinaryReader(_FileStream);
// get total byte length of the file
long _TotalBytes = new System.IO.FileInfo(strFileUploadSubSplit[3].ToString()).Length;
// read entire file into buffer
bContent = _BinaryReader.ReadBytes((Int32)_TotalBytes);
// close file reader
_FileStream.Close();
_FileStream.Dispose();
_BinaryReader.Close();
string base64String = System.Convert.ToBase64String(bContent, 0, bContent.Length);
str = strFileUploadSubSplit[0] + "*" + strFileUploadSubSplit[1] + "*" + strFileUploadSubSplit[2] + "*" + base64String ;
string URL = "http://dev2.weicorp.com:81/IApp.svc/IApp/Doc";
string ret = string.Empty;
var webRequest = System.Net.WebRequest.Create(URL) as HttpWebRequest;
byte[] byteArray = Encoding.UTF8.GetBytes(str);
webRequest.Method = "POST";
webRequest.ContentType = "application/octet-stream";
webRequest.ContentLength = byteArray.Length;
Stream dataStream = webRequest.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
HttpWebResponse resp = (HttpWebResponse)webRequest.GetResponse();
dataStream = resp.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
ret = reader.ReadToEnd();
string status = ret.ToString();
context.Response.Write(status);
</code></pre>
| c# asp.net | [0, 9] |
5,407,537 | 5,407,538 | Destroy middle activity in android | <p>I just saw a piece of code:</p>
<pre><code>public class MyApplication extends Application {
private List<Activity> activityList = new LinkedList<Activity>();
private static MyApplication instance;
private MyApplication() {
}
public static MyApplication getInstance() {
if (null == instance) {
instance = new MyApplication();
}
return instance;
}
public void addActivity(Activity activity) {
activityList.add(activity);
}
public void exit() {
for (Activity activity : activityList) {
activity.finish();
}
System.exit(0);
}
}
</code></pre>
<p>I never thought that we can take control of other activity beside the current one. I usually call finish() inside its own activity, now I saw this code, I realize that we can finish() other activity as well.</p>
<p>Android stack is back stack architecture, so if I destroy any activity in the middle, what will happen? For example, I have 5 activity in the back stack, let say I finish() the third one, will the second and fourth be linked together now?</p>
| java android | [1, 4] |
3,589,581 | 3,589,582 | Javascript progress animation | <p>I am trying to build a progress bar using jQuery and javascript.</p>
<p>It is basically a bar</p>
<pre><code><div id="progressbar"><div id="progress"></div>
<div id="number">0%</div>
</code></pre>
<p>when you click on the next button (which isnt here) it changes the width of the progress div and using css3 it animates it nicely, but my problem here is the number. I have 5 screens so they are all 20% each and I would like to animate the numbers so while the bar is getting wider the number flicks through all numbers from 0% to 20% in the same time as the bar animation (0.5s)</p>
<p>I know with JQuery you could just use the innerHTML command and change it from 0% to 20% but I wanted to animate it.</p>
<p>Any idea how to do that?</p>
| javascript jquery | [3, 5] |
1,130,357 | 1,130,358 | How to record video using Intents? | <p>I need to unserstand how I can record video programatically. Now I use this construction:</p>
<pre><code>public class AndroidLearningActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.main);
Intent captureVideoIntent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(captureVideoIntent, 100);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Uri uri=data.getData();
Log.e("result", "result:"+resultCode);
}
}
</code></pre>
<p>When the application is opened then the camera will be opened too. I have record some video, but if I press "back" button on the device then the application crushes. Please, explain me, how can I do it? Thank you. </p>
| java android | [1, 4] |
3,775,509 | 3,775,510 | how to pass the id of a row link to a jquery , in order to use ajax? | <p>how to pass the id of an edit or delete link via jquery in order to use ajax and php ?
here's my code at the front-end which displays the links</p>
<pre><code>foreach($cat->getCategories() as $key => $val){
echo $val."&nbsp;&nbsp;&nbsp;<a id='editcat' href=edit.php?id=".$key.">Edit</a>&nbsp;&nbsp;&nbsp;<a id='deletecat' href=delete.php?id=".$key.">Delete</a><br />";
}
</code></pre>
<p>now how to pass those id's to the jquery ?</p>
<pre><code> $('#editcat').click(function(){
});
$('#deletecat').click(function(){
});
</code></pre>
| php jquery | [2, 5] |
102,471 | 102,472 | CSS Using to Make Many backgrounds Move at speeds that are different by mouse | <p>Hi i want to create an affect where background move to the mouse at different speeds to make an affect almost like 3d.</p>
<p>This is what i want to make that with which i have found <a href="http://www.freeglance.co.uk/submit" rel="nofollow">found this</a></p>
<p>can someone explained to me or show me some script that will do this please.</p>
| javascript jquery | [3, 5] |
766,035 | 766,036 | JQuery Assign a value to a new variable? | <p>Hi am using the following jquery code:</p>
<pre><code>$.cookie('the_cookie', 'the_value');
</code></pre>
<p>I want to assign the_value to a new variable...</p>
<p>like:</p>
<pre><code>var newVar = the_value;
</code></pre>
<p>How can I do this?</p>
| javascript jquery | [3, 5] |
913,928 | 913,929 | Jquery event doesn't fire in any case | <p>So, here I want just to alert true, when window is closed ( I mean particullary tab in browser).</p>
<pre><code>$(document).ready(function(){
});
$(window).unload(function(){
alert('true'); });
</code></pre>
<p>tried <code>$(window)</code> also inside <code>$(document).ready()</code>, nothing.</p>
| javascript jquery | [3, 5] |
3,295,440 | 3,295,441 | android-java error | <p>i am trying a develop a application..following is a snippet </p>
<pre><code>class metro_nodes {
public String station;
public GeoPoint point; }
public class mainscreen extends MapActivity {
/** Called when the activity is first created. */
MapController controller;
double latitude,longitude;
LocationManager loc;
Location lastknownloc;
LocationListener loclistener;
List<GeoPoint> geopoints = new ArrayList<GeoPoint>();
MapView mapView;
private LinkedList<metro_nodes> station_location = new LinkedList<metro_nodes>();
metro_nodes anand_nagar;
anand_nagar.station = "anand_nagar";
}
</code></pre>
<p>now in the second last line its giving -"Syntax error on token "station", VariableDeclaratorId expected after this token"</p>
<p>if i put curly braces around this statement then error get removed..but then i get java lang null pointer exception...
whats the problm ??</p>
| java android | [1, 4] |
1,146,390 | 1,146,391 | How to read an http input stream | <p>The code pasted below was taken from java docs on <a href="http://developer.android.com/reference/java/net/HttpURLConnection.html" rel="nofollow">HttpURLConnection</a>.</p>
<p>I get the following error: </p>
<pre><code>readStream(in)
</code></pre>
<p>as there is no such method. </p>
<p>I see this same thing in
the Class Overview for URLConnection at
<a href="http://developer.android.com/reference/java/net/URLConnection.html#getInputStream%28%29" rel="nofollow"><code>URLConnection.getInputStream()</code></a></p>
<p>Where is <code>readStream</code>? The code snippet is provided below:</p>
<pre><code> URL url = new URL("http://www.android.com/");
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
try
{
InputStream in = new BufferedInputStream(urlConnection.getInputStream());
readStream(in); <-----NO SUCH METHOD
}
finally
{
urlConnection.disconnect();
}
</code></pre>
| java android | [1, 4] |
179,721 | 179,722 | Thread.sleep in Canvas | <p>I am not able to display the rectangles after a certain delay in code.
Here is what I am doing</p>
<p>DashPathEffect dashPath =new DashPathEffect(new float[]{1,0}, 1);</p>
<pre><code> paint.setPathEffect(dashPath);
paint.setStrokeWidth(300);
final int size =300;
</code></pre>
<p>canvas.drawLine(0, size ,100 , size, paint);</p>
<p>try {</p>
<pre><code> Thread.sleep(4000, 0);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
</code></pre>
<p>canvas.drawLine(110, size ,200 , size, paint);</p>
<hr>
<p>I am not able to notice any delay between these two rectagles in the mobile screen. Both appear at the same time. All I am trying to do is, draw the rectangles one after other with some delay in between. What this code is rather doing is, waiting for 4 seconds and then displaying both rectangles at same time. Thank you. </p>
| java android | [1, 4] |
3,714,694 | 3,714,695 | Creating DIV dynamically, is not taking height and width on fly | <p>I want to create div dynamically based on some calculations.I am able build div's dynamically but the only issue is it's not taking height and width on fly.please any one share their view or code if possible.</p>
<p>Here's the script which i used for your reference.</p>
<pre><code><script type="text/javascript" language="javascript">
function createDiv()
{
var totalheight=400;
var totalwidth = 600;
var height = 80;
var width = 40;
var divheight = totalheight / height;
var divwidth = totalwidth / width;
var id=1;
for(var i=1;i<=divheight;i++)
{
var eh=divwidth;
var fh=1;
for (var w = 1; w <= divwidth; w++)
{
var div=document.createElement("<div id='"+id+"' style=\"background:#F0E68C;width:'"+width+"'px;height:'"+height+"'px;border:solid 1px #c0c0c0;padding: 0.5em;text-align: center;float:left;\"></div>");
document.body.appendChild(div);
eh=eh+divheight;
fh=fh+divheight;
id++;
}
var div1=document.createElement("<br/>");
document.body.appendChild(div1);
}
}
</script>
</code></pre>
<p>Thanks in advance.</p>
| javascript jquery | [3, 5] |
5,547,086 | 5,547,087 | image button with transparency | <p>I am totally new to Android development, please excuse my ignorance, but is it possible to make an image button that receives onClick events only when the user clicks on a non-transparent pixel of the button's image?</p>
| java android | [1, 4] |
5,821,938 | 5,821,939 | A slight issue with zClip zJquery ZeroClipboard | <p>Im trying to put a copy function on my website that will copy links Line by line and store them in the clipboard exactly as seen. zClip does that except when it copies the links it appears that the links get shifted. For example,</p>
<p>If I copy the links below with normal CTRL+C</p>
<pre><code>http://www.steamdev.com/zclip/
http://www.steamdev.com/zclip/
http://www.steamdev.com/zclip/
http://www.steamdev.com/zclip/
</code></pre>
<p>In notepad when I paste I will get this exact copy Line by line.</p>
<p>If I copy the Links with zClip then paste it to notepad it comes out like this:</p>
<pre><code> http://www.steamdev.com/zclip/http://www.steamdev.com/zclip/http://www.steamdev.com/zclip/http://www.steamdev.com/zclip/
</code></pre>
<p>I have tried to search for the source in zClip that grabs the text maybe it does it line by line but I could not find it. It appears that it takes the text as a whole but im not sure.
If anyone knows a solution to this please let me know.</p>
| javascript jquery | [3, 5] |
737,914 | 737,915 | Uploading file of 1 gb using jquery or javascript | <p>In my application developed in asp.net, client wants to upload files of 1 GB. please tell me some trick how i can achieve it through it.</p>
<p>this application is about to watching video online so the administrator will upload the movies videos file. so now how i can upload files which are large than 1 Gb</p>
| javascript jquery asp.net | [3, 5, 9] |
120,580 | 120,581 | check box enable in Jquery | <pre><code><tr id="tr99"><td>......</td></tr>
<input type="checkbox" onclick="toggletr(this);" value="val" id="cbox" />
</code></pre>
<p>The javascript:</p>
<pre><code>$(document).ready(function() {
function toggletr(obj)
{
if(obj.checked)
$(#tr99).hide();
else
$(#tr99).show();
}
</code></pre>
<p>hi.this is my code that runs in add page of staff.
if user is in edit mode the value that value is checked in the code
i mean to say in .cs .
<code>checkbox.checked ="true"</code> means . that time i need to make that tr value "tr99" is visiable true
if checkbox is not checked then make the tr as hide.</p>
| javascript jquery | [3, 5] |
4,236,635 | 4,236,636 | Too much redundant javascript code | <p>On my asp.net pages i need to control for Dirty controls. I'm not that good in javascript so i found a solution on the internet for doing that by doing so : </p>
<pre><code><script type="text/javascript" language="javascript">
//Demo of completely client side dirty flag.
function setDirty() {
document.body.onbeforeunload = showMessage;
//debugger;
document.getElementById("DirtyLabel").className = "show";
}
function clearDirty() {
document.body.onbeforeunload = "";
document.getElementById("DirtyLabel").className = "hide";
}
function showMessage() {
return ""
}
function setControlChange() {
if (typeof (event.srcElement) != 'undefined') {
event.srcElement.onchange = setDirty;
}
}
document.body.onclick = setControlChange;
document.body.onkeyup = setControlChange;
window.onunload = function (sender, eventArgs) {
if (window.opener != null) {
window.opener.ClearBlocker();
if (window.opener.TempClientReturnFunction != null)
window.opener.TempClientReturnFunction = window.opener.ReturnFunction;
}
}
</script>
</code></pre>
<p>but if i have like 7 pages where i need to control for Dirty Controls, its gonna be too much redundant code. Are there any ways to create some class/library from where i can just call functions or are there maybe even smarter way of doing that? </p>
| c# javascript asp.net | [0, 3, 9] |
1,528,527 | 1,528,528 | how to prevent dublicate record on run time | <p>This code cause double record...
i checked my insert code for all tables and it works fine...</p>
<p>and this is insert code:</p>
<pre><code> StoreDO store = new StoreDO();
List<BrandDO> brandList = new BrandBL().SelectBrands();
StoreBL storeBL = new StoreBL();
store.StoreName = txtStoreName.Text;
store.StorePhone = txtStorePhone.Text;
store.StoreAddress = txtStoreAddress.Text;
store.CityID = int.Parse(ddlCity.SelectedValue);
store.CountyID = int.Parse(ddlCounty.SelectedValue);
store.IsActive = chkIsActive.Checked;
int storeID = storeBL.InsertStore(store);
ContentPlaceHolder contentPlaceHolder = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
for (int i = 0; i < brandList.Count; i++) {
string brandName = brandList[i].BrandName.ToString() + brandList[i].BrandID.ToString();
StoreBrandBL storeBrandBL = new StoreBrandBL();
CheckBox chkBrand = (CheckBox)contentPlaceHolder.FindControl(brandName);
if (chkBrand != null) {
if (chkBrand.Checked) {
StoreBrandDO storeBrandDO = new StoreBrandDO();
storeBrandDO.StoreID = storeID;
storeBrandDO.BrandID = brandList[i].BrandID;
storeBrandDO.IsActive = true;
storeBrandBL.InsertStoreBrand(storeBrandDO);
}
}
}
</code></pre>
<p>thank you...</p>
| c# asp.net | [0, 9] |
5,996,102 | 5,996,103 | How to hide the div and make it visible again after some interval while using jquery cycle plugin? | <p>I have a fade show of images and on top i have slide show of another div with description using jquery cycle plugin. Both will happen simultaneously.so that description match the image.</p>
<p>But I want description div to come in from left after image comes and go back like toggle effect before image changes.</p>
<p>Code used is</p>
<pre><code>$(document).ready(function() {
$('.slideshow').cycle({
fx: 'fade',
timeout: 6000,
delay: -2000
});
$('.slideshowtext').cycle({
fx: 'scrollRight',
timeout: 6000,
delay: -2000
});
});
</code></pre>
| javascript jquery | [3, 5] |
4,562,187 | 4,562,188 | Find parent or parents directories of a file | <p>I have a file say xyz.doc .I want to find the parent /Parents of this file ,so that i can bind it in a tree view . How can we achive this ?</p>
<p>I have the fileinfo class which is obtained by the code </p>
<pre><code>FileInfo[] files = Directory.GetFiles(path,"*.*);
</code></pre>
| c# asp.net | [0, 9] |
4,631,377 | 4,631,378 | Bind function to multiple events of different elements at once | <p>I would like to bind a function to the <code>mouseout</code> event of my <code><canvas></code> element, and bind the same function to the <code>blur</code> and <code>contextmenu</code> events of my body. How would I go about binding this function to those elements at once, when there are <strong>different elements</strong> which need the same function bound to <strong>different events of each</strong>?</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
4,750,781 | 4,750,782 | js function not working properly, why? | <p>The function isn't working when i'm using <code>$(document).ready(function () { ..... });</code>
but it works when i invoke. please take a look.</p>
<pre><code>#test {height:25%,width:25% }
<body>
....
<div id="test">
<image src="file.jpg" />
</div>
...
</div> </body>
</code></pre>
<p><em><strong>js file (Not working) :</em></strong></p>
<pre><code>$(document).ready(function () {
$('#test').draggable();
});
</code></pre>
<p><strong><em>js file (Working when a function is invoked)</em></strong></p>
<pre><code>function startDrag() { // I just called this function from html files e.g. <div id="test" onmouseover="startDrag();">....</div>
$('#test').draggable();
}
</code></pre>
| javascript jquery | [3, 5] |
4,208,272 | 4,208,273 | Drag and drop div using jquery | <p>I got a Main Div where i can drop any text and this will be displayed as in a form shown in the below script.</p>
<p>I need to drag and drop the dynamically generated div to move it up or down ,from within the current div. Is this possible? </p>
<pre><code> <script type="text/javascript">
$(init);
function init() {
function addColumn(column)
{
var iHtml;
//Labeling and Tool Tip the Checkbox
iHtml = "<div id='<%" + column + ".ClientID%>'><span title='ToolTipText'>"+
"<input id='<%" + column + ".ClientID%>' type='checkbox' name='<%" + column + ".ClientID %>' />"+
"<label for='<%" + column + ".ClientID%>'>MyCheckBox</label></span></div>";
return iHtml
}
</code></pre>
<p>}</p>
| jquery asp.net | [5, 9] |
642,058 | 642,059 | Need intellisense or autocomplete feature for my own javascript file | <p>Jquery comes with a vsdoc file that help us to get intellisense or autocomplete feature for jquery. if i want to have the same intellisense or autocomplete feature for my own javascript file then what i need to do.....please help. thanks</p>
| javascript asp.net | [3, 9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.