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,142 | 3,489,143 | Parse JSON object one item at a time | <p>I am playing around for the first time with android development. I am trying to make a simple currency converter app. The particular piece I am working on is populating a spinner box with all of the available currencies without having to code it all in manually. I have a json file that looks like:<br>
<code>{<br>
"AED": "United Arab Emirates Dirham",<br>
"AFN": "Afghan Afghani",<br>
"ALL": "Albanian Lek",<br>
"AMD": "Armenian Dram",<br>
"ANG": "Netherlands Antillean Guilder",<br>
"AOA": "Angolan Kwanza",<br>
"ARS": "Argentine Peso",<br>
"AUD": "Australian Dollar",<br>
"AWG": "Aruban Florin",<br>
...<br>
}</code> </p>
<p>I want to read that object one currency at a time so I can use it to populate the spinner. Something along the lines of:</p>
<pre><code>/*PSEUDOCODE*/
spinner = (Spinner) findViewById(R.id.currencyTo);
List<String> list = new ArrayList<String>();
JSONParser jParser = new JSONParser();
JSONObject json = jParser.getJSONFromUrl(url);
while (rates != null) {
rates = json.getString(first item in json);
list.add(rates);
...
</code></pre>
<p>I know how to do it by calling each item individually, such as rates = json.getString("AED") and so on, but I don't want it so hardcoded like that. I want to parse each currency item individually, then place it in the spinner. Grab the next currency, place it in the spinner, and so on and so forth. Any help is greatly appreciated. </p>
| java android | [1, 4] |
5,035,270 | 5,035,271 | Getting HTML textbox input | <p>I need some help with ASP.NET.</p>
<p>I have an html page that has a form tag with a couple of input tags and I want to do a Post.</p>
<p>Now on the server, I'm implementing IHTTPHandler. I get the response, but i don't see my input data.</p>
<p>How can i get what the user types in into the input tags in the http handler. I was able to do this before. But now i can't find where in the context object the results are.</p>
| c# asp.net | [0, 9] |
3,443,435 | 3,443,436 | Arrange dates in a sequential order | <p>I am storing the dates that are entered by the user using a <code>DatePicker</code> in a file & reading the contents from the file and showing it into my history page. Please find the image attached </p>
<p>I need to arrange those dates in a proper sequence depending on the entry on the left hand side. Please help me for the same.
Thanks.</p>
<p><img src="http://i.stack.imgur.com/5SzZM.png" alt="enter image description here"></p>
| java android | [1, 4] |
1,124,538 | 1,124,539 | search and replace text in all java files in a package | <p>I am using a few functions in my application which i want to replace with other functions (to make it backward compatible)
My question : is it possible to find & replace some specific text in all java files in a package with some tool, or do i have to do it manually on every java file? I have a LOT of java files in the package.</p>
<p>For eg : i want to replace </p>
<pre><code>getExternalCacheDir()
</code></pre>
<p>with something like </p>
<pre><code>Environment.getExternalStorageDirectory + "/Android/data/<package_name>/cache/"
</code></pre>
<p>the IDE i'm using is Eclipse Helios. Any solutions?</p>
| java android | [1, 4] |
3,076,453 | 3,076,454 | HtmlDivElement has no method 'indexOf' | <p>I am attempting to derive some identifying property from this element:</p>
<pre><code><div class="rtsLevel rtsLevel1">
<ul class="rtsUL">
<li class="rtsLI rtsFirst rtsLast">
<a class="rtsLink rtsSelected" href="#">
<span class="rtsOut">
<span class="rtsIn">
<span class="rtsTxt">Dashboard</span>
</span>
</span>
</a>
</li>
</ul>
</div>
</code></pre>
<p>using this javascript:</p>
<pre><code>function OnClientDragging(sender, eventArgs) {
var target = eventArgs.get_htmlElement();
console.log(target);
var currentZone = TryGetZoneFromTarget(target);
}
function TryGetZoneFromTarget(target) {
//If the mouse moves too quickly target.id returns a red herring.
if (/\S/.test(target.id) == false) {
if (target.indexOf("rtsLevel") != -1) {
return null; //The tabstrip has an invisible div which doesn't have an ID, but isn't a redherring.
}
return undefined;
}
</code></pre>
<p>The div doesn't have an id specified, but I don't seem to be able to 'talk' to it at all, either. I've tried '.hasClass("rtsLevel")' and was being told hasClass not defined, so I tried to do a string comparison, but hit the same wall.</p>
<p>What am I doing incorrectly?</p>
<p>EDIT: Solution was <code>if ( $(target).hasClass('rtsLevel') ) {</code></p>
| javascript jquery | [3, 5] |
173,743 | 173,744 | Jquery - need help on usage | <p>Is this the right way of using the php script in the jquery function?
The pathToTabImage variable</p>
<pre><code><script type="text/javascript">
$(function(){
$('.slide-out-div').tabSlideOut({
tabHandle: '.handle', //class of the element that will become your tab
pathToTabImage: '<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/images/ack.jpg';, //path to the image for the tab //Optionally can be set using css
alert(pathToTabImage);
imageHeight: '122px', //height of tab image //Optionally can be set using css
imageWidth: '125px', //width of tab image //Optionally can be set using css
tabLocation: 'right', //side of screen where tab lives, top, right, bottom, or left
speed: 600, //speed of animation
action: 'click', //options: 'click' or 'hover', action to trigger animation
topPos: '600px', //position from the top/ use if tabLocation is left or right
leftPos: '550px', //position from left/ use if tabLocation is bottom or top
fixedPosition: false //options: true makes it stick(fixed position) on scroll
});
});
</code></pre>
| php jquery | [2, 5] |
756,599 | 756,600 | Not able to download image using HttpURLConnection | <p>I am trying download file <a href="http://images.anandtech.com/doci/5434/X79%20Extreme9Box_575px.jpg" rel="nofollow">http://images.anandtech.com/doci/5434/X79%20Extreme9Box_575px.jpg</a></p>
<p>but not able to download it using HttpUrlConnection, ImageIO.read and even in php using file_get_contents.</p>
<p>I am not able to figure it out why this is happening but if I check this link in browser then header response is 200 both in firefox as well as opera</p>
<p>Please help me </p>
<p>Now I notice that I am receiving 400 code.</p>
<p>Exception in thread "main" java.io.IOException: Server returned HTTP response code: 400 for URL: <a href="http://images.anandtech.com/doci/5478/Screen" rel="nofollow">http://images.anandtech.com/doci/5478/Screen</a> Shot 2012-01-30 at 4.21.52 PM_575px.png
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)</p>
| java php | [1, 2] |
3,768,321 | 3,768,322 | How to create a javascript class or module, I need 2 instances on a page | <p>I am wrapping common javascript functions that will work on elements on a page.</p>
<p>My page has 2 of these elements (textareas), so I will need to create 2 instances and then I want to do this:</p>
<pre><code>var textArea1 = new SomeClass();
var textArea2 = new SomeClass();
textArea1.init("ta1");
textArea2.init("ta2");
</code></pre>
<p>I tried doing this the module pattern way, but I'm confused how I can create 2 seperate instances of it?</p>
<pre><code>var MYMODULE = function() {
var _init = function(ta) {
// ..
}
return {
init: function(ta) {
_init(ta);
}
};
}();
</code></pre>
| javascript jquery | [3, 5] |
4,057,730 | 4,057,731 | Generate repeaters according to user inputs | <p>I have a DataList control on my webpage, the rows of which are populated by ItemTemplate. Each row has a check box, and on button click, I am generating as a string which is actually a <code>sql</code> query text.</p>
<p>Each result returned by the query from the DB has 10 rows which are to be shown in another DataList, as something like this:</p>
<pre><code><Header>
Item1: Result1
Item2: Result2
Item3: Result3
...
Item10: Result10
</code></pre>
<p>The problem is that I do not know how many checkboxes will be selected by the user, and according the number of results returned will be unknown.
So, if the user selects two checkboxes from the first DataList, the result DataList should have two columns:</p>
<pre><code><Header1> <Header2>
Item1: Result1 | Item 1: ResultCol2
Item2: Result2 | Item 2: ResultCol2
Item3: Result3 | Item 3:ResultCol2
...
Item10: Result10 | Item 10: ResultCol2
</code></pre>
<p>I tried to think of a solution for this. Let's say a user selects two check boxes:</p>
<pre><code>foreach checkbox selected by the user
Make a new repeater. Add a new header.
Fetch the data from the database (Each result contains 10 columns) and bind to the repeater.
Add the repeater to a container on the web page.
</code></pre>
<p>Now, I remember that in windows forms, such addition of runtime generated controls can be done by something like <code>TableLayout.Add(childElements)</code></p>
<p>But, I am not able to think of something similar in Web Forms. Is this actually the correct approach? How can this kind of dynamic building of DataControl achieved in this case?</p>
| c# asp.net | [0, 9] |
4,868,549 | 4,868,550 | A Function to Check if the Mouse is Still Hovering an Element Every 10 Milliseconds (and run a function if it is) | <p>I was wondering if there is a function to be run after an element (e.g. div class="myiv") is hovered and check every X milliseconds if it's still hovered, and if it is, run another function.</p>
<p>EDIT: This did the trick for me:
<a href="http://jsfiddle.net/z8yaB/" rel="nofollow">http://jsfiddle.net/z8yaB/</a></p>
| javascript jquery | [3, 5] |
326,226 | 326,227 | How to get "public static final int" value by name? | <p>I created a class to extend KeyEvent:</p>
<pre><code>public class myKeyEvent extends KeyEvent {
public static final int MY_KEYCODE_01 = KeyEvent.KEYCODE_A;
//...
public static final int MY_KEYCODE_30 = KeyEvent.KEYCODE_Z;
}
</code></pre>
<p>Now, i want to get the Integer value by the variable name (eg. "MY_KEYCODE_01" should return integer value KeyEvent.KeyCODE_A) from another class (another file).</p>
<p>I tried to:</p>
<pre><code>try{
Class cls = myKeyEvent.class.getClass();
Field field = cls.getDeclaredField("MY_KEYCODE_01");
int value = (Integer) field.get(cls);
Log.v("TAG", "Field value is " + value);
} catch (NoSuchFieldException e) {
Log.e("TAG", "Field either doesn't exist or is not public: " + e.toString() );
}
</code></pre>
<p>In LogCat:</p>
<pre><code>Field either doesn't exist or is not public: java.lang.NoSuchFieldException: MY_KEYCODE_01
</code></pre>
<p>How can I do it?</p>
| java android | [1, 4] |
4,914,766 | 4,914,767 | display the images in publishing of website in server? | <p>I am using the following code for saving the images.</p>
<pre><code> if (RadUploadPageImage.UploadedFiles.Count != 0)
{
foreach (UploadedFile file in RadUploadPageImage.UploadedFiles)
{
targetFolder = "/ADDS/";
targetFileName = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());
string folderpath = Server.MapPath(@targetFileName);
while (File.Exists(folderpath))
{
counter++;
targetFileName = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());
break;
}
for (int i = 0; i < RadUploadPageImage.AllowedFileExtensions.Length; i++)
{
if (file.GetExtension().ToString() == AllowedFileExtensions[i])
{
file.SaveAs(this.Server.MapPath(targetFileName));
path = targetFileName;
break;
}
else
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "aa", "<script>alert('Image should be in .jpg, .jpeg, .png, .gif,.bmp,.tiff');break;</script>", false);
}
}
</code></pre>
<p>images are not displaying while publishing. How to display the images while publish the site in server. Please tell me </p>
<p>While running the code in my system i am able to displaying the uploaded images.
In published path i am not able diplaying the uploaded images.</p>
<p>Please tell me what is the wrong ?</p>
| c# asp.net | [0, 9] |
3,861,077 | 3,861,078 | Adding information into the database | <pre><code> private void AddGroupTasks(){
title1 = tTitle.getText().toString();
detail1 = tDetail.getText().toString();
ArrayList<NameValuePair> b = new ArrayList<NameValuePair>();
Tasks = new ArrayList<String>();
try{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost ("http://203.209.111.88/AddGroupTasks.php");
httppost.setEntity(new UrlEncodedFormEntity(b));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
StringBuilder sb = new StringBuilder();
String line=null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
</code></pre>
<p>So, When I click add,the information is supposed to be added to database. However, it gives a null value. By the way, I'm writing a to-do list app. </p>
<pre><code>$Title = $_REQUEST['tTitle'];
$Detail = $_REQUEST['tDetail'];
$Group = $_REQUEST['spin'];
$DueDate = $_REQUEST['tDueDate'];
$Title = "'".$Title."'";
$Detail = "'".$Detail."'";
$Group = "'".$Group."'";
$DueDate = "'".$DueDate."'";
print $Title;
$database = "CloudList";
mysql_connect("localhost","root","1234");
mysql_select_db($database) or die("Unable to select database");
$q = "INSERT INTO message(group_name,message_title,message_details,message_due) VALUES($Group,$Title,$Detail,$DueDate)";
$result = mysql_query($q);
print $q;
mysql_close();
</code></pre>
<p>Here, This is my PHP Script.</p>
| php android | [2, 4] |
4,288,365 | 4,288,366 | How can I detect with JavaScript/jQuery if the user is currently active on the page? | <p>I am needing to detect when a user is inactive (not clicking or typing) on the current page for more than 30 minutes.</p>
<p>I thinking it might be best to use event blubbling attached to the body tag and then just keep resetting a timer for 30 minutes, but I'm not exactly sure how to create this.</p>
<p>I have jQuery available, although I'm not sure how much of this will actually use jQuery.</p>
<p><strong>Edit:</strong> I'm more needing to know if they are actively using the site, therefore clicking (changing fields or position within a field or selecting checkboxes/radios) or typing (in an input, textarea, etc). If they are in another tab or using another program, then my assumption is they are not using the site and therefore should be logged out (for security reasons).</p>
<p><strong>Edit #2:</strong> So everyone is clear, this is not at all for determining if the user is logged in, authenticated or anything. Right now the server will log the user out if they don't make a page request within 30 minutes. This functionality to prevent the times when someone spends >30 minutes filling in a form and then submitting the form only to find out that they haven't been logged out. Therefore, this will be used in combination with the server site to determine if the user is inactive (not clicking or typing). Basically, the deal is that after 25 minutes of idle, they will be presented with a dialog to enter their password. If they don't within 5 minutes, the system automatically logs them out as well as the server's session is logged out (next time a page is accessed, as with most sites).</p>
<p>The Javascript is only used as a warning to user. If JavaScript is disabled, then they won't get the warning and (along with most of the site not working) they will be logged out next time they request a new page.</p>
| javascript jquery | [3, 5] |
4,105,245 | 4,105,246 | Save WebResponse as txt | <p>I'm looking for a method equivalent to Request.SaveAs in WebResponse. But I can't find it.</p>
<p>I want to store in txt file the headers and the body of a webresponse.</p>
<p>Do you know any technique to achieve it?</p>
| c# asp.net | [0, 9] |
2,728,775 | 2,728,776 | Counting controls on the page | <p>My problem is that, i want to count the controls on a page and then get their types, if there are textboxes, checkboxes or comboboxes, then make them enable or disable? Is there any example on the net? </p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
3,877,964 | 3,877,965 | how can i create a dynamic map that shows our company locations? | <p>I'm searching for a jquery plugin that allows me to create a dynamic world map and mark the countries that we have a branch there in a different color or put a logo of our company on that country.
I need to have access to that map so when a user clicks on a country i can fire a jquery event.</p>
<p>i think Google has something like this but I'm not sure</p>
<p>Thank you</p>
| javascript jquery | [3, 5] |
789,894 | 789,895 | c# update current time,days,date | <pre><code>protected void Page_Load(object sender, EventArgs e)
{
todayDate.Text=DateTime.Now.toString();
}
</code></pre>
<p>Output</p>
<blockquote>
<p>10:28AM 9/28/2011</p>
</blockquote>
<p>the current time is never update, the result is static, how do i set a interval in c# in order to update current time?</p>
<p>updated information</p>
<p>this is my ajax updated timer code</p>
<pre><code> <ajax:ToolkitScriptManager ID="scriptmanager1" runat="server">
</code></pre>
<p>
</p>
<pre><code> <asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
</Triggers>
<ContentTemplate>
<asp:Label runat="server" id="DateStampLabel" />
</code></pre>
<p>and i called it by using</p>
<pre><code>protected void UpdateTimer_Tick(object sender, EventArgs e)
{
DateStampLabel.Text = DateTime.Now.ToString() + " "+DateTime.Today.DayOfWeek.ToString();
}
</code></pre>
<p>output is exactly what i want, but the effect not exactly what i want, cause when user clicked on some button,the label will blink, this like telling the user the page is reloading, so i wondering is that any idea can deliver update time from server? or just refresh partial pages?</p>
| c# asp.net | [0, 9] |
989,622 | 989,623 | Jquery / Javascript find first visible element after scroll | <p>I have code like below:</p>
<pre><code><div id="container">
<div class="item" id="1">blah blah</div>
<div class="item" id="2">blah blah 2</div>
</div>
</code></pre>
<p>But actually there are lots and lots of with class='item'. </p>
<p>Basically as the user scrolls this great long list of items I want to change the style of the current top visible one (like google reader!). Have looked around for solution in jquery or plain javascript but can't seem to find one. Anyone have any ideas?</p>
<p>Thanks</p>
<p>Mark</p>
| javascript jquery | [3, 5] |
86,164 | 86,165 | add confirm message to the links | <p>I am trying to write a javascipt that will search for all the tags in the page and add to them an onclick event to show a confirm message before processing when clicking on the link.</p>
<p>Can someone help me please, it is ok if it works with jquery.</p>
<p>Thank you.</p>
| javascript jquery | [3, 5] |
3,561,461 | 3,561,462 | how to read twice a file using fileupload | <p>I am trying to read the same file twice.</p>
<p>I have been using a <code>FileUpload</code> to look up the file. I was successful in the first read where I find out how many lines the file have, using the next code in C# ans asp.net:</p>
<pre><code>Stream data_file;
data_file=FileUpload1.PostedFile.InputStream;
string line;
int elements;
StreamReader sr = new StreamReader(data_file);
line = sr.ReadLine();
while (line != null)
{
elements = elements + 1;
line = sr.ReadLine();
}
sr.Close();
</code></pre>
<p>With this number I can now create an array of array by setting fist how many elements the array is going to hold. The array this time is going to hold the number from the file something like this:</p>
<p>datafile:</p>
<p>1,1</p>
<p>2,3</p>
<p>arrayL[0][0]=1</p>
<p>arrayL[0][1]=1</p>
<p>arrayL[1][0]=2</p>
<p>arrayL[1][0]=3</p>
<p>so the code to do this is the next:</p>
<pre><code>double [][] dime= new double [elements][];
string[] div;
string line2;
int nn=0;
StreamReader ssr = new StreamReader(data_file);
line2 = ssr.ReadLine();
while (line2 != null)
{
dimen[nn] = new double[2];
for (int m2 = 0; m2 < 2; m2++)
{
div=line2.Split(new Char[] { ' ', ',', '\t' });
dimenc[nn][m2] = Convert.ToDouble(div[m2]);
}
nn=nn+1;
line2 = ssr.ReadLine();
}
ssr.Close();
</code></pre>
<p>However, the array says that it is empty but I know if I used the second part of the code in a complete diferrent method/ second button but if it is in the same method it does not work so my question is: </p>
<p>What's wrong? Why the second streamreader is not working?</p>
| c# asp.net | [0, 9] |
732,317 | 732,318 | Execute an external EXE with C#.NET | <p>I am executing a process in C# but I want to be able to do it without specifying the path. Where can I place the executable within the project so that the code finds it wuthout specifying a path?</p>
<p>At the moment I have:</p>
<pre><code> ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = @"C:\Docs\wkhtmltopdf.exe";
</code></pre>
<p>Which runs fine but what I'd like to end up with is:</p>
<pre><code> ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "wkhtmltopdf.exe";
</code></pre>
<p>I've tried placing the EXE in a folder in the project, in the root of the project, in the <code>bin</code> folder of the project - all unsuccessfully.</p>
| c# asp.net | [0, 9] |
8,422 | 8,423 | Password TextBox in Registration form has some value on Page Load | <p>I am creating a Registration form and following is the design code of Password and Confirm password field </p>
<pre><code><tr>
<td class="style14">
<asp:Label ID="lblPass" runat="server" Text="Password"></asp:Label>
<asp:TextBox ID="txtPass" runat="server" Width="150px" EnableTheming="True"
TextMode="Password" ></asp:TextBox>
</td>
</tr>
<tr>
<td class="style23">
<asp:Label ID="lblCnfPass" runat="server" Text="Confirm Password"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:TextBox ID="txtCnfPass" runat="server" Width="150px" TextMode="Password"
CausesValidation="True"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ErrorMessage="Paswword doesnot Match" ValidationGroup="register" ControlToCompare="txtCnfPass"
ControlToValidate="txtPass">Paswword doesnot Match</asp:CompareValidator>
</td>
<td>
&nbsp;
</td>
</tr>
</code></pre>
<p>The problem is when I run the page the password textbox is filled with some values, as <a href="http://i.stack.imgur.com/EtJPx.png" rel="nofollow">in the image</a>. How do I remove that? One more point is that when I changed TextMode property from password to singleline then there was no such problem! </p>
| c# asp.net | [0, 9] |
1,977,391 | 1,977,392 | jquery uniform select and deselect all checkbox | <p>I have problem with select all / deselect checkbox </p>
<p><strong>Code Here</strong></p>
<pre><code><input type="checkbox" value="" onclick="checkedAll();" name="checkall" id="checkall"/>
function checkedAll() {
$('.all span').click(function () {
if(document.getElementById("checkall").checked == true)
{
$('#uniform-undefined span').addClass('checked');
}
else
{
$('#uniform-undefined span').removeClass('checked');
}
});
$.uniform.update();
}
</code></pre>
<p>When I select checkbox(for all check box true) jQuery add span tag with <code>class="checked"</code></p>
<pre><code> spanTag.addClass(options.checkedClass);
</code></pre>
<p>And no one check box are active. </p>
<pre><code><li><label><div id="uniform-undefined" class="checker">">
<span class="checked"><input type="checkbox" value="F2" style="opacity: 0;"></span>
</div><b>1 </b>
</label></li>
<li><label><div id="uniform-undefined" class="checker">
<span class="checked"><input type="checkbox" value="F2" style="opacity: 0;"></span>
</div><b>2 </b>
</label></li>
<li><label><div id="uniform-undefined" class="checker">
<span class="checked"><input type="checkbox" value="F3" style="opacity: 0;"></span>
</div><b>3 </b>
</label></li>
</code></pre>
| javascript jquery | [3, 5] |
4,673,742 | 4,673,743 | Web site project login against seperate database | <p>Howdy,
I use the Visual Studio 2010 - and I'd like to create a ASP.NET Website - however I would like to check the login against a seperate database and not the .mdf file because I need a bit more flexibility and the access to the remaining items in my database.</p>
<p>Does anyone of you have a good solution how I could achieve that?</p>
<p>Edit: The database which I have is a SQL Server 2008 R2 database, if that matters.</p>
| c# asp.net | [0, 9] |
4,936,035 | 4,936,036 | How do I process only checked rows in table? | <p>Assuming I have the following table:</p>
<pre><code><table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>A1</td>
<td><input type="checkbox"/> A2</td>
<td>A3</td>
</tr>
<tr>
<td>B1</td>
<td><input type="checkbox"/> B2</td>
<td>B3</td>
</tr>
<tr>
<td>C1</td>
<td><input type="checkbox"/> C2</td>
<td>C3</td>
</tr>
</tbody>
</table>
</code></pre>
<p>I want to generate JSON from the table only for the rows whose checkbox is checked. What do I put in for "Insert Check Here"?</p>
<pre><code>var myRows = [];
var $headers = $("th");
var $rows = $("tbody tr").each(function(index) {
$cells = $(this).find("td");
myRows[index] = {};
$cells.each(function(cellIndex) {
// Insert Check Here
myRows[index][$($headers[cellIndex]).html()] = $(this).html();
});
});
var myObj = {};
myObj.myrows = myRows;
alert(JSON.stringify(myObj));
</code></pre>
| javascript jquery | [3, 5] |
1,351,921 | 1,351,922 | random GridView with Images | <p>I want to create a DayDream for my App and i want a Wall of images but i dont know how to randomize the images.</p>
<p>I want that some images are (2 times) bigger than other images and the other images are around them, all random. Is there a simple way to do this?
The Images are saved dynamically in a ArrayList of ImageViews before they will be loaded into the GridView.</p>
<p>Currently i have a simple Horizontal Layout which gets filled with ImageViews, but this is way too simple and won't fill the complete screen...</p>
<p>I have no point where i could start, any help would be fine!</p>
| java android | [1, 4] |
5,608,273 | 5,608,274 | reading external server file in jquery and php | <p>i need to load an external html page in my codes </p>
<pre><code>$(document).ready(function(){$("#check").load("http://www.mysite.com/names.html")});
</code></pre>
<p>and i need my script reads this external html page </p>
<p>is it possible to do such a thing in <strong>jquery or even in php ?!</strong></p>
<p>i need to know all of the possible ways .</p>
| php jquery | [2, 5] |
402,580 | 402,581 | Showing toast before an intesive work of processor | <p>I need to show a Toast message before a method using an intense processor work. The problem is that the Toast only shows after this method, even calling this method in another Thread.</p>
<p>How can i show the Toast before ?</p>
<p>EDIT: The code is too long for showing here ... but i will resume it ... </p>
<p>...</p>
<pre><code>Toast.makeText(getBaseContext(),"Text", Toast.LENGTH_SHORT).show();
proccess.setRun();
</code></pre>
<p>//In the Proccess class that implements Runnable ...</p>
<pre><code>public void setRun(){
thread= new Thread(this);
thread.setPriority(Thread.NORM_PRIORITY);
thread.start();
running=true;
}
public void run() {
bytes=byteGrooveMaker();
prepare(grBytes);
}
</code></pre>
<p>//byteGrooveMaker() is a method in Proccess class that requires lot of processor work.</p>
| java android | [1, 4] |
1,345,073 | 1,345,074 | validation of input data in php - javascript | <p>I want to validate the data that the user enters in a form. I have only a username and two fields for the password. My first question is that I check the data with javascript and it works fine, but i want to check the data with php too incase javascript is not working. In case the javascript is not working the data will be checked from the php code, but my problem is that if javascript is working then the data will be checked from javascript and php too. Is this fine? Is there any way to avoid checking with php when the input data are checked by javascript? Also I am checking the inputs(username and password) for the number of characters, for characters(i don't permit special characters, only "_", "." numbers and letters in order to avoid sql injection) - how does it sound to you? Do you have any other suggestion for better validation?</p>
<p>Thank you in advance. </p>
| php javascript | [2, 3] |
726,925 | 726,926 | javascript/jquery convert utc to local time in short format | <p>So I'm trying to convert a UTC time to the clients local time in short format. I am using the following code:</p>
<pre><code>var date = new Date(call.Timestamp);
date.toLocaleString()
</code></pre>
<p>And I get the output like this on the screen:</p>
<blockquote>
<p>Thu Sep 13 2012 14:33:15 GMT+1000 (AUS Eastern Standard Time)</p>
</blockquote>
<p>What I would like to do is once I have converted it to the date object to display the short format:
dd/mm/yyyy hh:mm:ss or mm/dd/yyyy hh:mm:ss depending on what timezone they are in.
Is there a standard way I can do this in javascript? Does anyone know of a library package that can do this for me?</p>
<p>I have also tried:</p>
<pre><code>date.toLocaleDateString() + ' ' + date.toLocaleTimeString()
</code></pre>
<p>but the date string still outputs: "Thursday, September 13, 2012" rather than </p>
| javascript jquery | [3, 5] |
3,628,501 | 3,628,502 | creating android apps | <p>Im a C# developer (sarted a few months ago) and I always been an android fanatic. Now, I know that android apps are developed in java. Since java and c# are quite similar, Im wondering if I can develop android apps using c#, or do I have to learn java?</p>
| c# android | [0, 4] |
3,901,075 | 3,901,076 | How to round decimal numbers in Android | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4796746/double-value-to-round-up-in-java">Double value to round up in Java</a> </p>
</blockquote>
<p>I am getting float number as input and I want it to round to 2 digits after decimal point.
i.e. for example if I get 18.965518 as input, I want it to be 18.97. How to do it?</p>
| java android | [1, 4] |
5,073,460 | 5,073,461 | Get image from external server | <p>We are storing our images at Amazon S3. Let's say the location is <a href="http://media.sitename.com/folder1/image1.jpg" rel="nofollow">http://media.sitename.com/folder1/image1.jpg</a>.</p>
<p>I want to copy this file and store it in our server. Is it possible to do this using C#. I am using asp.net 4.0.</p>
<p>Please help. Thanks.</p>
| c# asp.net | [0, 9] |
4,454,804 | 4,454,805 | jQuery addClass() to element generated after append() | <p>I am trying to add a class to a newly appended DIV without using something like:</p>
<pre><code>t.y.append('<div class="lol'+i+'"></div>');
</code></pre>
<p>Here's a better example of what I'm trying to do:</p>
<pre><code>var t = this;
$(this.x).each(function(i, obj) {
//append new div and add class too <div></div>
t.y.append('<div></div>').addClass('lol'+i);
});
</code></pre>
<p>Page load HTML looks like:</p>
<pre><code><div class=".slideButton0 .slideButton1 .slideButton2" id="sliderNav">
<div></div>
<div></div>
<div></div>
</div>
</code></pre>
| javascript jquery | [3, 5] |
5,210,273 | 5,210,274 | Track when a download file dialog appears | <p>I have some links that when the user clicks one, it links to a php script which runs some stored procedures to generate data and then calls another script to download the data as an excel spreadsheet. This all works fine.</p>
<p>What I'd like to do is have a loader gif appear beside the link that was clicked clicked and when the dialog appears to get the user to save the file, have that gif disappear again.</p>
<p>Can I track this event at all to achieve this? Not had much luck so far.</p>
| php javascript jquery | [2, 3, 5] |
2,733,149 | 2,733,150 | jQuery swap div on hover with delay | <p>I'm trying to create two "buttons" that using the hover event, hide some divs and then display some others in their place. I'm then trying to delay the swapping back to the default div. </p>
<p>All works, fine, unless you go from one button to the other at which point you get many divs displaying at the same time until the delay passes. If we don't use the delay it works perfectly.</p>
<p>The javascript:</p>
<pre><code>jQuery(function ($) {
$('#servers-btn').hover(
function() {
$('#servers, #servers-heading, #servers-arrow').show(0);
$('#default, #default-heading').hide(0);
},
function() {
setTimeout( function() {
$('#servers, #servers-heading, #servers-arrow').hide(0);
$('#default, #default-heading').show(0);
},1000)
}
);
$('#hosting-btn').hover(
function() {
$('#hosting, #hosting-heading, #hosting-arrow').show(0);
$('#default, #default-heading').hide(0);
},
function() {
setTimeout( function() {
$('#hosting, #hosting-heading, #hosting-arrow').hide(0);
$('#default, #default-heading').show(0);
},1000)
}
);
});
</code></pre>
<p>I assume i need to make one hover function aware of the other so it can cancel the timeout, i just have no clue how to do it. </p>
<p>EDIT - just tidyed up code to put all divs into one hide/show.</p>
<p>Also, i should have probably mentioned that the #default, #servers and #hosting divs appear in exactly the same location. So need to instantly switch at the same time (which the above does). </p>
<p>EDIT - latest attempt to use clearTimeout here <a href="http://jsfiddle.net/KH4tt/1/" rel="nofollow">http://jsfiddle.net/KH4tt/1/</a> - but can't quite make it work right. </p>
| javascript jquery | [3, 5] |
2,367,767 | 2,367,768 | How to assign a dynamic textbox value to a label control | <p>dropdown event code..... </p>
<pre><code> foreach (var res in result)
{
count = +1;
Table tbl = new Table();
TableRow row = new TableRow();
TableCell cell = new TableCell();
TableCell cells = new TableCell();
TextBox tx = new TextBox();
tx.ID = "txt" + res.Filtername.ToString() + count.ToString();
Label lb = new Label();
lb.Text = res.Filtername.ToString() + "<br></br>";
lb.Width = 100;
lb.Height = 20;
cell.Controls.Add(lb);
row.Cells.Add(cell);
cells.Controls.Add(tx);
row.Cells.Add(cells);
tbl.Rows.Add(row);
Page.Form.Controls.Add(tbl);
//Page.Form.Controls.Add(lb);
//Page.Form.Controls.Add(tx);
}
}
protected void btnsave_Click(object sender, EventArgs e)
{
try
{
Label lbb = new Label();
form1.Controls.Add(lbb);
lbb.Width = 300;
lbb.Height = 10;
TextBox txx = new TextBox();
TextBox tx = form1.FindControl("txx") as TextBox;
lbb.Text = "ANSWER" + txx.Text + " , " + txx.Text.ToString() + " , " + txx.Text.ToString();
}
catch(Exception ex)
{
Label1.Text = ex.Message.ToString();
}
</code></pre>
<p>// this is not working... it showing like ---> ANSWER , ,</p>
| c# asp.net | [0, 9] |
2,960,579 | 2,960,580 | How can I add files to java app in android so I can get it path? | <p>I want to add files to java app in android so I'll know their path and can access them.
How can I do it? (It doesn't matter where they will be the most important is that I can access them and I'll know the relative path of the them)</p>
| java android | [1, 4] |
4,913,574 | 4,913,575 | ASP:Imagebutton fail to post back in gridview | <pre><code> <asp:GridView ID="gv1" runat="server" Width="100%" DataSourceID="ods1" AutoGenerateColumns="false"
DataKeyNames="FileID" HeaderStyle-Height="20px">
<Columns>
<asp:TemplateField ItemStyle-Width="25px" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:ImageButton ID="imgMimeType" runat="server" CommandName="download" />
</ItemTemplate>
...
</code></pre>
<p>I have defined my image button as above, but for some reason row command fails to fire off when I click the button. </p>
<p>Strangely, linkbutton in another column works just fine. </p>
<p>How do I make it so that image button will fire off post back?</p>
<p><strong>Row bind</strong></p>
<pre><code>Image Button imb = e.Row.FindControl("imgMimeType") as ImageButton;
if (imb != null)
{
imb.CommandArgument = file.FileID.ToString();
imb.AlternateText = imb.ToolTip = file.MimeType;
if (file.MimeType.Contains("zip"))
{
imb.ImageUrl = "~/Images/mimetypes/zip-icon.png";
}
...
</code></pre>
<p><strong>Row command code</strong></p>
<pre><code>public void gv1_RowCommand(object sender, GridViewCommandEventArgs e)
{
switch (e.CommandName.ToLower())
{
case "download":
...
</code></pre>
| c# asp.net | [0, 9] |
3,237,844 | 3,237,845 | Get inputs value and separated by "|" | <p>I have inputs and I need to get values and separated by <code>"|"</code> symbol.</p>
<p>My input:</p>
<p><img src="http://i.stack.imgur.com/BVsDV.png" alt="enter image description here"></p>
<p>Output what I need:</p>
<p><strong>00:00|00:00|00:00</strong></p>
<p>My code is :</p>
<p>(and it's not working)</p>
<pre><code>var timesArray = $('table').find('input');
var times = timesArray.val();
$('.alltimes').val(times);
</code></pre>
| javascript jquery | [3, 5] |
5,945,876 | 5,945,877 | In jQuery how can I get the next selector in a nested loop? | <p>I have the following structure:</p>
<pre><code><div class="foo">
<div class="moo">
<div class="too"> <input type="hidden" val="56"/></div>
</div>
</div>
<div class="foo">
<div class="moo">
<div class="too"> <input type="hidden" val="58"/></div>
</div>
</div>
</code></pre>
<p>Continued...</p>
<pre><code>//jQuery Code
$('.too').live('click',function(){
var next_value = $(this).next('.too').find('input').val();
console.log(next_value);
});
</code></pre>
<p>Now I want the value of the next "too" input. How can I get this? It's not working. </p>
| javascript jquery | [3, 5] |
3,638,152 | 3,638,153 | export gridview data to pdf | <p>its throwing error like document has no pages.</p>
<p>i have written code like this.</p>
<pre><code>protected void Button4_Click(object sender, EventArgs e)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition","attachment;filename=GridViewExport.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
GridView1.AllowPaging = false;
GridView1.DataBind();
GridView1.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
}
</code></pre>
<p>can any1 help me on this</p>
| c# asp.net | [0, 9] |
3,193,107 | 3,193,108 | Array exists in an array of arrays | <p>How can I check if an array exists in an array of arrays ? I have tried either plain javascript and jquery methods but none seems to help.</p>
<p>IE this doesn't work:</p>
<pre><code>$.inArray( [1,2], [[0], [], [1,2]] )
</code></pre>
<p>Even a more simple one:</p>
<pre><code>[1,2] == [1,2] //gives false.
[1,2] === [1,2] //gives false.
</code></pre>
<p>ORDER is <strong>NOT</strong> important for my task, only same elements existing is neccesary.</p>
| javascript jquery | [3, 5] |
1,697,830 | 1,697,831 | how to monitor clicks of child site (added by using iframe) from parent | <p>I have a website called A i want to display another website called myFrame through A using iframe i want to count all the clicks in myFrame and want to display in my website A.myFrame site is in different domain.I did the following code but its not working </p>
<pre><code><html>
<body>
Count: <span id="clicks">0</span>
<iframe id="myframe" src="http://www.myFrame.com" class="restricted" height="400px;" width="400px;" scrolling="no" frameborder="0">
</iframe>
</body>
</html>
<script language="javascript">
$(function() {
var clicks = 0;
$('#myframe').contents().find('a').bind('click', function(e) {
e.preventDefault();
clicks++;
$('#clicks').html(clicks);
});
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
4,834,438 | 4,834,439 | Common property with all jQuery objects | <p>I want create a property inside my object with all jQuery objects wich it will use. I novice at JavaScript and that's why I want an advice. Can I do this in such manner?</p>
<pre><code>var myVar = {
init: function() {
//...
this.obj = {
id1: $('#id1'),
id2: $('#id2'),
id3: $('#id3')
}
this.method2();
},
method1: function() {
alert(this.obj.id1.html()) // some work with id1
},
method2: function() {
alert(this.obj.id1.html()) // some work with id1
}
};
$(function() {
myVar.init();
myVar.method1();
});
</code></pre>
| javascript jquery | [3, 5] |
4,583,975 | 4,583,976 | Jquery using css function | <p>So im just playing around with my jquery and got stuck with quite odd problem. so i'm getting width of div like this</p>
<pre><code>block_width = $(".grid_block").css("width");
</code></pre>
<p>Now i would like to do something with that width let's say</p>
<pre><code>container_width = block_width * 21;
</code></pre>
<p>and now if would alert <code>container_width</code> i would get <code>Nah</code> insted of numbers, what am i doing wrong?</p>
| javascript jquery | [3, 5] |
2,598,176 | 2,598,177 | How to set the priority of events in a buttonclick? | <p>Here I need to call a javascript function first and after some time I need to call a c# function on the same button click event. Is it possible?</p>
<pre><code> <asp:ImageButton ID="imgBTNExportPPT" runat="server" Width="15" Height="15" border="0"
OnClientClick="JavaScript:exportCharts('JPG');" OnClick="imgBTNExportPPT_Click" ImageUrl="~/Images/PPT_icon.png" />
</code></pre>
<p>Any suggestion?</p>
| c# javascript asp.net | [0, 3, 9] |
4,285,632 | 4,285,633 | how to attach a show method? | <p>Sorry if the title is a little vague, Im currently learning jQuery and would like to fade a content div in and out on hover whilst displaying a read more link when hovered and hiding it when unhovered. I can get the div to fade and the read more link to display although at the moment the read more link is inheriting the opacity of the fade of .25, I understand that I have to add this show method but Im not sure what function or method I have to use.</p>
<p>code is here <a href="http://jsfiddle.net/kyllle/a4mPS/" rel="nofollow">http://jsfiddle.net/kyllle/a4mPS/</a></p>
<p>if anyone could explain anything to me that would be great as i would love to fully understand as much as possible.</p>
| javascript jquery | [3, 5] |
1,370,678 | 1,370,679 | Converting simple Javascript to jQuery | <p>I have this:</p>
<pre><code><script type="text/javascript">
window.onresize = fontResize;
function fontResize() {
document.body.style.fontSize = parseInt(document.documentElement.clientWidth/100) + 'px';
}
</script>
</code></pre>
<p>Could someone have a crack at converting this to jQuery please, i have DIV's with class "features" and i need the P text to fill them when they are resized, so i need to font-size to grow/shrink along with the DIV. That make sense?</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
3,798,149 | 3,798,150 | Getting text before element | <p>How could I get the text of the body that is before a specific element using Javascript/jQuery?
What I want to achieve is finding out the position of an element respect of the body, for instance, if the body text is 100 characters long and the text before the node is 50, that node would be at 50%.
Getting body's length is easy, but getting the text before an element is not as trivial as I'd thought in first instance.</p>
<p>EDIT:</p>
<p>To make it clear, I'll give an example:</p>
<pre><code><body>
<p>
...some text <span>that could have sub-elements</span>
</p>
<p>
...some text
<ul>
<li>now with a list</li>
<li>why not?</li>
</ul>
</p>
<div>
<p>...some text...</p>
<div>
<p>...some text...</p>
<p id="this_is_the_element">what's there in the body before this element?</p>
<p>...some text...</p>
<p>...some text...</p>
</div
</div>
</body>
</code></pre>
<p>In this case, the specific node would be <code>#this_is_the_element</code> and what I would expect to get is something like:</p>
<pre><code>...some text that could have sub-elements
...some text
now with a list
why not?
...some text
...some text
</code></pre>
| javascript jquery | [3, 5] |
5,592,661 | 5,592,662 | How to maintain JavaScript function variable states (values) between calls? | <p>I am looking for getters and setters functionality but cannot rely on <code>__defineGetter__</code> and <code>__defineSetter__</code> yet. So how does one maintain a function variable's value between function calls?</p>
<p>I tried the obvious, but myvar is always undefined at the start of the function:</p>
<pre><code>FNS.itemCache = function(val) {
var myvar;
if( !$.isArray(myvar)
myvar = [];
if( val === undefined)
return myvar;
.. // Other stuff that copies the array elements from one to another without
// recreating the array itself.
};
</code></pre>
<p>I could always put another <code>FNS._itemCache = []</code> just above the function, but is there a way to encapsulate the values in the function between calls?</p>
| javascript jquery | [3, 5] |
5,061,414 | 5,061,415 | function(¶m) - like in PHP | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3877675/javascript-pass-variables-through-reference">JavaScript Pass Variables Through Reference</a> </p>
</blockquote>
<p>How can you do something like this in javascript?</p>
<p>In PHP you can put a <code>&</code> in a function in front of the parameter to write directly back to the variable.. How can you do something like this in javascript?</p>
| javascript jquery | [3, 5] |
1,346,461 | 1,346,462 | Jquery post, response in new window | <p>I have a script that on.DocumentReady posts data to another page. That page responds with some HTML encapsulated in one div tag.</p>
<p>My goal is to have this post response/data open in a new window.</p>
<p>Any hints or clues? </p>
<p>Here is the snippet I created from Dr. Mille's advice.</p>
<pre><code> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var packslip_id = 35592;
var po_no = 0018439;
var box_no = 1;
$.post("https://example.com/barcode/generate", { packing_slip: packslip_id, reference: po_no, total_boxes: box_no},
function (data) {
alert(data);
var win=window.open('about:blank');
with(win.document)
{
open();
write(data);
close();
}
});
});
</code></pre>
<p></p>
| javascript jquery | [3, 5] |
2,139,698 | 2,139,699 | How to load the loading image using jquery when particular controls gets loaded by web service? | <p>I have check box list which is loaded through web service when one radio button list checked is change in client side.</p>
<p>I'm using asp.net and C# code behind.</p>
<p>my code is </p>
<pre><code>function BindCheckbox(strFlagName) {
debugger;
var tripTime = fc("rbtnTripTime_0").checked == true ? fc("rbtnTripTime_0").value : fc("rbtnTripTime_1").value;
//THIS IS THE PLACE I'VE CALLED THE WEBSERVICE, WHEN IT'S HIT SERVER I SHOULD LOAD THE LOADING IMAGE
GPSService.DropDownOneFetch(strFlagName, tripTime, OnCheckBoxComplete, OnError, OnTimeout);
return false;
}
</code></pre>
<p>or my checkbox list name msname</p>
<p>i can do the load image when msname gets loaded, but i dont the procedure(syntax) to call the jquery load function in client side.</p>
<p>I dont know how to do that.</p>
<p>Please help me.</p>
<p>Thanks to all.</p>
| javascript jquery | [3, 5] |
3,756,920 | 3,756,921 | How much of a transition is programming Java to iPhone apps? | <p>I'm a highly skilled Java dev contemplating learning iPhone development. Mac only dev aspects aside, how much of a leap would learning the mobile application stack be? Sure I understand that its closer to C in how one should approach it, and with that comes memory management and so on. </p>
<p>My queries would also include </p>
<ol>
<li>How well is OOP/OOAD supported? </li>
<li>Is there some API(s) which enable unit testing? </li>
</ol>
<p>I'd encourage those who answer to quote external sites and references to help elaborate the detail</p>
| java iphone | [1, 8] |
5,200,362 | 5,200,363 | javascript for radio button list | <p>i have an Radiobutton with (6 items under it). and i have an search button. if user clicks Search button it gets all the result. i am binding the items for Radiobuttonlist using database in .cs file</p>
<p>condition 1: now if user as selected Radiobutton1 [item1] it gets selected. and now if user again clicks on Radiobutton1[item1] then it should get deselected.</p>
<p>how to write an function onclick if here. where i need to check this condition</p>
<p>either you can provide me the solution in javascript or JQuery any help would be great . looking forward for an solution
thank you</p>
| javascript jquery | [3, 5] |
1,849,466 | 1,849,467 | Data in string - how to get Hours with functions for datatime? | <p>I have:</p>
<pre><code>var datatime = '2012-01-25 07:44:00';
</code></pre>
<p>How can i make object Datatime with this, and get only Hours? In php is option ->format("H"). And here?</p>
| javascript jquery | [3, 5] |
1,886,910 | 1,886,911 | If element is X left then animate another element | <p>Im trying to anuimate an element on my site, but only when that element comes in to view. </p>
<p>To do this im checking to see when my wrapper div is X left, then fire the function. My only problem is nothing is happening, nor showing up on my console. </p>
<p>Ive tried adding an alert to my function to see if it fires only i dont see the alert. Can anybody see what im doing wrong? </p>
<pre><code>var width = 200;
setInterval(function(){
if ($('.wrapper').css('left')<width){
$('.left-liftdoor').animate({
left: -50
}, 2000, function() {
});
}
}, 1000);
</code></pre>
| javascript jquery | [3, 5] |
4,398,408 | 4,398,409 | How to check if any of the li's are selected or not? | <pre><code><div id='id'>
<ul id='ul'>
<li id='1' class="">a</li>
<li id='2' class="">a</li>
<li id='3' class="">a</li>
<li id='4' class="select">a</li>
<li id='5' class="">a</li>
</ul>
</div>
</code></pre>
<p>How do I know if any of the <code><li></code>s have a <code>select</code> class? If found, how do I remove that class?</p>
| javascript jquery | [3, 5] |
2,870,506 | 2,870,507 | JavaScript infinite up and down element scrolling? | <p>I'm wondering if there is a simple way to make use of JavaScript (probably jQuery too?) in order to make the contents of a fixed-height div element scroll infinitely up and down (top, bottom, top, bottom, etc) when the page loads and <em>without</em> any user input or manipulation?</p>
<p>Thanks ahead of time, any input is greatly appreciated as I am hardly mediocre with JavaScript.</p>
| javascript jquery | [3, 5] |
1,231,311 | 1,231,312 | Readability a=b=c or a=c; b=c;? | <p>I have a class which has a group of integers, say</p>
<pre><code>foo()
{
int a;
int b;
int c;
int d;
....
string s;
}
</code></pre>
<p>Now the question is for the best readbility, the init() function for foo(), should it look like</p>
<pre><code>void init()
{
a=b=c=d=1; //for some reason they are init to 1;
s = "abc";
}
</code></pre>
<p>or</p>
<pre><code>void init()
{
a=1;
b=1;
c=1;
d=1;
s = "abc";
}
</code></pre>
<p>?</p>
<p>The reason for a string in class is a hint of other groups of same types might present and of course, the class might grow as requirement changes</p>
<p>EDIT: before this question goes too far, the intention of this question was simple:
In Effective C++ item 12 (prefer initialization to assignment in constructors), Scott uses chain assignment instead of a=c; b=c; I am sure he knows when to use what, but I also remembered the books I read also recommended to use int a; int b; which in similar case of assignments. In my program I have a similar situation of a group of related individual build-in types needs to be initialized and I have found by making a chain assignment does makes it easier to read especially if the class have many other different types instance variables. It seems to contradict with books I read and my memory, hence the question.</p>
| c# c++ | [0, 6] |
4,208,974 | 4,208,975 | Identify this item clicked on trigger | <p>I have a menu that is usually clicked by the user. It executes a function</p>
<pre><code>$('.MenuItem').click(function() {
document.writeln($(this).html() + ' was clicked');
});
</code></pre>
<p>I have run into a new requirement where I need to trigger the click of a menu item programmatically. So I tried</p>
<pre><code>//I want to trigger click and identify the item that has been clicked. Normally, I just use
//the this object, but on a trigger I don't know how to assign this so `.html()` functions.
//This doesn't work as intended.
//$('.MenuItem').trigger('click','Item1');
</code></pre>
<p>How can I identify the item clicked on <code>trigger</code>?<br /><br />
<a href="http://jsfiddle.net/smacky311/yNg5E/" rel="nofollow">Fiddle</a></p>
| javascript jquery | [3, 5] |
1,420,250 | 1,420,251 | accessing speicific array elements with jquery | <p>If my PHP returns a array with 6 elements how would I access each of them specifically in jquery?</p>
<p>For example I want to create:</p>
<p>var itemOne = value of first array element;
var itemTwo = value of second array element;
...</p>
<pre><code>$.get('ajax/employee_menu.php', { job: $('#job').val() },
function(data)
{
//i want to put each value from 'data' into variables here.
});
</code></pre>
| php jquery | [2, 5] |
2,345,382 | 2,345,383 | Encrypt and decrypt | <p>I wrote Decrypt and Encrypt with C# and used it in my project, and right now it works But I am wondering that I have to write Decrypt and Encrypt with JavaScript for Sniff or it is enough?</p>
| c# javascript | [0, 3] |
3,849,835 | 3,849,836 | ASP.NET Controls after postback | <p>I have a web page which consists a few asp:buttons, asp:textbox, gridview and asp:imagebutton.</p>
<p>When the Page loads for the first time, the user insert a number into the textbox, and then presses the button which preform the postback.</p>
<p>My question is that : after the postback in the page_load event I have a refrence to the imagebutton, i can set its display etc.</p>
<p>As apart of the postback, the gridview is being updated, i call gridview.databind() from the page_load
so the gridview selecting event is triggred, but when i try to refernce the imagebutton from whithin the selecting method i see that the imagebutton is null.</p>
<p>If i will try to refrence that imagebutton again from the page_load, after the selecting method is completed, there is no problem.</p>
<p>Why cant I reference the imagebutton, or actually any other control, from the selecting method ?</p>
<p>10X alot :)</p>
| c# asp.net | [0, 9] |
1,881,928 | 1,881,929 | Select previous "this" element | <p>I have a piece of javascript code where i am trying to get to the previous element declared. Currently i have two on click functins within eachother.</p>
<pre><code>$('#formIngredient').on("click", '.newIngredient', function() {
value = $(this).attr('data-name');
$(this).attr('data-isactive', 'true');
$('#newIngredientInput').val(value);
$('#newIngredient').modal('show')
$('#createNewIngredient').click(function() {
inputName = $('#newIngredientInput').val();
inputCategory = $('#newIngredientCategory').val();
var newIngredient = $.ajax({
type: "GET",
url: '/content/includes/ajax/createNewIngredient.php',
data: {name: inputName, id_category: inputCategory}
});
newIngredient.done(function(result) {
//PAI.showPage(PAI['PAGE']);
$(this).parent().replaceWith('Hello');
$('#newIngredient').modal('hide');
});
});
});
</code></pre>
<p>I am trying to use the previous element with this code.</p>
<pre><code>$(this).parent().replaceWith('Hello');
</code></pre>
<p>Any ideas?</p>
| javascript jquery | [3, 5] |
1,508,796 | 1,508,797 | Moving animation not smooth in android | <p>I am trying to create a moving ball animation in my app everything is working fine, ball moved as i want but it is not smooth. I tried everything to make it smooth but no luck every time i failed. Please help me to solve this!</p>
<p>here is my xml code:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="true" >
<translate
android:duration="3000"
android:fromXDelta="-1%p"
android:fromYDelta="-87%p"
android:toXDelta="1%p"
android:toYDelta="-40%p" />
<translate
android:duration="3000"
android:fromXDelta="2%p"
android:fromYDelta="0%p"
android:startOffset="2200"
android:toXDelta="0%p"
android:toYDelta="42%p" />
<translate
android:duration="4000"
android:fromXDelta="0%p"
android:fromYDelta="42%p"
android:startOffset="4500"
android:toXDelta="-5%p"
android:toYDelta="0%p" />
<translate
android:duration="4000"
android:fromXDelta="0%p"
android:fromYDelta="0%p"
android:startOffset="5500"
android:toXDelta="4%p"
android:toYDelta="-47%p" />
</set>
</code></pre>
<p>and here is my java code:</p>
<pre><code>ImageView image = (ImageView)findViewById(R.id.imageView1);
Animation anim = AnimationUtils.loadAnimation(this, R.drawable.moveing_ball_anim);
image.startAnimation(anim);
</code></pre>
<p>I move image in this shape.</p>
<p><img src="http://i.stack.imgur.com/Tf3Kz.png" alt=""></p>
| java android | [1, 4] |
5,550,824 | 5,550,825 | Jquery date difference | <p>I have this code for calculating date difference (without weekends) between two input fields, and printing the difference in days in a third text box. The date format is yy-mm-dd (because of mysql).</p>
<pre><code><script type="text/javascript">
$("#vazi_od, #vazi_do").change(function() {
var d1 = $("#vazi_od").val();
var d2 = $("#vazi_do").val();
var minutes = 1000*60;
var hours = minutes*60;
var day = hours*24;
var vazi_od1 = getDateFromFormat(d1, "yy-mm-dd");
var vazi_do1 = getDateFromFormat(d2, "yy-mm-dd");
var newvazi_od=new Date();
newvazi_od.setFullYear(vazi_od1.getYear(),vazi_od1.getMonth(),vazi_od1.getDay());
var newvazi_do=new Date();
newvazi_do.setFullYear(vazi_do1.getYear(),vazi_do1.getMonth(),vazi_do1.getDay());
var days = calcBusinessDays(newvazi_od,newvazi_do);
if(days>0)
{ $("#razlika").val(days);}
else
{ $("#razlika").val(0);}
});
</script>
</code></pre>
<p>But, when i pick the start and the end date, nothing happens in the field that should show the difference in days... Any help?</p>
| javascript jquery | [3, 5] |
1,839,345 | 1,839,346 | How does one get a C++ library loaded into Python as a shared object file (.so)? | <p>I'm a Python guy building a Linux-based web service for a client who wants me to interface with a small C++ library that they're currently using with a bunch of Windows based VB applications.</p>
<p>They have assured me that the library is fairly simple (as far as they go I guess), and that they just need to know how best to compile and deliver it to me so that I can use it in Python under Linux.</p>
<p>I've read a bit about the <code>ctypes</code> library and other options (SWIG, etc), but for some reason I haven't really been able to wrap my head around the concept and still don't know how to tell them what I need.</p>
<p>I'm pretty sure having them re-write it with <code>Python.h</code>, etc is out, so I'm hoping there's a way I can simply have them compile it on Linux as a .so and just import it into Python. Is such a thing possible? How does one accomplish this?</p>
| c++ python | [6, 7] |
1,039,229 | 1,039,230 | Setting aspx table's visibility to true fails | <p>I'm puzzled here. I have a webform with 3 tables in it. I want to show/hide them according to certain conditions. It all works fine except in one situation.</p>
<p>this is what I have:</p>
<pre><code><asp:UpdatePanel ID="upGeneral" runat="server" >
<ContentTemplate>
<table id="tab1" runat="server" visible="true" width="100%">
...
</table>
<table id="tab2" runat="server" visible="false" width="100%">
...
</table>
<table id="tab3" runat="server" visible="false" width="100%">
...
</table>
</ContentTemplate>
</asp:UpdatePanel>
</code></pre>
<p>then, I have a few buttons added to the page, and depending on which one is pressed, I'll change the table's visibility.
My problem is that, under certain conditions, I'm changing tab3's visibility to true, and tab1 and tab2's to false, and while tab1 will have it's visibility set to false, tab3 will not have it's visibility set to true... sigh!</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
...
if (!editMode)
{
tab1.Visible = false;
tab2.Visible = false;
tab3.Visible = true;
}
}
}
</code></pre>
<p>in debug mode, as I go through these instructions, tab3.visibile = true will not change tab3's property!
Has this happened to you before? How did you solve it?</p>
<p>Thanks a lot!</p>
| c# asp.net | [0, 9] |
461,728 | 461,729 | Sort date from string without using any of "Date" functions from jQuery or Javascript | <p>How can I sort by date from string <strong>without using any of jQuery "Date" functions or methods?</strong></p>
<p>Lets say that I have something like this:</p>
<pre><code><ul>
<li class="article"><a href="#" class="">15/02/1966</a></li>
<li class="article"><a href="#" class="">17/07/2003</a></li>
<li class="article"><a href="#" class="">11/12/2007</a></li>
<li class="article"><a href="#" class="">04/07/1951</a></li>
</ul>
</code></pre>
<p>How to sort them from lowest to biggest? Thanks!</p>
| javascript jquery | [3, 5] |
3,280,812 | 3,280,813 | Setting a textbox value by JQuery | <p>I am setting a <code>TextBox</code> controls value via an ajax post.</p>
<pre><code>$('#txtSite').val(msg.d.SiteName);
</code></pre>
<p>This is working and the value of the <code>TextBox</code> is altered correctly. But, when I come to posting the information to the database, the <code>txtSite.Text</code> value is empty!!</p>
<p>Any ideas? Am I going mad?</p>
<p>Code to populate the <code>TextBox</code>:</p>
<pre><code>$.ajax({
type:"POST",
url: "MyPage.aspx/ValidateSite",
data: "{ siteID: '" + $('#txtSiteID').val() + "' }",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
if (msg.d != null) {
$('#txtSite').val(msg.d.SiteName); // It's definitely doing this
}
else {
$('#txtSite').val('');
}
},
error: function(msg) {
}
});
</code></pre>
<p>Code to save to the server (all connectivity etc. is correct and working). This code is in an ASP button click event:</p>
<pre><code>SqlCommand cmd = new SqlCommand("INSERT INTO [Sites] ([SiteName]) VALUES ('" + txtSite.Text + "')", conn);
cmd.ExecuteNonQuery();
</code></pre>
<p>The <code>TextBox</code> is defined like so:</p>
<pre><code><asp:TextBox ID="txtSite" runat="server" AutoComplete="off" TabIndex="4" MaxLength="50" Style="width: 230px" Enabled="false" CssClass="FormDisabledTextWithSmallHeight" />
</code></pre>
<p>I have also tried changing my JQuery to use plain Javascript instead and doing this:</p>
<pre><code>document.getElementById("txtSite").value = msg.d.SiteName;
</code></pre>
<p>Still returns me an empty value.</p>
| jquery asp.net | [5, 9] |
3,296,699 | 3,296,700 | How to find element value in jQuery | <p>I am trying to get all class call <strong>Position</strong> $(".Position") and get then find the value that == 4 and then show the id.</p>
<pre><code><input type="Text" id="#34" value="1" class="Position">
<input type="Text" id="#22" value="2" class="Position">
<input type="Text" id="#37" value="3" class="Position">
<input type="Text" id="#41" value="4" class="Position">
</code></pre>
<p>Thanks</p>
| javascript jquery | [3, 5] |
196,840 | 196,841 | How to check if a variable is set in Javascript? | <p>I have this object/array thing:</p>
<pre><code>var states = {};
states["CA"] = new State("CA", "California");
states["AR"] = new State("AR", "Arizona");
....
</code></pre>
<p>How can I check if <code>states["AL"]</code> has been set or not? Will the following work (in all browsers)?</p>
<pre><code>if (states["AL"] == undefined)
alert("Invalid state");
</code></pre>
| javascript jquery | [3, 5] |
1,077,292 | 1,077,293 | What is the best way to begin with jQuery? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/168802/where-can-i-find-a-tutorial-to-get-started-learning-jquery">Where can I find a tutorial to get started learning jQuery?</a> </p>
</blockquote>
<p>Considering I am new to jQuery technology, what is the best way to begin with it?</p>
| javascript jquery | [3, 5] |
4,903,722 | 4,903,723 | pass range of dates on selecting two dates | <p>I have a Jquery Datepicker where i need to select a date range, like the start date and end date.
Currently I am passing (individual) selected date on a click of a button. I need some understanding how can i pass the date range. </p>
<p><strong>Jquery Calender (Datepicker)</strong></p>
<pre><code>function showSelectDatesFromCalendar() {
$('#selectDates').datepick({minDate: new Date(1990, 1 - 1, 1),maxDate: new Date(), defaultDate: new Date(), monthsToShow:[1,3],monthsToStep:3, multiSelect:999,dateFormat:'mm/dd/yyyy'
,changeMonth:false, showSpeed:'#fast'});
}
</code></pre>
<p>1) If I select 1 dec and 30 dec, 1 dec is start date, 30 dec is end date. then
it should pass all the dates in between the start and end date. </p>
<p>How can i achieve this functionality. </p>
| javascript jquery | [3, 5] |
3,897,028 | 3,897,029 | Android - php string encoding | <p>i am doing a project in android. i am a begineer in android also. in my android application i am using php as my webservice provider. in my php code for the authentication i am check the user vaidity and return string 1 or 0. In android application i am get the string. but when i check it in a if condition it fails. is it due to any charset compatablity issue.</p>
<p><strong>in php code</strong> </p>
<pre><code>.....
if($auth) {
echo '1';
}
else {
echo '0';
}
</code></pre>
<p><strong>in android</strong></p>
<pre><code>//get the code and saved in to string loginStatus;
if(loginStatus == "1") {
//not getting into this part if the loginStatus is 1;
}
else {
//getting into this part
}
</code></pre>
| php android | [2, 4] |
5,844,009 | 5,844,010 | Programatically Setting Page Setup Options in Excel | <p>I have a ASP.NET Web App which is copying a Report to an Excel Sheet by creating an HTML table and copying the contents.
I want to fit the excel report into 1 page before firing the print option. This needs to be done programatically while I'm generating the Excel workbook.
Please provide a solution to this asap.</p>
| c# asp.net | [0, 9] |
3,706,711 | 3,706,712 | Include jar in aspx or html | <p>Is it possible to include a JAR file in an aspx page . If so how do i go about this ???
Thanks in Advance</p>
| java asp.net | [1, 9] |
3,710,773 | 3,710,774 | how to check if Receiver is registered in android | <p>I need to check if my registered receiver is still registered if not how do i check it any methods?</p>
| java android | [1, 4] |
1,370,753 | 1,370,754 | How to call ASP.NET .dll file from a PHP script? | <p>Do you know how can I call an ASP.NET .dll file from a PHP script?<br>
Thanks!</p>
| php asp.net | [2, 9] |
1,579,997 | 1,579,998 | How TO make Reusable code at PHP - Related With including jQuery core | <p>Excuse me, What is best way to include jQuery to web application? Since, my application including another php file, and another file including another file.
I need a function which will put jQuery code after <code><head></code> tag and before <code></head></code> tag, and if there is another page has been included the jQuery, please do not include it again to the page.</p>
<p>I mean this tag </p>
<pre><code><script type="text/javascript" src="js/jquery.min.js"></script>
</code></pre>
<p>has to be included after <code><head></code> and before <code></head></code> tag.</p>
<p>I need <a href="http://en.wikipedia.org/wiki/Utility_class" rel="nofollow">Utility Class</a> which will check the code between <code><head></code> and <code></head></code> tag.
Is it possible?
Anyone can help?</p>
| php jquery | [2, 5] |
5,910,657 | 5,910,658 | Long running operation on website | <p>What if I have website with a button. User clicks on the button and starts a long running process. After a few hours (or minutes) user update webpage and see results. What is the best (and any other) way to implement long running operation on website?</p>
| c# asp.net | [0, 9] |
5,889,424 | 5,889,425 | How to adjust the hue of a color code? | <p>Maybe someone know of a way in Java (Android) to apply HUE to a color code?</p>
<p>For example if I have #1589FF and apply 180 HUE, I should get #FF8B14.</p>
| java android | [1, 4] |
1,760,716 | 1,760,717 | How can I pass data from one view to another in android? | <p>I have two views named: <code>first_view</code> and <code>second_view</code>.</p>
<p>The first view consists of a button and an editable text view. The second view consists of a single text view.</p>
<p>In my first view, I want to put a number in the datable text view. As I click the button, it should display the number in the second view.</p>
<p>How can I code Java classes for the two views?</p>
| java android | [1, 4] |
3,278,845 | 3,278,846 | How to get value from dataTable of gridview? | <p>I have a girdivew and a SQLDataSource to bind the dataTable information to gridview.</p>
<p>How can I get the value of a certain column for the current editing row in the Row UPDATING EVENT. ( From dataTable ) .</p>
<p>Thank you ,</p>
| c# asp.net | [0, 9] |
1,249,923 | 1,249,924 | get value based on index dropdown | <p>I need to select a value from dropdown based on index. It is a super easy question. cannot find the property:</p>
<p>I though doing something like: </p>
<pre><code>dll.Items[index]
</code></pre>
<p>But still do not know how to get value for this index.</p>
| c# asp.net | [0, 9] |
734,811 | 734,812 | How to pass multiple checkboxes to PHP through JQUERY | <p>I HAVE modified my code, i used firebug console.log to detect weather the the php gets the array passed or not. and firebug displays this - rescheck[]=2&rescheck=1&rescheck=3</p>
<p>I think php gets the array if THATS what an array in php supposed to be like.</p>
<p>SO guys, if thats correct how to insert that array in database? or how to loop it? the foreach loop ive made didnt work.</p>
<p>JQUERY CODE:</p>
<pre><code>$('#res-button').click(function (){
var room_id=$('[name=rescheck[]]:checked').serialize().replace(/%5B%5D/g,'[]');
alert(room_id);
$.ajax({
type: "POST",
url: "reservation-valid.php",
data: {name_r:name_r, email_r:email_r,contact_r:contact_r,prop_id:p_id,cvalue:room_id},
success: function(data) {
console.log(data);
}
});
});
<input type="checkbox" name="rescheck[]" value="<?php echo $roomid; ?>" />
</code></pre>
<p>PHP CODE:</p>
<pre><code>$c_array=$_POST['cvalue'];
echo $c_array;
//foreach($c_array as $ch)
//{
//$sql=mysql_query("INSERT INTO reservation VALUES('','$prop_id','$ch','$name_r','$contact_r','$email_r','')");
//}
</code></pre>
<p>I think I managed my jquery code to be right, but I don't know how to fetch that with PHP. </p>
| php jquery | [2, 5] |
2,178,637 | 2,178,638 | Creating my own callbacks | <p>I have a page with some jQuery, and a separate non-jQuery function.</p>
<p>Currently my function runs on $(document).ready, but I want to call a jQuery function as soon as my function is finished. I can pass my function as a callback to any jQuery function, but how can I set things up the other way round?</p>
<p>So I would ideally like to know how to create a function foo that will take care of this for me:</p>
<pre><code>$(document).ready(function() {
foo(myfunction(), $(bar).something);
}
</code></pre>
<p>or how to extend an existing function to handle callbacks. Thanks.</p>
| javascript jquery | [3, 5] |
2,735,385 | 2,735,386 | Get results from php script via jquery load() function before php script finishes | <p>I have the following situation:</p>
<p><b>jquery:</b></p>
<pre><code> $(function(){
$('input[type="button"]').click(function(){
$('#result').load('script.php');
});
});
</code></pre>
<p><strong>script.php:</strong></p>
<pre><code><?php
echo "1";
sleep(2);
echo "2";
sleep(2);
echo "3";
?>
</code></pre>
<p>Currently the jquery load function will wait for the php script to finish and then display the result into the targeted div...so in this case it will wait 4 seconds and then display 123.</p>
<p>What I'm trying to achieve is to have the jquery load function to return the results separately, live, before the php script finishes. By separately I mean to see in the targeted div 1 then wait for 2 seconds, then see 2, then another 2 seconds and then 3.</p>
<p>Is this possible with my example?</p>
| php javascript jquery | [2, 3, 5] |
737,580 | 737,581 | Why is the null coalescing operator breaking my string assignment in c#? | <p>I'm creating a query string in a web form, and I'm dealing with values from the parameters that might be null. There are lots of ways to check and fix these, but the most elegant one I found is the following:</p>
<pre><code>string pass;
pass = "BillabilityDetail.aspx?_startDate=" + _startDate.Text + "&_endDate=" + _endDate.Text +
"&_isContractor=" + _isContractor.SelectedValue + "&_busUnit=" + _busUnit.Text
+ "&_projectUnit=" + _projectUnit.SelectedValue + "&_leadCon=" + _leadCon.Value ?? -1
+ "&_acctExec=" + _acctExec.Value ?? -1 + "&_isBillable=" + _isBillable.SelectedValue +
"&_isActive=" + _isActive.SelectedValue + "&_include=" + _include.SelectedValue;
</code></pre>
<p>The only issue is... it doesn't work. When the code reaches this part, </p>
<pre><code>"&_leadCon=" + _leadCon.Value ?? -1 + "&_acctExec=" + _acctExec.Value ?? -1
</code></pre>
<p>the string stops assigning values. So the string would end with &_leadCon=.
I know of ways to work around this, but I don't know why it stopped working in the first place. Any tips?</p>
| c# asp.net | [0, 9] |
3,639,722 | 3,639,723 | Confirmation dialog at runtime in asp.net | <p>I have a simple content management system that stores pages by Pagename and Version. After clicking on Save, my code (server side) checks for the existence of Pagename/Version. </p>
<p>If it exists I would like to display a confirmation dialog box, which asks the user to confirm whether or not the current Pagename/Version should be replaced. </p>
<p>What is the easiest way to accomplish this? Thanks. </p>
| c# asp.net javascript | [0, 9, 3] |
4,622,718 | 4,622,719 | Getting some experience with asp.net | <p>Hi I recently learned asp.net webforms and looking to get some experience under my belt using it.I found a website that provided some exercises here:</p>
<p><a href="http://www.wiseowl.co.uk/free-exercises/asp.net-4.0-c-sharp.htm" rel="nofollow">asp.net exercises</a></p>
<p>There weren't that many and I managed to finish them all.Are there any other website or books with similar exercises or tasks that could help me get some experience in using asp.net?</p>
| c# asp.net | [0, 9] |
3,052,267 | 3,052,268 | Onclick validate edittext if user enters an int with a string | <p>I have in my application an EditText which validates that the user cannot enter a integer when the user clicks a button. </p>
<p>This is done by an if statement on a condition where word is a String: </p>
<p>(word.matches("[0-9]*")</p>
<p>How can I change this if a user enters a word with a string as well. </p>
<p>Thanks</p>
| java android | [1, 4] |
2,277,042 | 2,277,043 | jQuery slide changing with index and fadeout -- jumpiness | <p>I am working on a jQuery slideshow plugin. One of my methods involves switching back and forth between pictures. I have been pretty successful in creating it, here is an isolated case with the code thus far for the particular method:</p>
<pre><code>var images = $("#simpleslides").children("img");
$(".slideButtons ul li").on("click", "a", function() {
var anchorIndex = $(this).parent().index();
var $activeSlide = $("#simpleslides img:visible");
var $targetSlide = $(images[anchorIndex]);
if($activeSlide.attr("src") == $targetSlide.attr("src") || $targetSlide.is(":animated")) {
return false;
} else {
$activeSlide.css({ "z-index" : 0 });
$targetSlide.css({ "z-index" : 1 });
$targetSlide.stop().fadeIn("slow", function() {
$activeSlide.hide();
});
}
});
</code></pre>
<p>Here is a fiddle to see it in working action: <a href="http://jsfiddle.net/ase3E/" rel="nofollow">http://jsfiddle.net/ase3E/</a></p>
<p>For the most part, this works as you would expect it to. When a user clicks on the corresponding number, it fades in the picture. </p>
<p>However, I am running into some jumpiness and occasionally a complete <code>hide</code> of the slides when I am clicking around quickly. If you play with the fiddle, you will see what I am referring to Try clicking around on each image to see.</p>
<p>I have adopted <code>stop</code> which I thought would fix the problem but has not. I have put the <code>hide</code> method after the <code>fadeIn</code> callback, but that has also not helped the situation.</p>
<p>What am I doing wrong here??</p>
| javascript jquery | [3, 5] |
3,362,145 | 3,362,146 | How to select a tree view node in asp.net | <p>I have the the following code sample</p>
<pre><code> private TreeNode AddNode(TreeNode node, string key)
{
var child = node.ChildNodes.Cast<TreeNode>().FirstOrDefault(_ => _.Value == key);
if (child != null)
return child;
child = new TreeNode(key, key);
child.SelectAction = TreeNodeSelectAction.SelectExpand;
child.Selected = true;
node.ChildNodes.Add(child);
return child;
}
</code></pre>
<p>I'm not able to select the node. When I invoke <strong>treeview_SelectedNodeChanged</strong>, I'm getting NULL..</p>
<pre><code>string v = ((TreeView)sender).SelectedNode.Value;
</code></pre>
| c# asp.net | [0, 9] |
1,138,490 | 1,138,491 | how do i put $_FILES content into binary var in php? | <p>i have a unity c# program which is uploading a binary file (with some data).
(which is kind of irrelvant but maybe not)</p>
<pre><code>var form = new WWWForm();
form.AddField("docid", "A");
byte[] textarr = Encoding.ASCII.GetBytes("just a sample text to be compressed and sent to server");
form.AddBinaryData("file", textarr,"file.tmp");
string req = "my url";
WWW www = new WWW(req,form);
</code></pre>
<p>i want to take the file content(as binari) so that i will be able to send into the database as binari in the php side. </p>
<p>i am trying to do something like this:</p>
<pre><code>$binaridata = ~$_FILES["file"]["name"] (what do i need to do here? tried
</code></pre>
<p>file_get_content etc, but it always yield some errors)</p>
<p>Thanks for your help!</p>
| c# php | [0, 2] |
3,972,429 | 3,972,430 | fix System.NullReferenceException in C# | <p>i m developing a website and stuck with System.NullReferenceException .
on the master page I m using this code </p>
<pre><code>if (Request.Url.ToString().ToLower().Contains("content.aspx"))
{
if (Request.Params["ModuleID"].ToString() == null)
{
Response.Redirect("Content.aspx?ModuleID=1");
}
}
</code></pre>
<p>when Module Id is blank then it creates null reference exception.</p>
| c# asp.net | [0, 9] |
5,606,873 | 5,606,874 | FindControl inside Repeater | <p>I am trying to find a Label inside a Repeater, I am using:</p>
<pre><code> protected void lnkbtnEditRecord_Click(object sender, EventArgs e)
{
salesEditPanel.Visible = true;
resultPanel.Visible = false;
zipPanel.Visible = false;
ddlPanel.Visible = false;
topPanel.Visible = false;
Label lblSalesId = (Label)(Repeater2.Items[0].FindControl("lblSalesID"));
DataView dv = FillSalesPersonForm(Convert.ToInt32(lblSalesId.Text));
frmViewSalesPeople.DataSource = dv;
frmViewSalesPeople.DataBind();
}
</code></pre>
<p>This works great if the repeater only has one result, but if it has more then one it only gets the id for the first item listed. Any ideas on how to fix this?</p>
<p>EDIT: Basically the return is filled with user info and with each user info is a link to another page. So when I click the link I want to get the ID from the label for the record the link was clicked for. So If I click record 4 out of 5 I want and the ID for record 4 is 900 I want to get the 900 to pass.</p>
<p>Thanks!</p>
| c# asp.net | [0, 9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.