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
5,267,896
5,267,897
on selecting the dropdownlist 2 nd time textbox value not showing blank
<p>I have written following code.</p> <p>my 1st orderid has both records for process 1 and process 2 but my 2nd orderid has record only for process 1.</p> <p>when i select orderid 2 after selecting orderid 1 it keeps the value as it is for orderid 1 in process 2 textbox. i want that textbox to be blank</p> <pre><code>protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { DbConnect objdbc = new DbConnect(); SqlConnection con = objdbc.openConnection(); SqlCommand cmd = new SqlCommand("SELECT [orderid],[processid],[orgid],[processdesc] ,[perwet] FROM [anghan].[dbo].[ProcessOrder] where orderid='" + DropDownList1.SelectedItem.Value + "' and processid=1 ", con); cmd.CommandType = CommandType.Text; // cmd.Parameters.AddWithValue("@Id", value); cmd.Connection = con; //con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { TextBox2.Text = dr["perwet"].ToString(); // DropDownList1.Items(DropDownList1.SelectedIndex).Text = dr["service"].ToString(); } dr.Close(); //process 2 SqlCommand cmd2 = new SqlCommand("SELECT [orderid],[processid],[orgid],[processdesc] ,[perwet] FROM [anghan].[dbo].[ProcessOrder] where orderid='" + DropDownList1.SelectedItem.Value + "' and processid=2 ", con); cmd2.CommandType = CommandType.Text; // cmd.Parameters.AddWithValue("@Id", value); cmd2.Connection = con; //con.Open(); SqlDataReader dr2 = cmd2.ExecuteReader(); while (dr2.Read()) { TextBox3.Text = dr2["perwet"].ToString(); // DropDownList1.Items(DropDownList1.SelectedIndex).Text = dr["service"].ToString(); } dr2.Close(); </code></pre>
c# asp.net
[0, 9]
3,497,340
3,497,341
what is an algorithm that can sort students into bible study groups of 8 people each
<p>the groups should meet the following conditions: Group members should not be of the same gender, not of the same year of study, not from the same halls of residence</p>
java php
[1, 2]
5,283,433
5,283,434
JS: how to listen event after template contruction?
<p>I'm listening for an event with jQuery.on() but it is not working, I imagine is because the DOM element.</p> <p>Then, How can I listen to the "click" event?</p> <p><a href="http://jsfiddle.net/QbXLf/" rel="nofollow">http://jsfiddle.net/QbXLf/</a></p> <pre><code>$(".myClass").on("click", function(event){ alert("Not Working :("); }); </code></pre> <p>please HELP!</p>
javascript jquery
[3, 5]
5,770,650
5,770,651
Condition in ASP Repeater
<p>I am trying to put a condition into my ASP repeater tag. I have a table being created and one of the td items is a link. The problem is I need to create a link upon checking the value in one the variable that is in the repeater container. Here is my code: </p> <pre><code>&lt;td&gt;&lt;%#((VWApp.Code.TrackDM)Container.DataItem).CdNo%&gt;&lt;/td&gt; &lt;td&gt;&lt;%#((VWApp.Code.TrackDM)Container.DataItem).ShippingNo%&gt;&lt;/td&gt; </code></pre> <p>Now i need to check the value of ShippingNo and rather than displaying it need to display a link. i tried to write an if condition like this:</p> <pre><code>if(((VWApp.Code.TrackDM)Container.DataItem).ShippingNo. .. ) { // do processing and generate a link that needs to displayed } </code></pre> <p>But i get error when trying to do this. Can anybody guide me to the right way of doing this?</p> <p>Any ideas and suggests are highly appreciated.</p>
c# asp.net
[0, 9]
3,538,836
3,538,837
multiple scripts files via ajax or combined all?
<p>Content from my site gets changed via ajax. Each page its a ajax request.</p> <p>Right now each page from my site has some sort of jquery/javascript functions to handle any event require for that page. Each page has their own javascript loaded by getscript and its cached so the javascript is only request when the user visits that page.</p> <p>My question is it better to load each javascript on request(their cached) or to just put all the javascript functions in one big file and load it once?</p>
javascript jquery
[3, 5]
3,577,648
3,577,649
Download file from virtual path URL asp.net
<p>I have a virtual path URL (http://xyz.com/eRoom/SPOmidrangesysdiv/EFT3%20Test%20Scorecard%20for%20Inyo.xlsx). Credentials required to brow this url. I want to download file from url using ASP.NET C#. </p>
c# asp.net
[0, 9]
1,788,172
1,788,173
How to get current date in jquery?
<p>I want to know using Date() function in jQuery how to get the current date in yyyy/mm/dd format.</p>
javascript jquery
[3, 5]
5,641,776
5,641,777
jQuery element as a variable
<p>I have:</p> <pre><code>function foo(element){ var idName= element.innerHTML.split(" ").join(""); $("#" + idName).fadeToggle(600); } </code></pre> <p>and it is not working. I'm just getting the text in a span and deleting the spaces. I use idName as the id of a div, and i'm toggling the div. I thought I could do this with jQuery?</p>
javascript jquery
[3, 5]
3,112,610
3,112,611
jQuery Code Style Guidelines
<p>One of the jQuery Core Style Guidelines indicate:</p> <blockquote> <p>All RegExp operations should be done using .test() and .exec(). "string".match() is no longer used.</p> </blockquote> <p>Why is <code>match()</code> not favoured?</p>
javascript jquery
[3, 5]
2,394,037
2,394,038
how to collect form ids using jQuery
<p>A jQuery selector <code>$(".thumb_up")</code> returns a collection of forms like this:</p> <pre><code>[&lt;form id="like_post_78" ...&lt;/form&gt; &lt;form id="like_post_79"&gt; ... &lt;/form&gt;] </code></pre> <p>Ultimately I want to generate a string consisting of the numerical ending portion of the form ids.</p> <pre><code>"78,79" </code></pre> <p>What's the most efficient way of getting this?</p>
javascript jquery
[3, 5]
803,471
803,472
How to append the same variable twice?
<p>I am trying to append the same variable twice but it appears the code only works on the second one.</p> <pre><code>var test=document.createElement('option'); test.innerHTML='some data'; $('#data1').append(test); $('#data2').append(test); </code></pre> <p>I want to append the variable test twice WITHOUT creating another variable. Thanks a lot!</p>
javascript jquery
[3, 5]
5,086,230
5,086,231
Time picker giving unusual time format on android
<p>I have used a time picker in my android project. In the onTimeChange method I did something like this:</p> <pre><code>@Override public void onTimeChanged(TimePicker view, int hourOfDay, int minute) { long PICK = ((hourOfDay * 60 * 60) + (minute * 60)) * 1000; String delegate = "hh:mm aaa"; timemode = (String) DateFormat.format(delegate, PICK); Toast.makeText(getApplicationContext(), timemode, Toast.LENGTH_LONG).show(); } </code></pre> <p>but when I toast it, its showing unusual time(6 hours diffrence), how to get the original time picked in the time picker?</p>
java android
[1, 4]
3,620,660
3,620,661
Android/Java: Split Data in an Array and display
<p>I am trying to do something extremely basic! And it wont work :(. I feel like I'm going in circles.</p> <p>Here's the rundown: I would like the user to input a series of numbers into an EditText box (separated by comma's). After the add button is selected a split method will separate each number into its own slot in a String[]. EVENTUALLY, if I can get this part to work, the numbers will be pulled out of the array and converted to doubles.Then they will be used in a calculation or two. I have tried several different ways of getting this done and it seems like the problem is coming from the split method or for-loop. The code listed below returns an empty string.</p> <p>Also, through my trial and error I ended up with a return method calculate(). How much stuff can a cram in an onClick method? Was this a bad idea? Please be as a brutal as needed!!! I'm new to android. Thanks in advance.</p> <hr> <pre><code>package com.simplydesign.android.standarddev; import android.app.Activity; import android.os.Bundle; import android.widget.*; import android.view.*; public class Main extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Button addBtn = (Button) findViewById(R.id.addBtn); final EditText userData = (EditText) findViewById(R.id.editText1); final TextView dataCollection = (TextView) findViewById(R.id.textView1); addBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String[] rawData; rawData = userData.getText().toString().split(","); dataCollection.setText(calculate(rawData)); } }); } public String calculate(String[] a) { String output = ""; for (int i = 0; i &lt; a.length - 1; i++) { output += " " + a[i]; } return output; } } </code></pre>
java android
[1, 4]
337,362
337,363
ASP.NET: How to send file from database to printer?
<p>I have an ASP.NET 2.0 (C#) webpage with a link that pulls a blob from a MS SQL database and ouputs it in the appropriat file format, i.e., Word, WordPerfect, PDF.</p> <p>My users would like to print these files with one click. Right now they have to click the link to open the file, then click the "Print" button within the application that they file opened.</p> <p>In addition, I would like to send multiple documents to the printer, using one click, if possible.</p> <p>Thanks.</p>
c# asp.net
[0, 9]
4,838,722
4,838,723
FormView change data before inserting to sql?
<p>I'm using FormView to add new data to the sql server. I try to change some of the data that the user inserting, like replace "a" with "A"</p> <p>I try to use the following code:</p> <pre><code>protected void FormViewInsertEventHandler(object sender, SqlDataSourceCommandEventArgs e) { e.Values["Institution_fax"] = "33333"; } </code></pre> <p>and</p> <pre><code>&lt;asp:SqlDataSource ID="SqlDataSourceSP" runat="server"  ConnectionString="&lt;%$ ConnectionStrings:ConnectionString1 %&gt;"    InsertCommand="usp_limodimInstitution_insert"    InsertCommandType="StoredProcedure"    SelectCommand="select * from tbl_limodim_Institution"&gt; </code></pre> <p>But i get the following error </p> <blockquote> <p>No overload for 'FormViewInsertEventHandler' matches delegate 'System.Web.UI.WebControls.FormViewInsertEventHandler'</p> </blockquote> <p>What have I missed?</p>
c# asp.net
[0, 9]
1,243,043
1,243,044
jquery update table with load
<p>Can anyone help fix the code below...</p> <p>I'm loading data into a table with three columns using the code below into a table on clicking a link (This part works fine by itself):</p> <pre><code>$(document).ready(function() { $("#myTable").tablesorter(); $("#ajax-append").click(function() { $.get("get_data.php", function(html) { $("#myTable tbody").append(html); $("#myTable").trigger("update"); }); return false; }); }); </code></pre> <p>However now I want to run another function after this part is completed to get additional information and place it into the last column of my table.</p> <p>Unfortunately nothing happens at all.</p> <pre><code>$(document).ready(function() { $("#myTable").tablesorter(); $("#ajax-append").click(function() { $.get("get_data.php", function(html) { $("#myTable tbody").append(html); $('#myTable tr').each(function(index)){ var col1 = $(this).children('td.col1').text(); $(this).children('td.col3').load('more.php?url='+col1); }); $("#myTable").trigger("update"); }); return false; }); }); </code></pre>
php jquery
[2, 5]
836,014
836,015
Tools for rapid layout/interface creations?
<p>Does anyone know of any tools (besides DroidDraw) that can help me create the basics of my projects a bit quicker? I'm looking for something that will allow me to very quickly generate the XML for my layouts so I don't have to sit there typing like a robot for so long. </p> <p>Thanks!</p>
java android
[1, 4]
5,643,482
5,643,483
Is there a jQuery construct for "if (typeof someVar === 'undefined')"
<p>Does jQuery provide a way to to that test in a more concise way?</p> <p><strong>Update</strong> I should have left jQuery out of this. It is just an issue of JavaScript. It's been so long for me! I am testing to see is something externally-defined module was loaded or not. It appears that I can just use this instead:</p> <pre><code>if (window.someVar) </code></pre> <p>Please correct me if this is a bad practice. In my case, if someVar is defined, it will be an object. It will not be defined to false.</p>
javascript jquery
[3, 5]
3,153,008
3,153,009
Can I convert all files with jquery file upload to jpg?
<p>I'm using the <a href="http://blueimp.github.com/jQuery-File-Upload/" rel="nofollow">jquery file upload</a> script and it's working really well so far. The last obstacle I have is I only want to use <strong>jpg</strong> images for my website but allow users the option of uploading gif, png, or jpg. </p> <p>I'm assuming I need to alter or add some additional methods to the upload.class.php file to accomplish this.</p> <p>Has anyone done this before and if so is this the correct file to modify?</p>
php jquery
[2, 5]
1,002,541
1,002,542
How to select elements with exact one class name?
<p>so I have,</p> <pre><code>&lt;ul&gt; &lt;li class="foo"&gt; abc &lt;/li&gt; &lt;li class="foo bar"&gt; def &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>If I do <code>$('.foo').css('font-size','x-large');</code></p> <p>this will change both li elements with the large font. How could I select the class with "foo" only but not "bar"?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
5,364,696
5,364,697
What's the algorithm behind stack overflow's ajax tag search field
<p>I want to make an ajax auto complete field like stack overflow's tag search box(used to add favorite tags and add tags to your question). I used to call ajax every time key's up,but I think it's not efficient.</p> <p>I find stack overflow does it well. I guess it would only call ajax when key's up and some time has passed. I then wrote these lines to test:</p> <pre><code>$("#a").keyup(function(){ clearTimeout(c); var c=setTimeout(alert("keyup and 0.5s have passed"),500); }) </code></pre> <p>it does alert after key up and after 0.5 seconds, but it alert several times as key up times. Does clearTimeout() suppose to stop setTimeout() to be executed? Why it doesn't work? What's the right way to do this?</p>
javascript jquery
[3, 5]
4,063,849
4,063,850
pass a javascript via ajax and process with php
<p>I need to pass a javascript object , info is a javascript object.</p> <pre><code>register.php?t="+accessToken+"&amp;u="+info </code></pre> <p>in php i tried to change </p> <pre><code>$data = $_GET['u'] ; var_dump($data); </code></pre> <p>It's not working help me to slove,</p>
php javascript
[2, 3]
2,528,148
2,528,149
jQuery - Combining multiple element selectors with :not - how
<p>I am having a devil of a time getting two selectors to work <em>together</em> as well as do when I declared seperate.</p> <p>My issue:</p> <p>I want to close a menu when I move to <em>any</em> input OR anchor tag that is NOT contained with a certain element. When I explicitly code for both input and anchor, I get the behavior I need - BUT when I try to condense my code and combine them, it behaves weirdly and does not work as intended.</p> <p>So, basically when a user focus's in an input field or anchor that is NOT a child of my selector I want to close a menu. When I use two sperate handlers, it works. I want to combine them. </p> <p>I am trying to shorten this....</p> <pre><code>jQuery('#hdr input:not(#opt *)') .focusin(function(event){ setTimeout(function(){ jQuery("#opt").hide() },100); }); jQuery('#hdr a:not(#opt *)') .focusin(function(event){ setTimeout(function(){ jQuery("#opt").hide(); },100); }); </code></pre> <p>I've tried all of this into one line, to no avail:</p> <pre><code>jQuery('#hdr a input:not(#opt *)') jQuery('#hdr a, #hdr input:not(#opt *)') &lt;-- I expect this to work, but doesn't. jQuery('#hdr a,input:not(#opt *)') jQuery('#hdr *:not(#opt *)') </code></pre> <p>It seems to only work when I do a single arg like: #hdr a , or #hdr input BUT when I try to combine them, no luck. I've searched high and low but no luck.</p>
javascript jquery
[3, 5]
4,398,179
4,398,180
Where to put the php code in the php script below
<p>I have a javascript variable below where it is suppose to retrieve <code>$_SESSION['imagename']</code> from imageupload.php (a seperate page)</p> <pre><code>var imagename = &lt;?php echo json_encode(isset($_SESSION['imagename']) ? $_SESSION['imagename'] : null); ?&gt;; </code></pre> <p>But what my question is where do I put this code below in the php script so that the session variable contains the name of the files and be able to be retrieve by the variable above?</p> <pre><code>if (isset($_POST['fileImage'])) { // fileImage is the name of the file input $_SESSION['imagename'] = $_FILES['fileImage']['name']; } $_SESSION['fileImage']['name'] = $_FILES['fileImage']['name']; </code></pre> <p>Below is the php script:</p> <pre><code>$result = 0; if( file_exists("ImageFiles/".$_FILES['fileImage']['name'])) { $parts = explode(".",$_FILES['fileImage']['name']); $ext = array_pop($parts); $base = implode(".",$parts); $n = 2; while( file_exists("ImageFiles/".$base."_".$n.".".$ext)) $n++; $_FILES['fileImage']['name'] = $base."_".$n.".".$ext; move_uploaded_file($_FILES["fileImage"]["tmp_name"], "ImageFiles/" . $_FILES["fileImage"]["name"]); $result = 1; } else { move_uploaded_file($_FILES["fileImage"]["tmp_name"], "ImageFiles/" . $_FILES["fileImage"]["name"]); $result = 1; } ?&gt; &lt;script language="javascript" type="text/javascript"&gt; window.top.stopImageUpload(&lt;?php echo "'$result'";?&gt;); // call backs javascript function &lt;/script&gt; </code></pre>
php javascript jquery
[2, 3, 5]
5,913,774
5,913,775
Regular expression to check current website location - small isssue
<p>I have this jquery code to highlight menu item corresponding to current page in my browser: </p> <pre><code> $(document).ready(function (){ $("ul#nav a").each(function (){ var hrefWindow = $(this).attr("href"); if (hrefWindow == window.location.href.match(/[^/]+$/g)) { $(this).parent().addClass("active"); } else { $(this).parent().removeClass("active"); }; }); }) </code></pre> <p>As you can see expression is looking for string which is just after slash in my web address like: </p> <p>www.mywebsite.com/thisStringWillBeFoundByExpression , </p> <p>everything works fine but there is small issue when I type my domain address for the first time as there will be only www.mywebsite.com (without index.htm after slash) in address bar and my expression won't find a thing. </p> <p>How to modify my code to add class 'active' to index.htm in case if there is only www.mywebsite.com in the address bar?</p>
javascript jquery
[3, 5]
1,794,555
1,794,556
On text-box length greater then zero clear listbox and disable
<p>Is it possible in java script that when a text box control is populated that it clears my list box and disables it and visa versa. I'm using ASP.net C# to bind the list box.</p> <pre><code>&lt;asp:TextBox ID="_tx_Zip" On??? runat="server" Width="197px"&gt;&lt;/asp:TextBox&gt; &lt;asp:ListBox ID="_lb_Zip" runat="server" Height="82px" SelectionMode="Multiple" Width="200px"&gt; </code></pre> <p>I was messing around with the OnTextChanged event but that's no good. Sorry I'm trying to learn java script.</p>
javascript asp.net
[3, 9]
4,642,015
4,642,016
why cant the php function wait for the click instead
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8239891/function-running-automatically-instead-of-a-click">function running automatically instead of a click</a> </p> </blockquote> <p>Hi Guys I am trying so many ways of accomplishing something, I would like the php code run when the js finds that click event instead it runs on page load is there anyway of doing this please help:</p> <pre><code>&lt;script&gt; jQuery('#next').click(function(){ $(this).data('clicked', true); }); if(jQuery('#next').data('clicked')) { function stop() { var stop_record = "&lt;?=$test-&gt;stoprec;?&gt;"; } } &lt;/script&gt; </code></pre>
php javascript jquery
[2, 3, 5]
4,203,661
4,203,662
Is it possible to determine whether the current browser tab has history?
<p>I have a button on a view, which on submit directs the user's browser back to the previous page using <code>window.history.go(-1);</code>. This is necessary for us to maintain session data to display the previous view correctly.</p> <p>My question is, is it possible for us to determine whether there is any browser history using jQuery so that if there is none we can instead redirect the user with </p> <pre><code>window.location = "/Transaction/Index"; </code></pre> <p>to the correct page?</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
4,321,645
4,321,646
Save private data to public location
<p>I am trying to open my PDF file with PDF Reader, I am searching more on how can i done this, a lot of answer found but every answer tells that save that file to "SD Card".</p> <p>Saving file to SD Card is good idea but the problem is if user not installed SD Card in his phone. At present time many phone have large inbuilt memory for example: Samsung galaxy S3, HTC One V, Samsung Galaxy Note, Sony Xperia S and many phone. </p> <p><strong>So my Question is</strong>: These phones already have a large inbuilt memory, so user not need to add SD Card with it (it depends on user). In this case <strong>which location is accessible to other applications</strong> like public location (SD Card).</p> <p>When I searching for my problem i found this <a href="http://developer.android.com/guide/topics/data/data-storage.html" rel="nofollow">link</a> that tell about location for saving application data provided by Android Platform.</p> <p>Android Platform provides these options to save app data:</p> <ol> <li>Shared Preferences</li> <li>Internal Storage</li> <li>External Storage</li> <li>SQLite Databases</li> <li>Network Connection</li> </ol> <p>Android provides a way to expose private data to other applications — with a content provider</p> <p>I read about content provider but i didn't understand how it works.</p> <p>If any tutorial show how it works please provide that tutorial link or if this can done in other way please tell me how.</p> <p>Any help will be appreciated. Thanks! </p>
java android
[1, 4]
5,377,412
5,377,413
How to display hidden placeholder without refreshing the page?
<p>I have two placeholders in one page and basically my requirement is that I want to show other placeholder on click of button which is in first placeholder without refreshing the page.</p> <p>But when I m clicking on the button in 1st placeholder it is refreshing the page and then showing me second placeholder.I m open to hear any other suggestions also if it is not possible through placeholder.</p> <p>Can anyone tell me how to achieve this?</p> <p>Thanks,</p>
c# asp.net
[0, 9]
2,688,414
2,688,415
Get the id of input on keyup
<p>I have an input box...</p> <pre><code>&lt;input type="text" id="search_member" onkeyup="lookup(this.value);"&gt; </code></pre> <p>When I type in the field, it will go to function lookup(). From there I want to get the id of this input. I tried...</p> <pre><code>var This_id = $(this).attr("id"); </code></pre> <p>but this won't work. Any suggestions on how I can get the id?</p>
javascript jquery
[3, 5]
6,013,141
6,013,142
ASP.NET radio button change
<p>I am trying to figure out why this code doesn't fire the radio button change event.</p> <p>here's the ASP page code for 2 radio buttons</p> <pre><code> &lt;asp:RadioButton ID="rdoButton1" GroupName="Group1" Text="Yes" Value="Yes" runat="server" OnCheckedChanged="Group1_CheckedChanged" /&gt; &lt;asp:RadioButton ID="rdoButton2" GroupName="Group1" Text="No" Value="No" runat="server" OnCheckedChanged="Group1_CheckedChanged" /&gt; </code></pre> <p>And here's the code behind:</p> <pre><code>protected void Group1_CheckedChanged(Object sender, EventArgs e) { if (rdoButton1.Checked) { panel1.Visible = true; } if (rdoButton2.Checked) { panel1.Visible = false; } } </code></pre>
c# asp.net
[0, 9]
5,190,729
5,190,730
Is it possible to Serialize and Deserialize objects in C++?
<p>As we know c++ is also an Object Oriented Programming language where most the things are objects like java. So wanted to know is the Serialize and deserializ features are available in c++ as well as we do it in java?</p> <p>If yes how it can be achieved?</p> <p>In java We use Serializable Interface to say that this type of object can be serialized and deserialized.</p> <p>So in c++ how?</p> <p>And out of curiosity is it same in c# as in java?</p>
c# java c++
[0, 1, 6]
1,110,027
1,110,028
Difference between response.redirect and server.transfer
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/521527/response-redirect-vs-server-transfer">Response.Redirect vs. Server.Transfer</a><br> <a href="http://stackoverflow.com/questions/224569/server-transfer-vs-response-redirect">Server.Transfer Vs. Response.Redirect</a> </p> </blockquote> <p>What is the difference between response.redirect and server.transfer? Only one difference i know is: In response.redirect the browser url changes to targeted page as well as in server.transfer the url remains same! any other difference?</p>
c# asp.net
[0, 9]
5,349,371
5,349,372
Javascript looping issue
<p>I know this is something easy that is just eluding me.</p> <p>Anyway, I have a simple function that loops through a series of six images and text and hides and shows them based on which one is visible.</p> <p>Issue I'm having is that when it gets to the last image, it should just start over with the first but instead it goes back to the middle image.</p> <pre><code>&lt;script type="text/javascript"&gt; setInterval('testAnimation()', 5 * 1000); show = 0; function testAnimation() { $("#headerImage" + show).fadeOut(); $("#headerText" + show).fadeOut(); if (show == 5) { show = 0; } else { show++; } $("#headerImage" + show).fadeIn(); $("#headerText" + show).fadeIn(); } &lt;/script&gt; </code></pre> <p>So it should go like this:</p> <pre><code>Hide: 0 Show: 1 Hide: 1 Show: 2 Hide: 2 Show: 3 Hide: 3 Show: 4 Hide: 4 Show: 5 Hide: 5 Show: 0 </code></pre> <p>But what happens after 4, 5 is 3, 4. Then it goes to 5, 0.</p> <p>Any ideas as to why?</p> <p>You can see the behavior here: <a href="http://www.findyourgeek.com/index-copy.php" rel="nofollow">http://www.findyourgeek.com/index-copy.php</a></p>
javascript jquery
[3, 5]
1,195,457
1,195,458
Multi-line, multi-data source auto complete textarea
<p>Is there a jquery plugin that supports multi-line ,multi-data source autocomplete textarea? By that I mean every line in the textarea is bound to a different data source which is specific only for that line. For example, on the first line of textarea the user types in a country name,he is then presented with a list of countries, makes his choice and then presses Enter key. He is now on the second line of the textarea and this time he will type in the city name, another list comes up and he goes through the same process until he completes the form.</p> <p>This is my attempt to simplify data input in the application Im building because it has lots of dropdown and input boxes.</p> <p>Thanks! </p>
javascript jquery
[3, 5]
3,671,211
3,671,212
Jquery autocomplete
<p>How do I customize the ac_results class generated by the autocomplete plugin?</p>
javascript jquery
[3, 5]
227,242
227,243
lightbox dynamic image retrieval
<p>I am constructing a lighbox gallery, currently experimenting with FancyBox (http://fancybox.net) and ColorBox (http://colorpowered.com/colorbox).</p> <p>By default you have to include a link to the large version of the image so that the Lightbox can display it. However, I am wanting to have the image link URLs pointing to a script rather than directly to the image file. So for example, instead of:</p> <pre><code>&lt;a href="mysite/images/myimage.jpg"&gt; </code></pre> <p>I want to do:</p> <pre><code>&lt;a href="mysite/photos/view/abc123"&gt; </code></pre> <p>The above URL points to a function:</p> <pre><code>public function actionPhotos($view) { $photo=Photo::model()-&gt;find('name=:name', array(':name'=&gt;$view)); if(!empty($photo)) { $user=$photo-&gt;user; $this-&gt;renderPartial('_photo', array('user'=&gt;$user, 'photo'=&gt;$photo, true)); } } </code></pre> <p>At some point in the future the function will also update the view count of the image.</p> <p>Now this approach is working to an extent - most images load up but some do not load up (the lightbox gets displayed in a malformed state). I think the reason for this is because it is not processing the function quick enough. For example when I click the "next" button it needs to go to the URL, process the function and retreive/output the response.</p> <p>Does anybody know how I can get this working properly?</p>
php jquery
[2, 5]
826,024
826,025
Convert imageUrl to byte[] for caching
<p>I have an image that I capture from an ip camera and post it on a webpage to an image tag. Now I would like to convert to access the picture so that I can save it to our cache blob. Here is my code:</p> <p>asp tag:</p> <pre><code>&lt;asp:Image ID="imgPhoto" runat="server" ImageAlign="Middle" /&gt; </code></pre> <p>code behind image assignment:</p> <pre><code>imgPhoto.ImageUrl = "http://10.10.40.35/axis-cgi/jpg/image.cgi?resolution=640x480"; </code></pre> <p>my attempt to convert the image to byte[]:</p> <pre><code>System.Drawing.Image _newImage = System.Drawing.Image.FromFile(imgPhoto.ImageUrl); MemoryStream ms = new MemoryStream(); _newImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] _fileBytes = new byte[ms.Length]; </code></pre>
c# asp.net
[0, 9]
3,298,053
3,298,054
filling <img src="?"> dynamically in asp.net c#
<p>Hi would like to add img source path dynamically as shown in the snippet below, but giving error. I know img_src_path adding syntax is correct. Unfortunately I don't know the solution, need help.</p> <p>Environment:</p> <p>ASP.net, c#</p> <pre><code> &lt;% string a[0]="image/hello.jpg;" { String img_src_path= a[0].ToString();%&gt; &lt;li&gt;&lt;a href='"&lt;%#img_src_path%&gt;"'&gt;&lt;img src='"&lt;%#img_src_path%&gt;"' alt="" title=""/&gt;&lt;/a&gt;&lt;/li&gt; &lt;%}%&gt; </code></pre> <p>/Shashi</p>
c# asp.net
[0, 9]
5,189,769
5,189,770
Is there means for synchronizing data of my application and MS Outlook?
<p>I have been developing Android applicatiom which should get dates from MS Outlook calendar. I can't find information/tutorials about how I can do it using USB connection. Please, tell me, is there any means for my task? Is there any tutorials how can I do it programmatically? </p>
java android
[1, 4]
2,171,699
2,171,700
Android simple widget
<p>I have a problem with my first android widget... I am doing like this:</p> <pre><code>public class TestwidActivity extends AppWidgetProvider { @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) { Timer timer = new Timer(); timer.scheduleAtFixedRate(new MyTime(context, appWidgetManager), 1, 1000); } @Override public void onReceive(Context context, Intent intent) { // v1.5 fix that doesn't call onDelete Action final String action = intent.getAction(); if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) { final int appWidgetId = intent.getExtras().getInt( AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) { this.onDeleted(context, new int[] { appWidgetId }); } } else { super.onReceive(context, intent); } } private class MyTime extends TimerTask { RemoteViews remoteViews; AppWidgetManager appWidgetManager; ComponentName thisWidget; java.text.DateFormat format = SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM,Locale.getDefault()); public MyTime(Context context, AppWidgetManager appWidgetManager) { this.appWidgetManager = appWidgetManager; remoteViews = new RemoteViews(context.getPackageName(), R.layout.main); thisWidget = new ComponentName(context, TestwidActivity.class); } @Override public void run() { Bitmap bm; remoteViews.setTextViewText(R.id.Clock, "Time = " + format.format(new Date())); bm= BitmapFactory.decodeFile("/sdcard/myFile.png"); remoteViews.setImageViewBitmap(R.id.team11, bm); appWidgetManager.updateAppWidget(thisWidget, remoteViews); } } } </code></pre> <p>but this stops printing the time after 2 seconds. If I only print the time without the image it works perfect, but in this way it doesn't.why?</p>
java android
[1, 4]
3,556,875
3,556,876
Script not working when called from .cs file
<p>I am tryong to do the following in a Row_Command event of a gridview. But the the pop up box never comes up, I have tried it in so many different ways.. but yet no luck. Please if someone can see the issue i would really appreciate a pointer.</p> <pre><code>protected void Gridview_RowCommand(object sender, GridViewCommandEventArgs e) { if(e.CommandName == "Merchant") { if (ItemsAvailable) { StringBuilder sb = new StringBuilder(); MyClass class = new MyClass(); TList&lt;LineItems&gt; otherItems = MyClass.GetItems(id); bool IsNotAvailable = false; foreach (LineItems item in otherItems) { Merchandise skuMerchandise = skuMerchandise.GetMerchandise(otherItems.mid); if (skuMerchandise != null) { if (skuMerchandise.AvailableItems &lt;= 0) { sb.Append(OtherItems.Name); sb.Append(Environment.NewLine); IsNotAvailable = true; } } } if (IsNotAvailable) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key", "function Redirect() {location.href = 'homePage.aspx';} if(confirm('The items : "+sb.ToString()+" will arrive in 1 month. Do you wish to continue?') == true){Redirect();};", true); } } } </code></pre> <p>Everytime i click the button, it just passes like nothing.. never prompts eveb though IsNotAvailable is true when I add a breakpoint.</p>
c# asp.net
[0, 9]
4,579,261
4,579,262
How to set textview position constant in runtime?
<p>I am trying to display some textviews visible in runtime. Here's my code:</p> <pre><code>for (int i=0; i&lt;arrBool.length; i++) { arrBool[i] = r.nextBoolean(); if(arrBool[i]==true) { textView[i].setVisibility(View.VISIBLE); } } </code></pre> <p>When I run the application, textviews should randomly be visible. It is working, but my problem is I have set the layout of those textviews. When I run Android Application, the visible textviews go to top left corner and loses the layout position.</p> <p>How to deal with this?</p>
java android
[1, 4]
744,778
744,779
calender repeat at various frequencies
<p>I have an ASP.Net calendar feature which allows users to add events and configure whether or not they repeat at various frequencies (i.e, daily, weekly, monthly, Sat/Sun, etc.). What I'm looking for is some C# code that will calculate a date of "Every Other Week" based on a starting date and ending date.</p> <p>Example: If a user enters an event dated July 7, 2012 and would like it to repeat every other week until July 31, 2012, the code will return the following dates:</p> <p>July 7, 2012 July 14, 2012 July 21, 2012 July 28, 2012</p> <p>and one more functionality is there to selection of days in week(i.e, mon,tue,wed..).</p> <p>Any help would be greatly appreciated.</p>
c# asp.net
[0, 9]
5,448,846
5,448,847
popup windows and AnimationSet vs AnimationStyle
<p>After successfully experimenting with getting Layouts to animate by creating AnimationSet's programmatically, I wanted to try the same thing with popup windows. Unfortunately it appears that popup windows can only have their animations controlled by setting AnimationStyles (which I know can be defined in xml), but is there any way of programmatically arranging animations for popup windows? Is there some sort of AnimationSet to AnimationStyle conversion?</p> <p>An explanation of the difference between an AnimationSet and an AnimationStyle would be a bonus.</p>
java android
[1, 4]
1,446,566
1,446,567
jQuery : how to apply effect on a child element
<p>instead of re-writing the same function, I want to optimise my code :</p> <pre><code>&lt;div class="header"&gt; &lt;h3&gt;How to use the widget&lt;/h3&gt; &lt;span id="idwidget" &gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="content" id="widget"&gt; </code></pre> <p>the JS :</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { var showText="Show"; var hideText="Hide"; $("#idwidget").before( "&lt;a href='#' class='button' id='toggle_link'&gt;"+showText+"&lt;/a&gt;" ); $('#widget').hide(); $('a#toggle_link').click(function() { if ($('a#toggle_link').text()==showText) { $('a#toggle_link').text(hideText); } else { $('a#toggle_link').text(showText); } $('#widget').toggle('slow'); return false; }); }); &lt;/script&gt; </code></pre> <p>This is working just with the div which is called widget and the button called idwidget.</p> <p>But on this page i have also :</p> <pre><code>&lt;div class="header"&gt; &lt;h3&gt;How to eat APPLES&lt;/h3&gt; &lt;span id="IDsomethingelse" &gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="content" id="somethingelse"&gt; </code></pre> <p>And I want it to be compatible with the code.</p> <p>I heard about children attribute, do you have an idea how to do that please ?</p> <p>Thank you</p>
javascript jquery
[3, 5]
4,131,430
4,131,431
get android seekbar value and display it on screen
<p>I'm trying to get the value of the seek bar whenever it changes and display it underneath. I'm using the <code>onclick</code> method on my seekbar to call this method. </p> <pre><code>public void getNumber(View view) { SeekBar seek = (SeekBar) findViewById(R.id.seekBar1); int seekValue = seek.getProgress(); String x = "Value: " + Integer.toString(seekValue); ((TextView) findViewById(R.id.level)).setText(x); } </code></pre>
java android
[1, 4]
2,084,815
2,084,816
Android -- Simple path, use of arcTo causes "UnsupportedOperationException?"
<p>I'm trying to create a simple path in the onDraw method of a SurfaceView object I've created and the layout editor keeps giving me "UnsupportedOperationException: null" whenever I add an arcTo command to the path.</p> <p>How do I fix this?</p> <p>Thanks,</p> <p>Ryan</p> <pre><code>public class myView extends SurfaceView { private Path myPath; public myView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); //set bounds final int top = 0 +this.getPaddingTop(); final int bottom = this.getMeasuredHeight() - this.getPaddingBottom(); final int left = 0 + this.getPaddingLeft(); final int right = this.getMeasuredWidth() - this.getPaddingRight(); int someHeight; int someWidth; innerLeft = new RectF(left + someWidth, bottom - otherHeight, left + someHeight + 10 * 2, bottom); myPath.moveTo(left, bottom); myPath.lineTo(left, top + 10); myPath.arcTo(innerLeft, 180, 90); myPath.close(); } } </code></pre>
java android
[1, 4]
2,843,238
2,843,239
dynamic controls using client side processing
<p>I created a variable number of thumbs (images) and put them on a panel in a aspx code behind.</p> <p>On the client I have onClick, mouseover, mouseout functions that I do hit. </p> <p>I can get a reference to the individual control but I can't seem to turn the borders off and on. </p> <p>I put a class in the code behind <code>Public Overrides Property BorderWidth</code> that will work on the server - I can put borders on all the images. </p> <p>What I want is to only have the border on mouseover. </p> <p>I guess the Overrides only works on the server - tell me I wrong. In lieu of that I am trying to put a bordered div around the thumb but here again I cant seem to get the position of the object (object.style.left) with JS like I can with other 'client side controls'. </p> <p>Also I saw some where that you can reference JS objects with ObjectID_data the name JS gives the object?? I don't know and cant seem to find any info. </p> <p>I am new to both asp and JS. Any illumination on any topic will be appreciated. </p>
javascript asp.net
[3, 9]
5,922,756
5,922,757
How do you make a copy of an object?
<p>I created a class called Colors. I am setting certain properties on the Colors object and setting it in a Session variable. When I access the Session variable on another page, I am noticing that if I change properties on objColors below, it changes the Session and does not keep the original properties which is what I want it to do. Here is an example:</p> <pre><code>Session["Colors"] = Colors; Colors objColors = Session["Colors"]; //If I change objColors, it changes the Session. I don't want this to happen. </code></pre> <p>Is there a better way to keep retain the original properties? Why does it do this?</p>
c# asp.net
[0, 9]
4,040,392
4,040,393
LiveValidation .remove() not working
<p>When I click on the Company account I want to remove validation for Normal account. J use LiveValidations + Ruby on Rails. When J use .destroy() it work but when clic on Normal account validation is off.</p> <pre><code>$(document).ready(function() { var user_email = new LiveValidation('user_email', { validMessage: "Ok", wait: 500 }); if (document.getElementById("user_account_type_company").checked) { $("#company").css("display", "block"); $("#normal").css("display", "none"); user_email.remove(Validate.Presence); user_email.remove(Validate.Email); } else if (document.getElementById("user_account_type_normal").checked) { $("#company").css("display", "none"); $("#normal").css("display", "block"); user_email.add(Validate.Presence); user_email.add(Validate.Email); } $("#user_account_type_company").click(function() { user_email.remove(Validate.Presence); user_email.remove(Validate.Email); $("#company").css("display", "block"); return $("#normal").css("display", "none"); }); $("#user_account_type_normal").click(function() { user_email.add(Validate.Presence); user_email.add(Validate.Email); $("#company").css("display", "none"); return $("#normal").css("display", "block"); }); });​ </code></pre>
javascript jquery
[3, 5]
4,769,842
4,769,843
Collect class names under a <div> tag in java script array
<pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { }); &lt;/script&gt; &lt;div id="input"&gt; &lt;div class="feature draggable"&gt;Drag 1&lt;/div&gt; &lt;div class="feature resizable"&gt;Resize&lt;/div&gt; &lt;div class="feature downloadable"&gt;Download&lt;/div&gt; &lt;div class="feature draggable"&gt;Drag 2&lt;/div&gt; &lt;div class="feature trackable"&gt;Track&lt;/div&gt; &lt;div class="feature colorable"&gt;Color&lt;/div&gt; &lt;/div&gt;​ </code></pre> <p>I want to store all the class elements under the <code>&lt;div id="input"&gt;</code> in array. What is the correct way to do it?</p> <p>JS Fiddle: <a href="http://jsfiddle.net/gMjxu/" rel="nofollow">http://jsfiddle.net/gMjxu/</a></p>
javascript jquery
[3, 5]
4,200,496
4,200,497
Broadcast event when IP changes?
<p>I'm developing an application that is sending data through tcp/ip</p> <p>I've made my own Name server that the clients register their IP and listening port. All of this is working very well.</p> <p>Right now the clients send a ping to the server to get the latest IP and updates it if necessary. Since the app is already using quite allot of network I would prefer to minimize it as much as possible.</p> <p>My question is if the ConnectivityManager (or any other service) sends a broadcast when the IP changes? Or is this not possible for the phone to detect this locally?</p>
java android
[1, 4]
2,653,459
2,653,460
disable Parent window on window.open and re enable on close of popup window
<p>I have a parent window where i open up a Popup window on click of a button: </p> <pre><code>function Test() { $("body").append('&lt;div id="modalPopUp" class="modalOverlay"&gt;'); var popupWindow = window.open("test.aspx", 'popUpWindow', 'height=300,width=600,left=100,top=30,resizable=No,scrollbars=No,toolbar=no,menubar=no,location=no,directories=no, status=No'); } </code></pre> <p>Right now i am able to open up popup and disable parent window, but now i want to catch close button click + click outside of popup events on Popup window, so i can remove ModalPopUp from my body so i can re eanble parent div. How do i achieve that? </p>
javascript jquery asp.net
[3, 5, 9]
2,364,633
2,364,634
Strange symbols in http response
<p>I came across a strange problem whilst using the jQuery AJAX functionality. Strange symbols are appearing at the beginning of the response from the server:</p> <p><img src="http://i.stack.imgur.com/RfEX9.png" alt="enter image description here"></p> <p>Here is the JavaScript I use:</p> <pre><code>$.post('/ajax/', {email : $('#email').val(), language : $('#lng').val()}, function(data) { alert(data); }); </code></pre> <p>I Googled a lot but couldn't find any similar issues. What could be the problem ?</p>
php javascript jquery
[2, 3, 5]
2,360,527
2,360,528
Passing JavaScript parameters through ASP.NET ListView
<p>I'm trying to pass parameters to a JavaScript function from a link button in a ListView the function only alerts the the passed parameters so I used Eval("Value") as my parameter but it seems that I'm making a mistake.</p> <p>My code for passing the parameter is</p> <pre><code>&lt;asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="hello(&lt;%#string.Concat(Eval("Longitude"),",",Eval("Latitude")) %&gt;);"&gt;LinkButton&lt;/asp:LinkButton&gt; </code></pre> <p>and the alert function is very simple</p> <pre><code> function hello(x){ alert(x); } </code></pre> <p>and the server tag is still not well formed. Any ideas?</p>
javascript asp.net
[3, 9]
1,018,604
1,018,605
Find pixel value for line height when it's "normal" in Chrome
<p>I have a textarea whose line-height is set to "normal". However, I can still get the actual pixel value in FireFox:</p> <pre><code>// firefox &gt;&gt;&gt; $("#post_body").css('line-height') "19.1167px" </code></pre> <p>Whereas I cannot in Chrome:</p> <pre><code>// chrome &gt;&gt;&gt; $("#post_body").css('line-height') "normal" </code></pre> <p>How can I get the actual pixel line height in Chrome?</p>
javascript jquery
[3, 5]
2,047,712
2,047,713
Can't find the function body in ASP.NET
<p>I recently started working on a project that has been in development for some time now. The problem is this - in the web site page, a have a frame (amongst 4 others) in a frameset which contains the SVG map object (the whole site is GIS based). Also, in the same frame, there is a icon for opening the form in which user can choose a number of filters, and after he presses a button, the map refreshes and the area of influence around some key points on the map are drawn. </p> <p>What i need to do is to open that form in a new (popup) window and not in the same frame where the map is. I did that this way:</p> <pre><code>onclick="window.open('zi.aspx','form1','width=700,height=500,left=350,top=100')" </code></pre> <p>This works fine. But then, when i enter the filters and hit Generate button, i get this error:</p> <pre><code>'parent.frames.map' is null or not an object </code></pre> <p>with the reference to zi.aspx. Now i know that this error is because i changed the form from opening in the same frame as map to opening it in a popup window, but i just can't find anywhere in the code where can i modify it. Before my changes, the code was just this:</p> <pre><code> onclick="showZi();" </code></pre> <p>and that is the function i can't find anywhere. Any ideas? How can i make this work, to make a map with filters drawn after the user has chosen appropriate ones from the popup window form? I should mention that this image link is in the ASP.NET table, with standard runat="server" command. </p>
c# javascript asp.net
[0, 3, 9]
5,499,575
5,499,576
Image not showing up on ASP.NET
<p>I have an image in a folder, when I try to set the <code>ImageUrl</code> from the behind code I get a little symbol that looks broken in half instead of the picture. If I set the <code>ImageUrl</code> in the Image properties it works. What am I doing wrong?</p> <pre><code>var imagepath = Server.MapPath(@"~/images/candidates/small/image.jpg"); System.Drawing.Image image = System.Drawing.Image.FromFile(imagepath); int ActualWidth = image.Width; int ActualHeight = image.Height; candImage.ImageUrl = imagepath; candImage.Height = ActualHeight; </code></pre>
c# asp.net
[0, 9]
871,607
871,608
Android onKey w/ virtual keyboard
<p>I am catching keyboard events/presses using the onKey method:</p> <pre><code>public boolean onKey(View arg0, int arg1, KeyEvent arg2) { //do something return false; } </code></pre> <p>This fires off just fine for physical keyboard presses but it does not fire on virtual keyboard presses. Is there an event handler to handle virtual keyboard presses?</p>
java android
[1, 4]
5,993,664
5,993,665
Are there any tools to convert Java to C#?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/443010/where-can-i-find-a-java-to-c-converter">Where can I find a Java to C# converter?</a> </p> </blockquote> <p>Are there any free converters or tools that can convert java projects to C#? I have java code and I want to convert it to C#.</p>
c# java
[0, 1]
5,873,341
5,873,342
maintain scrollback on ajax modal pop up extender
<p>I have the following site structure. This is a .net 3.5.</p> <p>Master Page -> Content Page -> Modal Pop up extender -> User control -> Panel -> Update Panel -> div</p> <p>The div is where all the form elements are. Now, when I click a checkbox or any button that results a postback, the usercontrol starts from the top. It does not maintain the scrollback. I ran across a post about implementing the script below but this doesn't help me any. Is there a fix for this?</p> <p>Below is the script I used.</p> <pre><code>&lt;script type="text/javascript"&gt; var xPos, yPos; var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_beginRequest(BeginRequestHandler); prm.add_endRequest(EndRequestHandler); function BeginRequestHandler(sender, args) { xPos = $get('div').scrollLeft; yPos = $get('div').scrollTop; } function EndRequestHandler(sender, args) { $get('div').scrollLeft = xPos; $get('div').scrollTop = yPos; } </code></pre> <p></p>
c# asp.net
[0, 9]
3,515,670
3,515,671
Why is this class being involved in serialization
<p>I am getting the following serialization error and I am trying to read my object that I saved to a file</p> <pre><code>java.io.InvalidClassException: com.testGame.scoreCard; Incompatible class (SUID): com.testGame.scoreCard: static final long serialVersionUID =-5895378336422852901L; but expected com.testGame.scoreCard: static final long serialVersionUID =0L; at java.io.ObjectInputStream.verifyAndInit(ObjectInputStream.java:2376) at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1658) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:683) at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:1799) at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:787) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:1999) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:1956) </code></pre> <p>But what I don't get is why scoreCard is serialized in the first place? The class(object) that I am writing and reading is serialized and does not call or make use of scoreCard class. Why would it complain about that class? Is there a way to see why this scoreCard is involved? ( I am using eclipse btw)</p> <p>Thank you </p>
java android
[1, 4]
531,144
531,145
Change hash without triggering a hashchange event
<p>I'm using the hash to load content dynamically. To make the back button work I am capturing hash changes. However sometimes I need to change the hash without triggering the hash changed function (eg, when the page was redirected server side and I need to update the hash once the content has returned.)</p> <p>The best solution I have come up with is to unbind the hashchange event, make the change and then rebind it. However, as this happens asynchronously, I am finding that it rebinds too quickly and still catches the hash change.</p> <p>My solution at the moment is very poor: Rebinding in a setTimeout. Does anyone have a better idea?</p> <pre><code> $(window).unbind( 'hashchange', hashChanged); window.location.hash = "!" + url; setTimeout(function(){ $(window).bind( 'hashchange', hashChanged); }, 100); </code></pre> <p><br></p> <p>Edit:<br> Amir Raminfar's suggestion prompted me to a solution that does not require a timeout. I added a class variable</p> <pre><code>_ignoreHashChange = false; </code></pre> <p>When I want to change the hash silently I do this:</p> <pre><code>_ignoreHashChange = true; window.location.hash = "!" + url; </code></pre> <p>and the hash changed event does this :</p> <pre><code>function hashChanged(event){ if(_ignoreHashChange === false){ url = window.location.hash.slice(2); fetchContent(url); } _ignoreHashChange = false; } </code></pre>
javascript jquery
[3, 5]
3,851,772
3,851,773
Identify which control my application is using
<p>I got a method into my masterpage wich populates a value to every label I pass:</p> <pre><code>function FillLabel(field, text) { $(field).html(text); } </code></pre> <p>I'll need to make it adaptable to the situation that my <code>field</code> recieve an html input and to put the text inside this input I need to use <code>$(field).html(text);</code></p> <p>I need to build an if to identify the type of the <code>field</code>and I have no idea how to do that. Could you guys help me ?</p>
javascript jquery
[3, 5]
3,690,669
3,690,670
Javascript Jquery doesn't work. $(this)
<pre><code>$(document).ready(function() { $(".delete_user_button").click(function(){ var username_to_delete = $(this).attr('rel'); $.ajax({ type:"POST", url:"/delete/", data:{'username_to_delete':username_to_delete}, beforeSend:function() { $(this).val("Removing..."); }, success:function(html){ $("div.delete_div[rel=" + username_to_delete + "]").remove(); } }); return false; }); }); </code></pre> <p>Why doesn't $(this).val() work? I'm trying to change the text of the button when the user clicks remove.</p>
javascript jquery
[3, 5]
1,195,499
1,195,500
Android get a bitmap of a view before drawing?
<p>I am looking to take a view hierarchy and turn it into a Bitmap. Using the <a href="http://developer.android.com/reference/android/view/View.html#getDrawingCache%28boolean%29" rel="nofollow">view.getDrawingCache()</a> does exactly what I want it to do but will not work if I try that before the view is drawn. Is there another function that will do the same thing but before it is actually drawn? I would like to create the view and turn it into a bitmap to display and discard the actual view. If there is a way to force the view to be drawn that might work as well. Any ideas?</p> <p>I found this in a previous post:</p> <pre><code> public static Bitmap loadBitmapFromView(View v) { Bitmap b = Bitmap.createBitmap( v.getLayoutParams().width, v.getLayoutParams().height, Bitmap.Config.ARGB_8888); Canvas c = new Canvas(b); v.layout(0, 0, v.getLayoutParams().width, v.getLayoutParams().height); v.draw(c); return b; } </code></pre> <p>This looks promising but when I use it all I get is a semi transparent black box.</p>
java android
[1, 4]
3,687,447
3,687,448
Remove columns from DataTable in C#
<p>I have a DataSet which I get a DataTable from that I am being passed back from a function call. It has 15-20 columns, however I only want 10 columns of the data.</p> <p>Is there a way to remove those columns that I don't want, copy the DataTable to another that has only the columns defined that I want or is it just better to iterate the collection and just use the columns I need.</p> <p>I need to write the values out to a fixed length data file.</p>
c# asp.net
[0, 9]
3,959,136
3,959,137
selectbox value calculation
<p>I want to do a calculation between selectbox values. The problem with my code is that the first part of the calculation only gives me <code>0</code>, which Motherboard value*quantity. the second part works fine which Chassis*quantity. My formulas is <code>motherbord*Quanity+chassis*quantity</code>. </p> <p>Here is my code: </p> <pre><code>function calculate() { var parsedMotherboard = parseFloat(document.calcform.Motherboard.value || 0); var parsedQuantity = parseFloat(document.calcform.Quantity.value || 0); var parsedChassis = parseFloat(document.calcform.Chassis.value || 0); var parsedQuantity1 = parseFloat(document.calcform.Quantity1.value || 0); document.calcform.total.value = (parsedMotherboard * parsedQuantity + parsedChassis * parsedQuantity1); } </code></pre> <p><img src="http://i.stack.imgur.com/LnHKt.jpg" alt="interface"></p>
php javascript
[2, 3]
1,643,042
1,643,043
Downloading and storing files with checksum information in Java
<p>We are building a service to front fetching remote static files to our android app. The service will give a readout of the current md5 checksum of a file. The concept is that we retain the static file on the device until the checksum changes. When the file changes, the service will return a different checksum and this is the trigger for the device to download the file again.</p> <p>I was thinking of just laying the downloaded files down in the file system with a .md5 file next to each one. When the code starts up, I'd go over all the files and make a map of file_name (known to be unique) to checksum. Then on requests for a file I'd check the remote service (whose response would only be checked every few minutes) and compare the result against that in the map.</p> <p>The more I thought about this, the more I thought someone must have already done it. So before I put time into this I was wondering if there was a project out there doing this. I did some searching but could not find any.</p>
java android
[1, 4]
2,835,955
2,835,956
Is there a way to __doPostBack to another page using javascript?
<p>I'm writing a suite of admin tools to sit on top of our existing site that will allow a user to quickly administer a number of pages from one convenient jquery ui window.</p> <p>The issue I'm running into is that a lot of the functionality requires <strong>postbacks on specific pages</strong>, while this admin overlay can be accessed from any page. This means that in order for the functionality to work, the postback has to be sent to the correct page (or the page has to be loaded before the postback is triggered).</p> <p>I've looked at <a href="http://stackoverflow.com/questions/863550/causing-a-postback-to-a-different-page-from-a-popup">Causing a PostBack to a different page from a PopUp</a> and several c# posts, but they do not appear to address the specific issue of moving to another page prior to firing the postback using javascript. </p> <p><strong>Possible Solution:</strong> one solution I considered is using cookies transmit information about which postback events need to fire and what parameters to use while using javascript to load the correct page. It's not a great solution, so I was wondering if anyone here could think of a better one.</p>
javascript jquery
[3, 5]
3,938,365
3,938,366
noob- How to write simple text exander application?
<p>I am looking for an open source text expander/autocorrect/auto typing application but haven't quite found what I need. The language must be in C++/C#. The application must work system wide for text input.</p> <p>Can you please give me some guide on how to start with this application?</p>
c# c++
[0, 6]
1,396,762
1,396,763
problem with Check box selection when multiple gridview exists on the form
<p>I am working on check box selection in a grid view. I have gone though the following link <a href="http://www.highoncoding.com/Articles/228_GridView_CheckBox_Selection_With_a_Twist.aspx" rel="nofollow">Grid view checkboxes</a></p> <p>This works fine when i am having one grid view on my form , but if i have multiple grid views then i am facing a problem in selection. So can any one help me or give me any other alternative solution which works exactly as the link i posted..</p> <p>My problem is when i am having multiple grid view and selecting one header grid view the items in other grid view are selected so can any one give me the best method to achieve.</p> <p>I am using master pages too in my application </p>
c# asp.net
[0, 9]
2,277,853
2,277,854
How to reduce the size of JQuery datepicker
<p>I managed to run the JQuery datepicker into JSF page.</p> <p><img src="http://i.stack.imgur.com/sK3dK.png" alt="enter image description here"></p> <p>But as you can see the buttons and the calendar are not symmetric - they are more big than usual. Can you tell me how I can reduce the size of the calendar?</p>
javascript jquery
[3, 5]
452,712
452,713
jQuery mobile, html5 phone links with javascript instead
<p>I'm using a split-button list in jQuery mobile, and I notice I can't have links inside of my buttons without some strange formatting happening.</p> <p>Because of this, a phone link I would normally write as:</p> <pre><code>&lt;a href="tel+1234567898"&gt;123-456-7898&lt;/a&gt; </code></pre> <p>I am trying to do with a bit of javascript:</p> <pre><code>$('.phone').bind('click', function() { var phone = $(this).attr('data-phone'); window.location = "tel:+" + phone; }); </code></pre> <p>HTML/PHP:</p> <pre><code>&lt;span data-email="&lt;?php echo $phone; ?&gt;" class="phone"&gt;&lt;?php echo $phone; ?&gt;&lt;/span&gt; </code></pre> <p>This is recognized "in the browser" (Chrome asks me if I want to open communicator) but doesn't appear to work in an iPhone...</p> <p><strong>Edit:</strong></p> <p>Split button lists work like this:</p> <pre><code>&lt;li&gt;&lt;a href="some-link"&gt;Content&lt;/a&gt;&lt;a href="another-link"&gt;&lt;/a&gt;&lt;/li&gt; </code></pre> <p>So if you put a link phone into the first part ("some-link") it's invalid HTML (maybe?) and so jQuery mobile takes out all the content inside of so I can't just seem to change the CSS to fix this.</p>
javascript jquery
[3, 5]
5,151,334
5,151,335
c# ItemDataBound new event handler
<pre><code> protected virtual void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e) { this.list = (DropDownList)e.Item.FindControl("edit_list"); if (list != null) { list.SelectedIndexChanged += new EventHandler(List_SelectedIndexChanged); } } </code></pre> <p>List is assigned, but selectedIndex eventHandler won't work if i make <code>RepairsStateList.BackColor = Color.Black;</code> it is working</p> <pre><code>protected void List_SelectedIndexChanged(object source, System.EventArgs e) { Response.Write("&lt;script&gt;alert('vv') &lt;/script&gt;"); } </code></pre>
c# asp.net
[0, 9]
3,047,044
3,047,045
the this in jquery plugin is giving back undefined
<p>Could someone explain why this.rel is giving back undefined and also what the regex is supposed to do. If this.rel is undefined the regex will not work either and is causing some kind of error because the alert underneath will not fire? </p> <pre><code>$.fn.facebox= function(settings) { init(settings) function clickHandler() { $.facebox.loading(true) alert($(this).attr('rel')); //alert(String(this.rel)); // support for rel="facebox.inline_popup" syntax, to add a class // also supports deprecated "facebox[.inline_popup]" syntax var klass = this.rel.match(/facebox\[?\.(\w+)\]?/) alert(klass); alert('ppp'); // if (klass) klass = klass[1] //fillfaceboxFromHref(this.href, klass) return false } return this.click(clickHandler) } </code></pre> <p>thanks, richard</p>
javascript jquery
[3, 5]
774,398
774,399
Load first div from another page using jquery or php
<p>I am not ever sure this is possible but I know you guys will know the answer. </p> <p>I wonder if it is possible to load the first div on a page into a different page. </p> <p>Example:</p> <p>This code is on "list.php"</p> <pre><code>&lt;div class="message_details"&gt; Some Content 1 &lt;/div&gt; &lt;div class="message_details"&gt; Some Content 2 &lt;/div&gt; </code></pre> <p>I found this article and it works but it brings in all div's but I want to load only the first div.</p> <p><a href="http://stackoverflow.com/questions/4560183/load-content-from-external-page-into-another-page-using-ajax-jquery">Load content from external page into another page using Ajax/jQuery</a></p> <p>Here is the code I have now that loads all divs</p> <pre><code>$(document).ready(function() { $(".loader").load('list.php .message_details'); }); </code></pre> <p>How can I load only the first div? Also is there any way to remove an img tag within the selected div?</p> <p>Thanks everyone</p>
php jquery
[2, 5]
5,761,747
5,761,748
Save Paths, Virtual directories, and static locations
<p>I had a file upload that was uploading to a folder in the web application root, i.e. I had</p> <pre><code>string savePath = @"~/documentation/" string filename = Path.GetFileName(FileUploadControl.FileName); FileUploadControl.SaveAs(Server.MapPath(savePath) + filename); </code></pre> <p>and that worked fine, uploading the file to WebApp/documentation/filename.abc</p> <p>The problem is, I want to change the documentation location so I don't have to move that folder when pushing from development to production. So I did the following</p> <p>In Web.Config:</p> <pre><code>&lt;appSettings&gt; &lt;add key="DocumentationLocation" value="C:\Documentation\" /&gt; &lt;/appSettings&gt; </code></pre> <p>In the code:</p> <pre><code>string savePath = ConfigurationSettings.AppSettings["DocumentationLocation"]; string filename = Path.GetFileName(FileUploadControl.FileName); FileUploadControl.SaveAs(Server.MapPath(savePath) + filename); </code></pre> <p>I figured this would work identically, saving the file to the folder specified in the web.config.</p> <p>However, I get an error when I try to upload a document now, that says:</p> <blockquote> <p>'C:\TM_Documentation\' is not a valid virtual path.</p> </blockquote> <p>any idea what i'm doing wrong so that i can fix it and save the files outside of the web app directory? Thanks. </p>
c# asp.net
[0, 9]
2,366,707
2,366,708
Selecting the correct input field using jquery
<p>I'm trying to select the id's of dynamic input fields in my code. When clicking a button, the form will create a form field like this:</p> <pre><code>&lt;td&gt;&lt;input type="text" id="field_a_1"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="field_b_1"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="field_c_1"&gt;&lt;/td&gt; </code></pre> <p>When I click on the button again I get this:</p> <pre><code>&lt;td&gt;&lt;input type="text" id="field_a_2"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="field_b_2"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="field_c_2"&gt;&lt;/td&gt; </code></pre> <p>What I want to do is select only the field id that I need to pull the value from that particular input and pass it to a variable like this:</p> <pre><code>var example = $(":input:eq(0)").val(); </code></pre> <p>I know that by adding the <code>:eq(0)</code> after the <code>:input</code> selector it will only grab the id for <code>field_a_1</code>, so how do I set it up so that I can pull just the field that I need to assign it to a variable?</p>
javascript jquery
[3, 5]
3,745,611
3,745,612
scheduling files for upload
<p>I want to schedule the files for upload. Files are residing in companies network(on intranet)</p> <p>I use "FileUpload" to browse the files on screen which are scheduled for upload. But the FileUpload does not give the full path of the file. So what is the way to workaround this limitation.</p> <p>Thanks, Harish</p>
c# asp.net
[0, 9]
1,394,482
1,394,483
why does jquery's .load() ignore <script>?
<p>I have a every common page a.html which looks like this:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="xyz.js" &gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; ... &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>In b.html, I use jquery's <code>.load()</code> function to a <code>div</code>. </p> <pre><code>$("#myDiv").load("a.html") </code></pre> <p>It works. The xyz.js's content is loaded along with a.html. But why isn't there a <code>&lt;script&gt;</code> tag? I open firebug to see the source. There is a's but no a's <code>&lt;script&gt;</code>.</p> <p>I want the <code>&lt;script&gt;</code> because I need it to find relative path. (<a href="http://stackoverflow.com/questions/6273654/javascript-how-can-i-know-where-is-the-js-self">this question</a>) </p> <p>Edit: I tried to use <code>.get()</code> and <code>.html()</code>. Didn't help.</p> <p>Edit2: The title is not very appropriate. The xyz.js runs. But no <code>&lt;script&gt;</code>.</p>
javascript jquery
[3, 5]
4,246,398
4,246,399
How to check if text in asp.net textbox is selected with jQuery?
<p>I was wondering if this is at all possible, I want to check whether a user has selected text inside a textbox control, just like <a href="http://stackoverflow.com/questions/5001608/how-to-know-if-the-text-in-a-textbox-is-selected">this solution</a> (but this is just for html input controls and not asp.net server controls) </p>
javascript jquery asp.net
[3, 5, 9]
4,578,350
4,578,351
At what point in the control life cycle does Control.Visible stop rendering?
<p>I am trying to write a simple utility webcontrol to display one-line messages inside a web page - status updates, error messages, etc. The messages will come from other controls on the page, by calling a method on the webcontrol. If the control doesn't have any messages by the time it gets to pre-render, I don't want it to render on the page at all - I want it to set Control.Visible = false. This only seems to work for non-postback rendering though. Here's the code I'm using:</p> <pre><code>public class MessageList : WebControl { #region inner classes private struct MessageItem { string Content, CssClass; public MessageItem(string content, string cssClass) { Content = content; CssClass = cssClass; } public override string ToString() { return "&lt;li" + (String.IsNullOrEmpty(CssClass) ? String.Empty : " class='" + CssClass + "'") + "&gt;" + Content + "&lt;/li&gt;"; } } private class MessageQueue : Queue&lt;MessageItem&gt; { } #endregion #region fields, constructors, and events MessageQueue queue; public MessageList() : base(HtmlTextWriterTag.Ul) { queue = new MessageQueue(); } protected override void OnLoad(EventArgs e) { this.Controls.Clear(); base.OnLoad(e); } protected override void OnPreRender(EventArgs e) { this.Visible = (queue.Count &gt; 0); if (this.Visible) { while (queue.Count &gt; 0) { MessageItem message = queue.Dequeue(); this.Controls.Add(new LiteralControl(message.ToString())); } } base.OnPreRender(e); } #endregion #region properties and methods public void AddMessage(string content, string cssClass) { queue.Enqueue(new MessageItem(content, cssClass)); } public void AddMessage(string content) { AddMessage(content, String.Empty); } #endregion } </code></pre> <p>I tried putting the check inside CreateChildControls too, with the same result.</p>
c# asp.net
[0, 9]
2,255,337
2,255,338
Displaying label control depending on condition
<p>I have three pages on my site. Page 1 is home page. When user visits the site, i display label control to user in Page 1. When the same user goes to page 2 , 3 and returns back to page 1, i do not want the label to show again. How can i do this?</p>
asp.net jquery
[9, 5]
3,370,594
3,370,595
Facebook like image Uploader
<p>I was wondering how could it be possible to show the user if the files he/she trying to upload is the right type and size before moving it to a folder where it will be saved. I mean like when you Upload a photo on a Facebook if the file is not image the the system rejects but if it is a image you can see it and have an option to add more photos and you can also remove the photos if you want, finally you Upload all the photos together. I have a PHP single image uploader and I would like to have the same features Facebook has. How is that possible? Thanks <a href="http://blueimp.github.com/jQuery-File-Upload//" rel="nofollow">This</a> script tend to have the same features but you have to upload each pictures not the whole.</p>
php javascript jquery
[2, 3, 5]
2,586,955
2,586,956
remove show effect
<p>I am trying to disable my show effect for certain dialogs. It seems, if I don't specify <code>show</code> in the initialization of a dialog, the dialog simply shows as intended. If I specify <code>show</code> with an effect it works properly as well. How can I return back to the initial <code>show</code> after initializing with a different animation. I've tried </p> <pre><code>$dialog.dialog("option",'show',{effect:'none'}); $dialog.dialog("option",'show',{}); $dialog.dialog("option",'show',false); </code></pre> <p>all of these give me a weird blind effect. </p>
javascript jquery
[3, 5]
4,241,364
4,241,365
convert array_chunk from php to java
<p>my php code is:</p> <pre><code>$splitArray = array_chunk($theArray,ceil(count($theArray) / 2),true); </code></pre>
java php
[1, 2]
2,970,952
2,970,953
jQuery is not a function error
<p>What is wrong with this statement?</p> <pre><code>message = $("#contact-form").find(".long-text"); if(message.val().length &lt; 15) { message.css("border","2px solid red"); alert("Your message must be more than 15 character long"); } </code></pre> <p>I get message.val is not a function error in <a href="http://en.wikipedia.org/wiki/Firebug_%28Firefox_extension%29" rel="nofollow">Firebug</a>? What could be the reason?</p> <p><strong>NEW</strong></p> <p>OK, now my form won't submit if I have more or less than 15 characters. Should I open a new question on this or should I continue on this one?</p> <p>I have this inside:</p> <pre><code>$("#contact-form").submit(function(){ message = $("#contact-form").find(".long-text"); if(message.val().length &lt; 15) { message.css("border","2px solid red"); alert("Your message must be more than 15 character long"); return false; } else { Post form with Ajax .. } }); </code></pre>
javascript jquery
[3, 5]
4,068,859
4,068,860
Different Popup, change focus after time
<p>I use a function to open 3 sites in a popup (fullscreen) from a "parent"-Site. Now I want to switch automatically between this 3 popups after time.</p> <p>The times (im ms) will be set in a div.</p> <p>Does anybody know a good and easy solution for this case? </p> <p>My div</p> <pre><code>&lt;div id="time"&gt;200&lt;/div&gt; </code></pre> <p>My script</p> <pre><code> &lt;script type="text/javascript"&gt; &lt;!-- function popLpCall() { urlGaLp = 'https://www.google.com/analytics/web/?hl=en&amp;pli=1#realtime/rt-overview/a29259688w55318706p63653310/' urlGaApp = 'https://www.google.com/analytics/web/?hl=en&amp;pli=1#realtime/rt-overview/a29259688w55318706p63647373/' urlDashboard = 'index.html' params = 'width=' + screen.width; params += ', height=' + screen.height; params += ', top=0, left=0' params += ', fullscreen=yes'; newwin = window.open(urlGaLp, 'Real Time Monitor Landingpage', params); if (window.focus) { newwin.focus() } newwin = window.open(urlGaApp, 'Real Time Monitor Application', params); if (window.focus) { newwin.focus() } newwin = window.open(urlDashboard, 'Dashboard', params); if (window.focus) { newwin.focus() } return false; } // --&gt; &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,958,696
4,958,697
Javascript to load image from server asynchronously
<p>I want to load images from my server to an image gallery. The problem is that after loading the web page my program loads all the images first and then displays them all at the same time. As a result, there is a significant wait for them to load.</p> <p>I would like to display the images one at a time as they load, showing an "busy" indicator on the images that haven't loaded yet. </p> <p>Here is my code:</p> <pre><code>controller.labelForIndex = function (index) { var arrayIndexNO=(index%(temp.length/2))*2; var appID=temp[arrayIndexNO]; var iconImage=appID+".png"; $(".ad-carousel-view .cells &gt; li").css("background-image", "url("+iconImage+")"); return temp[arrayIndexNO+1]; }; </code></pre> <p>This function is called 10 times to load 10 pngs and display them in a cell, but my code loads all images first and then displays them all at the same time.</p>
javascript jquery
[3, 5]
1,570,597
1,570,598
How can I place an Adsense ad (script tags) inside of javascript tags?
<p>How can I put an Adsense ad inside of javascript tags? </p> <pre><code>&lt;script type="text javascript"&gt; var ad = "&lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "ca-pub-12345"; google_ad_slot = "12345"; google_ad_width = 728; google_ad_height = 90; //--&gt; &lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;"; &lt;/script&gt; </code></pre> <p>The above obviously doesn't work. But, it demonstrates what I'm trying to do. Can any figure out how to effectively do this? Thanks.</p> <p><strong>UPDATE</strong> This still gives me a syntax error</p> <pre><code>var ad = "&lt;script type='text/javascript'&gt;&lt;!-- google_ad_client = 'ca-pub-12345'; /* plastic surgery body large banner */ google_ad_slot = '12345'; google_ad_width = 728; google_ad_height = 90; //--&gt; &lt;/script&gt; &lt;script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'&gt; &lt;/script&gt;"; </code></pre>
php javascript
[2, 3]
2,604,982
2,604,983
jQuery override css hide on mouse out
<p>I have a hidden div that I show when the mouse hovers.</p> <p>Then when I click the text changes and I want the div to be permanently shown. The problem is that it disappears again when the mouse moves off.</p> <p>Is there a way in jQuery to override the mouse out hide in the css?</p> <p>Thanks</p> <p>CSS</p> <pre><code>.saveCompare { display:none; margin-left: 10px; background-color:#BDD455; color:#ffffff; padding: 2px 8px; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } .listingContainer:hover .saveCompare { display: inline; } </code></pre> <p>jQuery</p> <pre><code> $("div.saveCompare").click(function() { $(this).text('Compare Added'); $(this).show(); return false; }); </code></pre>
javascript jquery
[3, 5]
3,190,358
3,190,359
Is it possible to upload data URIs with jQuery or PHP?
<p>I have this array at the moment which contains a lot of data URIs. I set this earlier in the code like this:</p> <pre><code>dataArray = []; dataArray.push({name : file.name, value : this.result}); </code></pre> <p>After doing a few things with the data URIs I want to upload them when the user finally presses the upload button, so I pass the data URIs to a PHP file like so: </p> <pre><code>$.each(dataArray, function(index, file) { $.post('upload.php', dataArray[index], function(data) { </code></pre> <p>And run a few functions inside to show a loading bar, etc. </p> <p>Now in the PHP file (upload.php) I have no idea what to do. Each data URI will be posted separately to the PHP file, but how do I treat a data URI in PHP? Usually I would do $_POST to get the data URI itself but I don't really know how to go about pushing this into a folder on the server. Can I treat the data URI as just a normal file and use $_FILES? So far I haven't had much success. </p>
php javascript jquery
[2, 3, 5]
1,180,551
1,180,552
How to load a huge graph into memory to repeatedly find shortest path between two given nodes?
<p>I am writing an application in which I need to load a huge graph into memory and answer "shortest path between x and y" for different pairs of x and y. The graph is static and can be loaded once for all into main memory. </p> <p>The query for shortest path between x and y is made by a UI written in PHP. How can I keep the graph loaded in memory and find the shortest path repeatedly in an efficient way ? Is writing a JAVA daemon going to help ?</p>
java php
[1, 2]
4,347,883
4,347,884
how can i fill the some columns in datagridview when page is changed? c#
<p>I have a gridview in page load I change the some images of buttons by using checkfunction However, when i change the index of page. page load don't be called in the program I tried the GridView1_PageIndexChanging, GridView1_SelectedIndexChanged,GridView1_PageIndexChanged events</p> <p>In codes in page load, I copied it in the events but it does not work</p> <pre><code> DBConnection db = new DBConnection(); for (int i = 0; i &lt; GridView1.Rows.Count; i++) { GridViewRow gvrow = GridView1.Rows[i]; ImageButton ib = (ImageButton)gvrow.Controls[1].Controls[0]; string feedUrl = ((HiddenField)GridView1.Rows[i].FindControl("HiddenField1")).Value; bool res = db.CheckAddedFeeds(feedUrl, User_Name); if (res) { ib.ImageUrl = "~/images/delete.png"; } } </code></pre>
c# asp.net
[0, 9]
5,856,212
5,856,213
Identifying explicit intent purpose in Android, or building seperate activities?
<p>This may be in the RTFM category but I can’t seem to figure out the proper way to do this. One of my activities shows some random data from a database, it uses some user-defined search-criteria from a previous activity to filter out which data blocks to search from. But it’s main purpose is to display the data, and present the user with a UI to manipulate the data to his will. </p> <p>The user can also bookmark this random data, and then access it later again (the bookmarks show up in a listview in another activity). Rather than creating a whole new activity with basically the same purpose, I want to reuse the one already created, and just tell it that I want to view some data, rather than search for some new. So what is the proper way of informing an activity of want you want to do? Should that be defined in the Intent extras bundle or is there another way?</p> <p>Or would the proper way be to create a new activity for this?</p>
java android
[1, 4]
3,868,855
3,868,856
How to HTML encode a csv export
<p>I get</p> <pre><code> Quattrode® </code></pre> <p>From a string that is HTML encoded as </p> <pre><code>Quattrode® </code></pre> <p>when viewing inside Excel 2007. </p> <p><strong>Routine</strong></p> <pre><code> Response.Clear(); Response.Buffer = true; Response.ContentType = "text/comma-separated-values"; Response.AddHeader("Content-Disposition", "attachment;filename=\"Expired.csv\""); Response.RedirectLocation = "export.csv"; Response.Charset = ""; //Response.Charset = "UTF-8";//this does not work either. EnableViewState = false; ExportUtility util = new ExportUtility(); Response.Write(util.DataGridToCSV(gridViewExport, ",")); </code></pre> <p>Basically <code>DataGridToCSV()</code> uses <code>HttpUtility.HtmlDecode(stringBuilder.ToString());</code> and I can use visual studio's text visualizer and see the string looks correct (Quattrode®). </p> <p>So something in the <code>Response</code> procedure or in Excel's interpretation of the file is not correct. Any idea how to fix?</p> <p><hr /> <strong>UPDATE</strong><br /> Turns out that this is not interpreted properly in Excel or WordPad. I open it up in Notepad and the symbol shows up properly.</p>
c# asp.net
[0, 9]
1,173,341
1,173,342
jquery and php, how to go to a specific tab after posting a form?
<p>i have a simple jquery tab and a form. When i post the form the page refreshes and it goes to the default tab. you can see the code in <a href="http://jsfiddle.net/patrioticcow/HysJ6/13/" rel="nofollow">jsfiddle</a> also here:</p> <pre><code>&lt;ul class="tabs"&gt; &lt;li&gt;&lt;a href="#tab1"&gt;Home&lt;/a&gt; | &lt;/li&gt; &lt;li&gt; | &lt;a href="#tab2"&gt;Top 10&lt;/a&gt; | &lt;/li&gt; &lt;/ul&gt; &lt;div id="tab1" class="tab_content"&gt;234&lt;/div&gt; &lt;div id="tab2" class="tab_content"&gt; &lt;form method="post"&gt; &lt;select name="item"&gt; &lt;option&gt;Paint&lt;/option&gt;&lt;option&gt;Brushes&lt;/option&gt; &lt;/select&gt; Quantity: &lt;input name="quantity" type="text" /&gt; &lt;input type="submit" /&gt; &lt;/form&gt; &lt;/div&gt; //When page loads... $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $('ul.tabs li#none').removeClass('visible'); $('ul.tabs li#none').addClass('none'); $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); $(activeTab).fadeIn(); //Fade in the active ID content return false; }); </code></pre> <p>so again, what i want to accomplish is when i submit a form to redirect back to the tab of my choice.</p> <p>any ideas?</p> <p>thanks</p>
php jquery
[2, 5]