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,009,744
5,009,745
bitmap.eraseColor(COLOR.TRANSPARENT) not working on surfaceview
<p>I have a surfaceview in my layout, which i draw a bitmap to. I make the surfaceview transparent by calling this code :</p> <p>// framebuffer is a Bitmap</p> <pre><code> setZOrderOnTop(true); this.framebuffer = framebuffer; this.holder = getHolder(); this.holder.setFormat(PixelFormat.TRANSPARENT); </code></pre> <p>Now i want to clear the screen by using this :</p> <pre><code> framebuffer.eraseColor(Color.TRANSPARENT); </code></pre> <p>But it does not work. If i replace Color.TRANSPARENT with any other color it does paint the whole surface with that color i.e.</p> <pre><code> framebuffer.eraseColor(Color.WHITE); </code></pre> <p>Anyone have any ideas ? Thanks in advance.</p>
java android
[1, 4]
5,239,627
5,239,628
C++ Object Graph to C#
<p>Is there a tool that will take a series of C++ headers and generate a XSD and a class that will serialize the C++ to XML?</p> <p>Or really what we are looking for is the simplest way to migrate data from C++ to C#? We have a library in C++ that we would like to write a GUI for in C#. Using Managed wrapper classes it seems like we will have to make wrappers for each class. Automation is the goal.</p>
c# c++
[0, 6]
2,227,526
2,227,527
What are the tools/frameworks used to build C# ASP.net applications?
<p>I am basically a java programmer who wants to move to .net. I haven't worked in .NET companies so I don't have any idea about the tools they use. In a Java company people use Maven, Hibernate and frameworks such as JSF or Tapestry.</p> <p>My questions are: </p> <p>What are the tools/frameworks that .NET/C# companies use? Do they use ASP.NET MVC? Do they use any ORM tool? Do they use any framework?</p> <p>I will be happy if someone could tell me about this.</p>
c# asp.net
[0, 9]
3,955,984
3,955,985
Do something upon accepting an alert
<p>I want to execute some code when an alert is accept by the user, I know about this: </p> <pre><code>if(confirm("Go to the next step")) { document.write("accepted"); } else{ document.write("rejected"); } </code></pre> <p>the point is I want the box to have only one button like the normal alert, and by clicking it I can execute something.</p>
javascript jquery
[3, 5]
4,439,856
4,439,857
jQuery Collapsible Panel
<p>ASP.Net, 2.0 VS2005, .Net 2.0 jQuery 1.8.3, jQuery UI 1.9.2</p> <p>I have two panels (more will come later on) on my form that can be open or closed at the users request.</p> <p>i am using the jQuery '.slideToggle' method.</p> <p>This is my markup</p> <pre><code>&lt;div class="trigger0"&gt;Collapsible Header 1 - Click to toggle&lt;/div&gt; &lt;div class="panel0"&gt; content 1 &lt;/div&gt; &lt;div class="trigger1"&gt;Collapsible Header 2 - Click to toggle&lt;/div&gt; &lt;div class="panel1"&gt; content 2 &lt;/div&gt; </code></pre> <p>The following works fine</p> <pre><code>$(document).ready(function() { $(".trigger0").click(function(){ $(".panel0").slideToggle("medium"); }); $(".trigger1").click(function() { $('.panel1').slideToggle("medium"); }); }); </code></pre> <p>but this doesn't</p> <pre><code>$(document).ready(function() { for (var vReportSectionCount = 0; vReportSectionCount &lt; 2; vReportSectionCount++) { $(".trigger" + vReportSectionCount).click(function(){ $(".panel" + vReportSectionCount).slideToggle("medium"); }); } }); </code></pre> <p>As i dont yet know how many panels will finally exist i dont want to have to write a new line for every panel. Can someone explain to me why and propose a better solution?</p>
jquery asp.net
[5, 9]
3,586,215
3,586,216
List Adapter and getView function explanation
<p>I'm thoroughly confused about the life cycle of list view. More specifically, what does the list adapter do exactly? Does it just provide data to the given view? And when/where does the <code>getView()</code> function gets called? And what purpose does this <code>getView()</code> function provide? From just looking at the code, it looks like <code>getView()</code> is "assigning" data to the view to be displayed. I'd like to be able to use list views without having to memorize, do this and then this in order for it to work. I'd much rather understand it so I can use it properly. Someone please help me understand all of this.</p> <p>Also, if someone can explain to me.. what's the difference between BaseAdapter and ArrayAdapter? and any other kind of adapters that comes with Android.</p>
java android
[1, 4]
4,461,759
4,461,760
How to export an Asp.net Pi chart graph into MS Excel?
<p>How to export an Asp.net Pi chart graph into MS Excel?</p> <p>I am using Asp.net,C#</p> <p>Thank in advance Rashed</p>
c# asp.net
[0, 9]
3,603,980
3,603,981
How to return from a $.each operation? (jQuery)
<p>Example:</p> <pre><code>var t = $.each(templos_cache, function(f,g){ $.each(g.requer, function(h,j){ if (parseFloat(g.id) == id){ alert(j.nome); // OK, return 'afrodite'. return j.nome; // wrong, return [Object object]. } }); return ''; }); </code></pre> <p>Looking at the code we can see the problem... i can do a set in a variable out of scope but i think that can exist some more elegant way to do this.</p>
javascript jquery
[3, 5]
4,198,654
4,198,655
embedded javascript that is based on jQuery
<p>I'm building a service that allows people to put a javascript code I gave them to their site. The javascript code is based on jQuery.</p> <p>My question is how to do this to be safe and optimized, cause I don't want to break certain users website.</p> <p>The thing I'm looking for so far( you can update if you think I need to face other problems):</p> <ol> <li>what happens when the user already has jquery loaded on their page? should I load my jquery library using different namespace or should I use his jquery library.</li> <li>in case I can use his jquery library, I think I'll need to check to see if the versions corespond, but again is this safe?</li> <li>in case I want to use his jquery library, how do I check if he has jquery loaded and if he has the right version</li> <li>this is related to 3. what happen if he changes his jquery library that doesn't correspond with the library I think it will be, leading to a bad result.</li> </ol> <p>Looking for your answers. Thanks</p>
javascript jquery
[3, 5]
2,283,037
2,283,038
click function triggering function before event finishes
<p>I've built a dropdown menu that uses a slideUp event if the menu itself or anywhere in the body is clicked:</p> <pre><code>$('html, .currentPage').click(function() { $('.currentMenu').slideUp('fast', function() { myFunction(); }); }); </code></pre> <p>I also have a function inside the slideUp event callback. </p> <p>However, my problem is that the function is being called on html or .currentPage click whether the slideUp event has occurred or not.</p> <p>How can I make it so the function(); <strong>ONLY</strong> happens if the slideUp event runs?</p>
javascript jquery
[3, 5]
4,103,594
4,103,595
ANDROID: If...Else as Switch on String
<p>I'm writing an Android app for work that shows the status of our phone lines, but thats neither here nor there.</p> <p>I make a call to one of our servers and get returned JSON text of the status. I then parse this putting each line into a SortedMap (TreeMap) with the Key being the name of the line and my own class as the value (which holds status and other details).</p> <p>This all works fine.</p> <p>When the app runs it should then show each line and the info I have retrieved, but nothing gets updated.</p> <p>The JSON is returned and added to the Map correctly.</p> <p>This is a snapshot of the code that isn't working. I simply iterate through the map and depending on the value of key update the relevant TextView. The problem I am having is that when it gets to the IF statement that matches it never runs that code. It skips it as if values don't match.</p> <p>I can't see any errors. Is this the only way to do this as I know you can't use Switch..Case etc?</p> <p>Can anyone see my error? I've been coding on Android for 1 week now so its probably a newbie error!!</p> <p>Thanks Neil</p> <pre><code>Iterator iterator = mapLines.entrySet().iterator(); while(iterator.hasNext()) { // key=value separator this by Map.Entry to get key and value Map.Entry&lt;String, Status&gt; mapEntry = (Map.Entry&lt;String, Status&gt;)iterator.next(); // getKey is used to get key of Map String key = (String)mapEntry.getKey(); // getValue is used to get value of key in Map Status value = (Status)mapEntry.getValue(); if(key == "Ski") { TextView tvStatus = (TextView)findViewById(R.id.SkiStatus); tvStatus.setText(value.Status); } else if(key == "Cruise") { TextView tvStatus = (TextView)findViewById(R.id.CruiseStatus); tvStatus.setText(value.Status); } else if(key == "Villas") { TextView tvStatus = (TextView)findViewById(R.id.VillasStatus); tvStatus.setText(value.Status); } } </code></pre>
java android
[1, 4]
5,044,858
5,044,859
How do I detect a mobile device (iPhone, iPad etc), using JQuery?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3514784/best-way-to-detect-handheld-device-in-jquery">best way to detect handheld device in jQuery</a> </p> </blockquote> <p>Hi All,</p> <p>I have a link on my website for the Terms &amp; Conditions in the footer...when I click this link it brings up a modal window containing the Terms &amp; Conditions. The problem is that the scroller doesnt show up in the modal window when a mobile device is present &amp; the user cannot read the full text.</p> <p>Is there a way, when the user clicks the link, a script then detects if a mobile device is present...then redirects to a static version of the Terms &amp; Conditions page?</p> <p>I would be grateful if someone has a snippet of JQuery/JavaScript that does this as I'm a beginner at both JQuery and JavaScript. Thanks in advance</p>
javascript jquery
[3, 5]
2,247,705
2,247,706
Using spinner OnItemSelectedListener() to start new intent
<p>I have a spinner and when the user selects I want to call another java class using new Intent. The code below worked when I was using a Button but now I have it attached to the Spinner select I think it has something to do with view.getContext();</p> <p>areaspinner.setOnItemSelectedListener(new OnItemSelectedListener() {</p> <pre><code> public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) { int item = areaspinner.getSelectedItemPosition(); Intent myIntent = new Intent(view.getContext(), ShowXMLPAR.class); startActivityForResult(myIntent, 0); } public void onNothingSelected(AdapterView&lt;?&gt; arg0) { } }); </code></pre> <p>Can anyone help me update this part of the code.</p>
java android
[1, 4]
4,175,893
4,175,894
Get auto height of a div without cloning it
<p>I have a div element whose auto height, lets say, is 300px.<br> On a button click, I set it's height to 500px.<br> I would like to animate it's height back to its default height. The only solution I know is to clone the div, store its height and use it accordingly.<br> A <a href="http://jsfiddle.net/nLtVz/" rel="nofollow">jsfiddle example</a></p> <pre><code>var elem = $("div").clone().height("auto").appendTo("body"); $('div').animate({"height": elem.height()}); elem.remove(); </code></pre> <p>Is there a better way to do it? I dont want to clone as I have huge number of elements on my actual page.</p> <p>Update: I have created <a href="http://jsfiddle.net/XUL9H/" rel="nofollow">another fiddle</a>. How would you get default height of element if its not yet set on load?</p>
javascript jquery
[3, 5]
4,227,341
4,227,342
How to show the first n number of elements in jQuery?
<p>I have a page that has 50 elements with the same class "fields" which are all display none at the moment</p> <pre><code>&lt;div class="fields" style="display:none;"&gt; ... &lt;/div&gt; &lt;div class="fields" style="display:none;"&gt; ... &lt;/div&gt; &lt;div class="fields" style="display:none;"&gt; ... &lt;/div&gt; &lt;div class="fields" style="display:none;"&gt; ... &lt;/div&gt; ... </code></pre> <p>How to I only show the first 3 or whatever number. Plus count them with a count on top like the following example below.</p> <p>So for example if I needed the first 3 this is what i need the divs to look like</p> <pre><code>&lt;div class="fields"&gt; &lt;h1&gt;Station 1&lt;/h1&gt; &lt;/div&gt; &lt;div class="fields"&gt; &lt;h1&gt;Station 2&lt;/h1&gt; &lt;/div&gt; &lt;div class="fields"&gt; &lt;h1&gt;Station 3&lt;/h1&gt; &lt;/div&gt; &lt;div class="fields" style="display:none;"&gt; ... &lt;/div&gt; ... </code></pre> <p>So basically only some the number of divs that I need...I already have the number of elements I need to show in this blur statement in the station_count variable. Also notice i need a span tag with the count..any ideas on how to do this</p> <pre><code> $("#number_station").blur(function(){ var station_count = $(this).val(); //code goes there }); </code></pre>
javascript jquery
[3, 5]
5,856,187
5,856,188
Get call history and ping a URL with data in Android
<p>I am having issues. I have looked around as much as I can. I would like to see what you have some scratch. I am not looking for a full source code, just some help with the methods/techniques you used.</p> <p>Basically, X times per day I want to grab any new outgoing/incoming calls and ping a URL. I need this to be a service and run silently in the background and ALWAYS be running on the phone, this is another issue I am having.</p> <p>Open to any comments! Thanks.</p>
java android
[1, 4]
2,891,219
2,891,220
Android: float does not getting calculated
<p>Currently I'm having a problem, that drives me crazy.</p> <p>You know, how the percentage is calculated. It's (p/pMax)*100 , isn't it ?</p> <p>That is just that, what I've written in code. But I ALWAYS getting 0.0 as the result of this calculation. See the screenshot for clarifying.</p> <p><a href="http://i.stack.imgur.com/SToFO.png" rel="nofollow">eclipse screenshot</a></p> <p>As you can see the float variable <em>prg</em> becomes <em>0.0</em> as the result of the calculation <em>(252/1944)*100</em></p> <p>What am I doing wrong ? If you want, I can put the variable initialization here.</p> <p>Thanks for helping !</p>
java android
[1, 4]
3,228,759
3,228,760
Emulating Value Type Polymorphism in C Sharp
<p>I'm looking for a way to create some kind of value type hierarchical class structure. I know that enums do not support inheritence since they are value types and are therefore sealed, so I'm probably looking for some kind of static class implementation.</p> <p>My purpose for this is to redefine roles in this ASP.NET application I'm working on. Currently the roles are string constants (ROLE_ADMIN, ROLE_USER, etc.) and are put in the session and checked throughout the application something like so: Person.getRole() == ROLE_ADMIN (which is actually a string comparison). I'd like to refactor this so that I can have type safety, as well as some kind of polymorphic behavior as desribed below.</p> <p>Consider the following role structure:</p> <pre><code> user1 Group1 user2 Admin User3 </code></pre> <p>If a person's role is set to Group1, but a certain element on the page is only visible by user1, then I want the statement Person.getRole() == user1 to be true.</p> <p>EDIT:</p> <p>Thinking of the above structure as a tree, I wanted to be able to both define a user in terms of a leaf or a node, and check permissions in terms of a leaf or a node. However that raises a dilemma, does the checking of permissions in terms of a node check if the user belongs to a group (group1), or IS a group (Admin). I think the problem is that naming the root node of my tree as 'Admin' is misleading, since nodes should be thought of as groups and not as roles themselves. The root node should be something like 'All', and when it is defined as 'All' would inherit all the leaves of the tree and would therefore belong to all the groups.</p>
c# asp.net
[0, 9]
4,450,252
4,450,253
Parsing remote JSON using Javascript?
<p>I am building an application using WorldBank API, but WorldBank API does not support JSONP. So is there a way to parse remote JSON using Javascript. Thank You</p>
javascript jquery
[3, 5]
256,037
256,038
why can't I access this.property in my object literal?
<p>I've just been restructuring my code into objects and using the this keyword, I've got this problem whereby, setting the prop works, but then when the second method fires, <code>myProp</code> is undefined. I've noticed if I use <code>myObj</code> to set and get rather than this it works fine. What's the difference here? What am I doing wrong? I though this was referring to the instance of which there is only one which was automatically instantiated by the object literal.</p> <pre><code>var myObj = { SetProp: function (id) { this.myProp = "abc"; Ajax.GetJSONAfterStandardLogic(Utility.PrefixURL("/ajax/mymethod"), this.SetPropSuccess); }, SetPropSuccess: function (response) { console.log("test " + this.myProp); } } </code></pre>
javascript jquery
[3, 5]
4,048,897
4,048,898
Double quotes breaking jQuery (Very simple)
<pre><code> &lt;? //SQL SELECT HERE $result = mysql_query($sql); $options = ''; while ($row = mysql_fetch_array($result)) { $options .= '&lt;option&gt;Data: ' . $row['data'] .'&lt;/option&gt;'; } ?&gt; $("#multiSelect").html("&lt;?=$options?&gt;"); </code></pre> <p>The above is a PHP query inlined in a javascript function. It's goal is to populate a multiselect. The issue is that when $row['data'] contains something with double quotes jQuery doesn't like it and complains. When I remove the row containing double quotes it works fine.</p> <p>How can I get around this? Is this normal behavior of jQuery.</p>
php javascript jquery
[2, 3, 5]
2,930,038
2,930,039
Is using multiple base pages with inheritance the right choice?
<p>Should I be using multiple base pages with inheritance or is there a better strategy?</p> <p>Contrived Example:</p> <p>Currently I have 20 webpages and they all use my base-page "BasePage".</p> <p>ie.) Page1 : BasePage</p> <p>BasePage provides functions:</p> <ul> <li>Function1() </li> <li>Function2() </li> <li>Function3()</li> </ul> <p>Now I decide that 5 of my 20 webpages require the BasePage functions as well as 3 additional functions and a Page_Load():</p> <ul> <li>Function4()</li> <li>Function5()</li> <li>Function6()</li> <li>Page_Load()</li> </ul> <p>Do I now create another base page like this:</p> <p>MySecondBasePage : BasePage</p> <p>and then put Function4(), Function5(), Function6() and Page_Load() in it? </p> <p>Or is there a better/"proper" strategy to doing this? Should I be using classes?</p>
c# asp.net
[0, 9]
4,626,314
4,626,315
jQuery change button attributes
<p>I have a button like this:</p> <pre><code>&lt;input type="button" name="btn" id="btn" value="Proceed"/&gt; </code></pre> <p>After all processes and get the expected result, I need to apply some changes on this button.</p> <ol> <li>Change the value of this button.</li> <li>Add something to direct the current page to another one.</li> </ol> <p>I know I can do the first goal using the code below:</p> <pre><code>$('#btn').attr('value','newValue'); </code></pre> <p>But for the second one, I need something like our previous codes in JavaScript as below:</p> <pre><code>onclick="window.location.href='newPage.htm'"; </code></pre> <p>Help me please.</p>
javascript jquery
[3, 5]
4,575,823
4,575,824
select list title is not showing on mouse hover
<p>I created a Select list and applied jquery UI <code>selectmenu plugin</code> like:</p> <pre><code> &lt;select id="test" title="This is not showing on mouse hover"&gt; &lt;option..&gt; &lt;/option&gt;.. &lt;/select&gt; $("#test").selectmenu(); </code></pre> <p>Now my problem is that the <strong>title</strong> which i gave to my <code>select list</code> is not showing on mousehover. Whats the problem ?</p>
javascript jquery
[3, 5]
5,195,578
5,195,579
Javascript splitting
<p>lets say i have this variable</p> <pre><code>var image = "image.jpg"; </code></pre> <p>I'm trying to split the content of the variable image and insert _thumbs into it to get something like <code>image_thumbs.jpg</code>.</p> <p>How do i go about this? Many Thanks.</p>
javascript jquery
[3, 5]
1,890,143
1,890,144
Clear back navigation stack on activity intent
<p>I have a login view at the start of my application. On logging in this view is finished manually (i.e. <code>finish()</code> is called in the code). This is so that the user doesn't have to press the back button past the login page when they want to exit the app.</p> <p>Now I want to have a <code>logout</code> button in the app. This calls the login view (with an intent to remove any previously stored login credentials - i.e. simulating a logout).</p> <p>What I need to do is clear the backwards navigation stack on this intent, or else the user will still be able to press back and view the application as they navigated it originally.</p> <p>Now, <code>Intent.FLAG_ACTIVITY_CLEAR_TOP</code> doesn't work, I presume because I <code>finish()</code> the Login activity meaning that that activity isn't in the back stack. I am also using <code>Intent.FLAG_ACTIVITY_NEW_TASK</code> which doesn't seem to work either. User's can still press the back button and navigate backwards through activities they should be logged in to access.</p> <p>So what I need to do is create an instance of the Login activity and make this the new <code>root</code> activity of my application.</p> <p>How can I do this?</p> <p>Thanks</p>
java android
[1, 4]
4,853,894
4,853,895
juqery document ready() not fired in French culture
<pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function () { alert("doc ready"); // ... // ... }); &lt;/script&gt; </code></pre> <p>This code works fine in US, AU, EU, Chinese, Japanese, Germany cultures, but just not in French.</p>
jquery asp.net
[5, 9]
1,304,395
1,304,396
Data Read Returning (Invalid Attempt to Read when Reader is closed)
<p>I am trying to read an XML returned by a query, I tested the query and it is returning the XML with the correct items.. but the code behind has a problem..It reads the first item correctly but then it throws the exception.. I am not sure what is wrong (The exception happens the second time it attempts to go through the WHILE loop. See code below</p> <pre><code> // Create Instance of Connection and Command Object SqlConnection myConnection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["myConnection"].ConnectionString); SqlCommand myCommand = new SqlCommand("GetItemsXML", myConnection); // Mark the Command as a SP myCommand.CommandType = CommandType.StoredProcedure; // Add Parameters to SP SqlParameter parameterPortalID = new SqlParameter("@TheID", SqlDbType.Int, 4); parameterPortalID.Value = portalID; myCommand.Parameters.Add(parameterPortalID); SqlParameter parameterKeywords = new SqlParameter("@myWords", SqlDbType.VarChar, 4000); parameterKeywords.Value = myWords; myCommand.Parameters.Add(parameterWords); // Execute the command myConnection.Open(); SqlDataReader reader = myCommand.ExecuteReader(CommandBehavior.CloseConnection); string xmlOut = ""; while (reader.Read()) //SECOND ITERATION THROWS (Invalid attempt to read // when reader is closed) { xmlOut = xmlOut + reader[0].ToString(); } xmlOut = "&lt;MyItemsList&gt;" + xmlOut + "&lt;/ZMyItemsList&gt;"; reader.Close(); myConnection.Close(); return xmlOut; } </code></pre>
c# asp.net
[0, 9]
3,786,201
3,786,202
warning message while opening the excel file after export from gridview
<p>i have written code to export data but warning message i am facing while opening the excel file and by default file is saving as .html extension</p> <p>warning - "The file you are opening in a different format than specified by the file extension"</p> <p>i need with .xls extension to be saved please help me</p> <pre><code> private void ExportToExcel(DataTable dt) { string fileName = "FileName" + DateTime.Now.ToString("MMddyyyy_HHmmss") + ".xls"; Response.AddHeader("content-disposition", "attachment;filename=" + fileName); //Response.AddHeader("content-disposition", "attachment;filename=Filename .xls"); Response.ContentType = "application/vnd.ms-excel"; StringWriter stringWriter = new StringWriter(); HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWriter); DataGrid dataExportExcel = new DataGrid(); dataExportExcel.ItemDataBound += new DataGridItemEventHandler(dataExportExcel_ItemDataBound); dataExportExcel.DataSource = dt; dataExportExcel.DataBind(); dataExportExcel.RenderControl(htmlWrite); System.Text.StringBuilder sbResponseString = new System.Text.StringBuilder(); sbResponseString.Append("&lt;html xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:xlExcel8\" xmlns=\"http://www.w3.org/TR/REC-html40\"&gt; &lt;head&gt;&lt;/head&gt; &lt;body&gt;"); sbResponseString.Append(stringWriter + "&lt;/body&gt;&lt;/html&gt;"); Response.Write(sbResponseString.ToString()); Response.End(); } </code></pre>
c# asp.net
[0, 9]
2,505,135
2,505,136
static variables, what is their life span?
<p>I am using static variables in my app, lots of them. My question is, when I exit the app will they be still in memory..? If yes, how can I correct this. Thanks in advance.</p>
java android
[1, 4]
662,524
662,525
How do I set a background on a view without affecting its dimensions?
<p>I want use a tiled background to give a texture to an existing layout. So I have created a drawable like this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/green-linen" android:tileMode="repeat" &gt; &lt;/bitmap&gt; </code></pre> <p>Where "green-linen.jpg" is a 800x800 texture that I want to use. Then where I wish to use it on a layout I set background to point to this.</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_vertical|center_horizontal" android:orientation="vertical" android:background="@drawable/background"&gt; </code></pre> <p>The problem is now the layout thinks it needs to be 800x800 to accomodate the pattern which screws up the design. Is there any way to set a background but without affecting the existing layout? Plan B would probably be to write a custom paint routine but it likely to be more work and less efficient than just styling the page or setting the drawable.</p>
java android
[1, 4]
1,649,365
1,649,366
Using Javascript/JQuery Mouseover fades in Firefox (keeps repeating)
<p>I am trying to use JS/JQuery to make tiles that will fade out then fade in with different data (In this case it is pictures) when you over on it and then reverse it when you mouse off of it. Now my code works fine in Chrome but when I test it in FireFox it keeps executing the fade in/out commands. I looked up similar situations where people use the <code>$(this).stop().fadeOut(function()</code> code but since I am doing multiple fades and loading information it won't do the animation correctly. Does anyone know a solution to this?</p> <pre><code> &lt;script&gt; $(document).ready(function() { var hov = false; $(".previewBox").mouseenter(function() { if(hov === false) { hov = true; $(this).fadeOut(function() { $(this).load(function() { $(this).fadeIn(); }); $(this).attr("src", "Images/Portfolio/Art_Bike_Flip.png"); }); }; }); $(".previewBox").mouseleave(function() { if(hov === true) { hov = false; $(this).fadeOut(function() { $(this).load(function() { $(this).fadeIn(); }); $(this).attr("src", "Images/Portfolio/Art_Bike_Preview.png"); }); }; }); }); &lt;/script&gt;`enter code here` </code></pre>
javascript jquery
[3, 5]
6,019,291
6,019,292
loading and replacing the image in jquery
<p>I have low resolution image which is loaded first,once it is loaded i need to replace it with a high resolution image.</p> <p>I try to do so in html img tag but in throws error saying </p> <pre><code>Uncaught TypeError: Cannot read property 'width' of undefined </code></pre>
javascript jquery
[3, 5]
4,147,794
4,147,795
hide div when click on form or focus on another control or press escape key
<p>I am developing an web application. In this i provided a functionality means "autocomplete textbox". In this control, I need to show up 4 columns whenever user press keys in textbox, i need to collect these keys and send it to the service which will give us result as xml. then i convert xml to dataset and binded with datagird. for this i used jquery. after the result displayed ( i mean the result in datagrid which is placed in div), then i need to hide the div when the user clicks outside of the div or press escape key...</p> <p>for this i used onblur event. but, when i click on the result then, i could not fire the click event for the div..</p> <p>here is my jquery events...</p> <pre><code>function showList() { if(document.getElementById("txt1").value.length &gt; 3) { $("#divList").hide("slow"); $("#divLoading").show(); $.ajax({ type : "POST", url : "ajaxServerPage.aspx?streetname=" + document.getElementById("txt1").value, success : function(responseText) { $("#divLoading").hide(); $("#divList").show(); $('#divList').html(responseText); //add button click events for buttons which are placed in table $("#dataGridStreet .rowStyle").click(function(e) { //Open_ModifyPopup($(this).attr("id")); clickedRow($(this)); }); } // function(responseText) }); } } </code></pre> <p>How should I do this?</p> <p>Thanks</p>
asp.net jquery
[9, 5]
5,870,047
5,870,048
Create order "queue" list
<p>I'm pretty new to Jquery and need a little direction to get started on setting up an order "queue" system. Short examples would help, but I'm looking more for a general outline and the know if what I'm wanting to do is even possible:</p> <p>1) Have a "main" div where you select the item and enter the quantity for the item and select all the modifiers (I can do all this with text and checkboxes). Then click an "Add" button and it adds a summary of the order (maybe the quantity and item price total) to another div that "queues" up off to the side.</p> <p>2) After hitting "add" the "main" div will clear all the boxes and allow me to add another item.</p> <p>3) Have the ability to click the "summary" in the small div and re-display the order item.</p>
javascript jquery
[3, 5]
3,014,653
3,014,654
Calculate a percentage discount and how much is saved in javascript
<p>I'm having trouble calculating a 10% discount and then showing how much was saved in <code>#value3</code>. Code: </p> <pre><code>function priceCalc() { var price = $("#pricing").val(); var discount = 10; // should be percentage var total = price - discount; var savings = ? $("span#value1").html(price); $('span#value2').html(total); $('span#value3').html(savings); } $("select#pricing").change(priceCalc); priceCalc(); </code></pre>
javascript jquery
[3, 5]
5,973,042
5,973,043
Dynamic text box list
<p>I am trying to make a text box list using jquery. What I want is to have text that changes into a textbox when clicked. Then I want it to return to text afterwords. My problem is getting the dynamically created textboxes to focus, change the textbox text, be removed and change the text. This is my code:</p> <pre><code>$('.l').click(function() { $('&lt;input type="text" id="ltb" class="'+$(this).attr("class")+'"&gt;').insertAfter($(this)).val($(this).val()); $('#ltb').focus(); $(this).remove(); }) $('#ltb').blur(function() { $('&lt;div id="'+$(this).attr("class")+'" class="l"&gt;'+$(this).val()+'&lt;/div&gt;').insertAfter($(this)); $(this).remove(); }); </code></pre> <p>.l is the text while #ltb is the textbox. I need the #ltb to change value, focus, and be removed. I need .l to change once #ltb is removed. Can someone tell me how to do this?</p>
javascript jquery
[3, 5]
3,019,560
3,019,561
How to add data items to a List<Struct>
<p>I have the following struct defined in a user control:</p> <pre><code>public struct ColumnData { public string ColumnName { get; set; } public string ColumnDataItem { get; set; } public bool ColumnIsHyperLink { get; set; } public string ColumnHyperLinkURL { get; set; } public string ColumnHyperLinkPK { get; set; } } </code></pre> <p>I create a new instance of <code>List&lt;ColumnData&gt;</code> (In a different code behind that creates an instance of the user control) and want to pass in values to it, but how do I assign them to specific attributes within the struct object?</p> <p>I create an instance of the struct using the following code: </p> <pre><code>List&lt;ColumnData&gt; DataItems = new List&lt;ColumnData&gt;(); </code></pre>
c# asp.net
[0, 9]
981,455
981,456
JQUERY - fade out specifc div, wait, fade div back in
<p>I currently have this working fiddle - <a href="http://jsfiddle.net/B8Abd/" rel="nofollow">http://jsfiddle.net/B8Abd/</a></p> <p>I would like to use jquerys fade out then fade in during the function. The code at the moment is this:</p> <pre><code> function changetoYellow() { //change the color of the div createGradientV([0, 0, 0], [255, 255, 0], 7, 200); } </code></pre> <p>I would like to have something like this:</p> <pre><code> function changetoYellow() { //fade to black: $("#fadeBandsV").fadeOut(1000); //change the color of the div createGradientV([0, 0, 0], [255, 255, 0], 7, 200); //fade from black: $("#fadeBandsV").fadeIn(1000); } </code></pre> <p>Thank you.</p>
javascript jquery
[3, 5]
502,058
502,059
word was unable to read this document. it may be corrupt
<p>"word was unable to read this document. it may be corrupt" </p> <p>I am facing this error on server when want to open word file in C# but it works fine on my local machine. I have given all permission to the word file on server and the word file is also not corrupted. But still facing this error. Please help.</p>
c# asp.net
[0, 9]
1,710,349
1,710,350
Help with ContextMenu with a multicolumn ListView
<p>I have a listview which displays emails with the following layout:</p> <pre><code>[email protected] category //This could be work etc First line of the emails subject! </code></pre> <p>Using the following XML:</p> <pre><code>&lt;LinearLayout ........ android:orientation="vertical"&gt; &lt;LinearLayout ........ android:orientation="horizontal"&gt; &lt;TextView android:id="@+id/FROM_CELL" android:layout_width="250dip" android:layout_height="wrap_content" android:textColor="#AFC7C7" android:textSize="9sp"/&gt; &lt;TextView android:id="@+id/CATEGORY_CELL" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#34282C" android:textSize="9sp" android:gravity="right" /&gt; &lt;/LinearLayout&gt; &lt;TextView android:id="@+id/SUBJECT_CELL" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:textSize="10sp"/&gt; </code></pre> <p></p> <p>This all works fine, but when I put a ContextMenu on so I can allow long presses on certain emails, how would I go about retrieving the email address as to assign it a category?</p> <p>On the database side my method takes 2 strings, 1 being the email address to assign a category and another string which is what to call the category.</p> <p>I was wondering how you go about retrieving the email in the onContextItemSelected() method to allow for me to use it for assigning category's.</p> <p>Sorry if this is a bad explanation, I have tried my best :)</p> <p>Thanks, Rhys</p>
java android
[1, 4]
11,512
11,513
converting json string into json on client side?
<p>In my javascript code I am getting json string from cs file</p> <pre><code>var tmpString="&lt;%=resultset2%&gt;"; </code></pre> <p>In cs I am concatenating strings to build json string. Here is an issue the json string is returned as a string and it has " with it.</p> <pre><code>"[{id:'1',name:'Aik'},{id:'2',name:'Aik or Aik'}]" </code></pre> <p>Because of " in beginning and end javascript code treat it as a string. Kindly guide me how I should sort out this issue. </p> <p>thanks</p>
c# javascript asp.net
[0, 3, 9]
1,576,862
1,576,863
multiple .net applications, single point to put sites in maintenance mode
<p>I have a asp.net website that has other 'child' asp.net applications within that are setup as separate IIS applications, while others are not child applications.</p> <p>What would be a good way to prevent users from accessing the website during deployments/updates/downtime.</p> <p>I know I could do this using the web.config, but that would mean me having to update multiple web.config's manually during site lock downs.</p> <p>I could also have each request hit the database, but that seems a little much for this.</p> <p>Suggestions?</p> <p>I don't have direct access to the servers so I can't fiddle with IIS.</p>
c# asp.net
[0, 9]
5,767,310
5,767,311
webservice returns rounded number instead of decimal
<p>I have a web service that returns a decimal value into my json string but it rounds it off on numbers that are 400.00 to 400 instead, but if it has 400.50 it returns 400.50 which is what i want how do i return a value that is 400 to 400.00 in that format </p> <p><strong>Error</strong></p> <pre> {"Message":"LINQ to Entities does not recognize the method \u0027System.String ToString(System.String)\u0027 method, and this method cannot be translated into a store expression."," </pre> <p><strong>Code</strong></p> <pre> Products = ( from p in db.Products where p.DepartmentId == qDepartment.Id join i in db.ProductImages on p.Id equals i.ProductId into products from x in products.Where(y => y.Dimension == "180X180") select new Product { Id = p.Id, Title = p.Title, ShortDescription = p.ShortDescription, Brand = p.Brand, Model = p.Model, Image = x.Path, FriendlyUrl = p.FriendlyUrl, SellPrice = p.SellPrice.ToString("N2")/*Error Here changed type to string*/, DiscountPercentage = p.DiscountPercentage, Votes = p.Votes, TotalRating = p.TotalRating }).ToList(); </pre>
jquery asp.net
[5, 9]
5,531,524
5,531,525
upload file http handler file size
<p>I'm creating a small Silverlight uploader. It does 2 things: checks the file size and type and uploads the file. I'm creating an http handler on the receiving end. However, the Silverlight code can still be manipulated or bypassed and I don't want to tie up the server because someone's uploading 100MB file. How do I restrict the size of the upload in the http handler so that if the size of the file partially uploaded already exceeds 3MB then stop the upload.</p> <p>Thanks for your suggestions.</p>
c# asp.net
[0, 9]
1,506,196
1,506,197
Creating a text file on click of a button
<p>I basically want to create a text file that will have contents that will be fetched from one of the tables in my Database. The contents should display as follows:-</p> <pre><code>Item1 ID1 Item2 ID2 Item3 ID3 Item4 ID4 Item5 ID5 </code></pre> <p>I want the contents exactly like this. The names of the items and IDs will be diff ofcourse but the way of them appearing in th etext file should be like this.</p> <p>How do I go about this? Please give me some ideas. I tried to create a file using the following code:-</p> <pre><code> using (var sw = new StreamWriter(File.Open(@"D:\myFile.txt", FileMode.CreateNew), Encoding.GetEncoding("iso-8859-1"))) { sw.WriteLine("my text..."); } </code></pre> <p>and it got created fine. BUT, when I tried to create a file in C: drive, it said access to path denied. I basically want to create a map file in helicon which is installed in c: Also once the file has been created, then again when I click a "Create File" button in my c# code, it should either delete the file and create it again or overwrite its contents with the fresh data from my Items Table. What should I do? Please help me! I am new to all this. How do I make it work ? </p>
c# asp.net
[0, 9]
2,517,301
2,517,302
how to get value from a loop while using different button
<p>I need the value from a loop witch is $row->value, then when I click on button_click(href) a DIV popup will show and ask for another value that is idnumber. At the popup a submit button will direct to next_page.php</p> <p>I want both value from loop $row->value and at popup value=idnumber send to next_page.php</p> <pre><code>&lt;div id="show_popup"(hide/show popup)&gt; &lt;form action="next_page.php" method="GET or POST"&gt; &lt;input name="idnumber" type="text" value=""&gt; &lt;input type="submit" value="button"&gt; &lt;/form&gt; &lt;/div&gt; &lt;?php foreach($foo as $row){ echo " &lt;tr&gt; &lt;td&gt;".$row-&gt;value."&lt;/td&gt; &lt;td&gt;&lt;a class='button' href='#' onlick='(popup DIV)'&gt;button_click&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt;"; } ?&gt; </code></pre> <p>Is this possible?</p> <pre><code>$(function() { function launch() { $('#show_popup').lightbox_me({centered: true, onLoad: function() { $('#add-new-popup').find('input:first').focus()}});} $('.button').click(function(e) { $("#show_popup").lightbox_me({centered: true, onLoad: function() { $("#show_popup").find("input:first").focus();}});e.preventDefault(); }); }); </code></pre>
php javascript jquery
[2, 3, 5]
613,641
613,642
Time of Timepicker get's lost on screen rotate
<p>I have an activity with following code.</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // set time picker values TimePicker picker = (TimePicker) findViewById(R.id.startTimePicker); picker.setIs24HourView(true); picker.setCurrentHour(10); picker.setCurrentMinute(15); } </code></pre> <p>So a time picker is set to a fixed time, this works as expected. But when I rotate the screen and the activity get's recreated the time picker show in all fields the same value - not the value set. This happens on one, two or more time pickers on screen.</p> <p>Has anybody an explanation for this weird behaviour?</p>
java android
[1, 4]
3,112,412
3,112,413
Android: Master detail project has errors right after creation
<p>I have the android 4.1 and 4.0 SDK installed on my laptop. I've done plenty of projects just using a blank activity, but when I decided to try a "master detail flow" example from within Eclipse (create new Android project, select MasterDetailFlow) the other day it wouldn't even let me build. I have errors right off the bat. Surely this can't be right? Here are the errors: </p> <p>(1)The method onItemSelected(String) of type ItemListActivity must override a superclass method ItemListActivity.java /Master Detail/src/com/example/master/detail line 39 Java Problem</p> <p>(2)The method onItemSelected(String) of type new ItemListFragment.Callbacks(){} must override a superclass method ItemListFragment.java /Master Detail/src/com/example/master/detail line 27 Java Problem</p> <p>I'd like to try and use the master detail forms so I can understand more advanced android layouts. Could anyone point me into a better direction with that as well? Thanks!</p>
java android
[1, 4]
4,785,732
4,785,733
How to get a specific frame within a frameset using jQuery?
<p>My main page:</p> <pre><code>&lt;FRAMESET&gt; &lt;FRAMESET &gt; &lt;FRAME name="menu" src=&lt;%=menu%&gt;&gt; &lt;FRAME marginWidth="0" src=&lt;%=bottom%&gt; &gt; &lt;/FRAMESET&gt; &lt;FRAMESET&gt; &lt;FRAME src=&lt;%=title%&gt;&gt; &lt;FRAME name="main"src=&lt;%=main%&gt;&gt; &lt;/FRAMESET&gt; </code></pre> <p></p> <p>I want to get the menu frame using the <code>name attribute</code> selector instead of the <code>frames[index]</code>, so I want to replace the static selector:</p> <p><code>window.parent.frames[0].document</code></p> <p>for something with jQuery using name attr.</p>
javascript jquery
[3, 5]
3,052,844
3,052,845
Jquery toggle issue
<p>i just made a jquery work to hide and show a link on a image. the 'a' seated as position absolute on image.</p> <p>To do this, i made this code :</p> <pre><code>$(document).ready(function(){ var caseStudySlider = $('div.case-study-slider img'); caseStudySlider.bind('mouseover',function(e){ $(e.target).closest("a").toggle(); }) }) </code></pre> <p>and this this my HTML code as well on the page :</p> <pre><code>&lt;div class="case-study-slider"&gt; &lt;span class="slider-player"&gt;&lt;a href="case-study-page-b.html"&gt;&lt;/a&gt;&lt;/span&gt; &lt;img height="270" width="702" alt="slider" src="images/slide-space-holder-type2.jpg" /&gt; &lt;/div&gt; </code></pre> <p>But it's not work. any one help me that, what this the issue with my code?</p> <p>Thanks on Advance!.</p>
javascript jquery
[3, 5]
5,925,047
5,925,048
calculating the average of field entries
<p>I am trying to calculate the average of some int entries in a database table using a basic ado.net procedure but get an error that states that the cast is not valid.</p> <pre><code>try { int average; string conn = @"Provider=Microsoft.Jet.OleDb.4.0; Data Source=BookRateInitial.mdb"; OleDbConnection connection = new OleDbConnection(conn); OleDbCommand cmd = connection.CreateCommand(); cmd.CommandText = @"SELECT AVG(rating) FROM bookRated WHERE title = 'the informers'"; connection.Open(); average = (int)cmd.ExecuteScalar(); Console.WriteLine("The average is thus {0}", average); connection.Close(); } catch (Exception e) { Console.WriteLine(e.Message); } </code></pre> <p>Is this the correct way of calculating the average of a set of entries in a database?.</p> <p>Kind regards</p>
c# asp.net
[0, 9]
251,673
251,674
jQuery change append onClick
<p>I have the following jQuery code which locates the <code>ul</code> element on the page, hides any <code>li</code> items after the third item within that <code>ul</code> element and appends a <em>"Show More!"</em> text link which reveals/toggles the hidden list items when clicked.</p> <pre><code>$('ul') .find('li:gt(2)') .hide() .end() .append( $('&lt;li&gt;Show More!&lt;/li&gt;').click( function(){ $(this).siblings().toggle(500); }) ); </code></pre> <p><strong>An example of the script's functionality: <a href="http://jsfiddle.net/vf6j5/" rel="nofollow">http://jsfiddle.net/vf6j5/</a></strong></p> <p>Here's what I'd like the script to do: When the hidden elements are revealed after <em>"Show More!"</em> is clicked, I'd like the <em>"Show More!"</em> text to be replaced with <em>"Show Less!"</em>. Doing this would be much more user friendly and make a bit more sense.</p> <p>Any ideas on how this could be accomplished?</p>
javascript jquery
[3, 5]
2,505,519
2,505,520
Formatting text in dynamicaly created textboxes
<p>I have jquery that generates textareas with different id's. Now i need to make some buttons that will format text inside that textareas. For example: when user clicks in certain textarea, enter text, and click "bold" button, only text inside of that textarea will become bold (in other will be normal). I did manage to make something like this with JS, but it was too primitive (text was formated in all of textboxes) :( Here is some sample code for this:</p> <pre><code>&lt;button id="bold"&gt;B&lt;/button&gt; &lt;textarea id="ta_1"&gt;Some test text&lt;/textarea&gt; &lt;textarea id="ta_2"&gt;Some test text&lt;/textarea&gt; </code></pre> <p>What i want to say: one button, multiply text boxes. Entering text in ta_1 and clicking bold, should bold only text in that txtarea. Additional info: all id's starting with same word, just different number at the end.</p> <p>I feel there is some simple solution, just cant figure it out :D</p>
javascript jquery
[3, 5]
1,267,924
1,267,925
From jquery back to JavaScript
<p>I need a pure JavaScript equivalent of this Jquery code: because the use of libraries isnt allowed in my current project,</p> <p>File handler.js</p> <pre><code>$(document).ready(function(){ $("#some_button").click(function(){ alert('ok. works'); }); }); </code></pre> <p>File index.html</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="handler.js"&gt;&lt;/script&gt; &lt;head&gt; &lt;body&gt; &lt;button id="some_button"&gt;Btn&lt;/button&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
1,997,186
1,997,187
How can I start Google Android from scratch
<p>I am new to Google Android, how do i start with it from scratch along with all the requirements do i need to get a program running.</p>
java android
[1, 4]
4,115,940
4,115,941
jQuery, Uncaught TypeError
<p>I have some javascript code on my webpage that is loading some divs onto the page. I also want to add onmouseenter, and onmouseleave event handlers to each div. I am using jquery to add these handlers, but i get the error:</p> <blockquote> <p>"Property '$' of object [object DOMWindow] is not a function"</p> </blockquote> <p>My code looks like this, it is in a for loop:</p> <pre><code>var newItem = document.createElement('div'); newItem.innerHTML = results[i]; newItem.setAttribute("id", "resultDiv_" + i.toString()); dropDown.appendChild(newItem); //Error on next line... $("resultDiv_" + i.toString()).bind("mouseenter", function() { $("resultDiv_" + i.toString()).css({ 'background-color': 'blue' }); }); </code></pre> <p>Does anyone have any ideas why i am getting this error, or even what the error means?</p>
javascript jquery
[3, 5]
99,329
99,330
pyfacebook and javascript query
<p>I'm using pyfacebook on the backend and javascript on the client side. Now if I want to pass a variable to the javascript from pyfacebook. how would I go about doing that, any ideas?</p>
javascript python
[3, 7]
2,639,813
2,639,814
what do u mean by bluetooth chat in android
<pre><code>private static final int REQUEST_CONNECT_DEVICE = 1; private static final int REQUEST_ENABLE_BT = 2; public static final int MESSAGE_STATE_CHANGE = 1; public static final int MESSAGE_DEVICE_NAME = 4; public static final int MESSAGE_TOAST = 5; public static final String DEVICE_NAME = "device_name"; public static final String TOAST = "toast"; protected static final String TAG = null; protected static final boolean D = false; protected static final int MESSAGE_READ = 3; protected static final int MESSAGE_WRITE = 2; </code></pre> <p>what do u mean by all these above statement because i am a beginer in the android </p>
java android
[1, 4]
2,048,810
2,048,811
using jquery/javascript to get node text
<p>i am doing this:</p> <pre><code> if ($(this).prop('checked')) { var checkText = $(this).next('a').text(); </code></pre> <p>to get the node text of one of the nodes in my treeview</p> <p>here is the HTML source:</p> <pre><code>&lt;a class="TreeView1_0" href="javascript:__doPostBack('TreeView1','sPreAnalytical\\Labels\\GoodStuff')" onclick="TreeView_SelectNode(TreeView1_Data, this,'TreeView1t2');" id="TreeView1t2"&gt;Specimen collection device mislabeled/unlabeled by practice&lt;/a&gt; </code></pre> <p>the jquery line above returns:</p> <pre><code>Specimen collection device mislabeled/unlabeled by practice </code></pre> <p>however i need to return:</p> <pre><code>GoodStuff </code></pre> <p>how do i do it?</p> <p>please note that i do not always have <code>\\Labels\\</code> in the text</p> <p>what DOES stay constant is this: <code>href="javascript:__doPostBack('</code></p> <p>if it's much simpler i am even happy returning this:</p> <pre><code>javascript:__doPostBack('TreeView1','sPreAnalytical\\Labels\\GoodStuff') </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
493,243
493,244
Creating multiple objects using for loop
<p>What I want is to create multiple view in for loop example</p> <pre><code>for(int i =1; i&lt;5; i++){ GridView view = new Gridview(this); } </code></pre> <p>But It creates 5 gridview with the same name.. so in future i can't set different option to a specific gridview. How do I get, that gridivew created in a loop get view + i name</p>
java android
[1, 4]
3,976,372
3,976,373
How to resize div width with window scroll(jquery) - but only 1/3 of the divs width in the css
<p><a href="http://jsfiddle.net/95EtZ/1/" rel="nofollow">http://jsfiddle.net/95EtZ/1/</a></p> <p>There is the problem half solved in action.</p> <p>Right now it's set up with the containers width hardcoded in the javascript.</p> <p>I need the js to grab the width of the container div - resize it with window scroll. but only resize it 1/3 of the #container divs width. </p> <p>The way it's set up currently is, you have to set the script manually to the width of the div in the css. I want to be able to change the width of the div in the css and have the js grab it and only allow the user to have it resize 1/3 of it's width as they reach the very bottom of the window. </p>
javascript jquery
[3, 5]
107,278
107,279
Trying to understand js call()
<p>I am trying to understand this line of code. it's from the blueimp jquery file upload. I've extracted the part I need down this line (it populates my page with images I already have). I am unclear as to why it needs to be called this way. I understand the call() method, just not clear on this - it seems extra convoluted:</p> <pre><code>$('#fileupload').fileupload('option', 'done').call($('#fileupload'), null, {result: data.images}); </code></pre> <p>data.images is a JSON set of images. The code works, just unclear why I need to call things as they are.</p> <p>Here's the original code - made for multiple fields it looks like)</p> <p><a href="https://github.com/blueimp/jQuery-File-Upload/blob/master/js/main.js#L53" rel="nofollow">https://github.com/blueimp/jQuery-File-Upload/blob/master/js/main.js#L53</a></p>
javascript jquery
[3, 5]
2,145,387
2,145,388
How to find server control using jquery?
<p>How to find server control using jquery e.g</p> <pre><code>$(".tab1").find("&lt;%=lblTab1Heading.ClientID%&gt;"); throws exception thrown &amp; not caught </code></pre>
jquery asp.net
[5, 9]
4,631,496
4,631,497
How to add DropDownlist of all users to ListView
<p>I have a ListView control, I want to edit the InsertItem Template to include a Dropdownlist Item which contains a list of users in Membership Directory.</p> <p>I tried this:</p> <pre><code> MembershipUserCollection users = Membership.GetAllUsers(); assigned_volunteerDropDownBox.DataSource = users; assigned_volunteerDropDownBox.DataBind(); </code></pre> <p>The biggsest issue is that it says <code>assigned_volunteerDropDownBox</code> does not exist in the current context... In fact none of the TextBox items on the insert template are in the current context (is this normal)?</p> <p>How would I go about doing this? I want to be able to only allow the row to be updated with valid usernames.</p> <p>I looked at <a href="http://stackoverflow.com/questions/8906367/how-to-list-all-users-in-active-directory-in-dropdownlist-control">this</a>, but it doesn't actually contain the code to DataBind to the DropDownList item.</p>
c# asp.net
[0, 9]
2,921,057
2,921,058
how to allow a form submit only when fields are selected
<p>i have a few select fields that are dynamically created by the end user and the only way to control them is by adding a class of attribute to it so that all the selects that are displayed use this class name. What i want is when the user presses buy now the form is only submitted when all select fields have a value as in selected. if their not selected or one of htem is not selected the form returns false and does accordingly.</p> <p>problem is in the if statement where i check is this.val is empty and if it is to return false it does not work. when i press submit the page gets processed. what am i doing wrong?</p> <p>thanks</p> <p>this is my code.</p> <pre><code>$(document).ready(function() { $(".btnbuy").click(function() { $(".attribute").each(function() { if($(this).val() == '') { $(this).css('border','2px solid red'); return false; } else { return true; } }); }); }); </code></pre>
javascript jquery
[3, 5]
3,458,003
3,458,004
Android BufferedReader instance cannot be resolved at finally trying to close it
<p>I have omitted irrelevant parts of the code:</p> <pre><code>[...] try { URL url = new URL(updateUrl); BufferedReader input = new BufferedReader(new InputStreamReader(url.openStream())); [...] } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { } finally { input.close(); } [...] </code></pre> <p>The problem is that on the finally "input.close()" Eclipse says that "input cannot be resolved".</p> <p>I think it may be an scope problem, but I have seen code from other guys and it has usually this same form, so I do not know why it is not working here.</p> <p>Any hints?</p> <p>Thanks a lot in advance,</p>
java android
[1, 4]
4,573,077
4,573,078
C#, ASP.net application which calls executable to create output file
<p>We are developing a web application in ASP.Net and C#. The requirement here is to interact with a third party exe which is developed in Fortran77. This third party exe produces an output file after being provided with some inputs and shuts down.In windows desktop single user application this is easily possible by using System.Diagnostics.Process and the events provided therein. But in web there will be multi-user environment, and many calls will be made to this exe. What are the best possible ways to handle such an exe in web application? </p> <ol> <li>Is it fine if we invoke exe on each user request as the exe shuts down after generating output file? Or</li> <li>Is it possible to use windows service? Or</li> <li>Any other approach?</li> </ol> <p>Thanks in advance. -Prasad</p>
c# asp.net
[0, 9]
3,889,584
3,889,585
Deserialize javascript objects to generic list in c# handler
<p>Im creating some javascript items in a loop</p> <pre><code>var licenseList = {}; $($licenses).each(function (index) { var license = {}; var editedValues = {}; license.PRODUCT_KEY = $(this).parent('div.licensewrapper').data('productkey'); $(this).find('input:text').each(function (i, val) { if ($(val).attr('data-default-value') != $(val).val() &amp;&amp; $(val).val() &gt; 0 &amp;&amp; $(val).data('isValid') != false) { var pogKey = $(val).data('product_option_group_key'); var editedValue = $(val).val(); editedValues[pogKey] = editedValue; license.editedValues = editedValues; } }); //licenseList[index] = license; //liceneList.push(license); //if array... }); </code></pre> <p>I've commented out my current solutions. But i dont think any of the two are equal to a generic list when derelializing them in c#. Whats the corrent way to do it in this case? Thanks</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
1,008,916
1,008,917
Android SDK: NSDictionary dictionary with objectsForKeys Equivalent
<p>I have the following objective-c code </p> <pre><code> NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:names forKeys:dates]; </code></pre> <p>The names and dates are NSMutableArrays</p> <p>What is the java equivalent of this code?</p> <p>Thanks</p>
java android
[1, 4]
2,089,176
2,089,177
Javascript OR jQuery display random element on page refresh
<p>I'm working on a website for my custom themes on a blogging site. I want to have a review section, but I only want to have one review per page refresh. I was wondering if there is any way to write a script with jQuery or javascript (I'm not sure which one) to pick a random element from an array (All of the reviews will have a seperate element, each person having a different div ID with a different review) and display that element inside a div called #reviews, and hide the other elements? It sounds very confusing, but basically I need either jQuery or javascript to pick a review and put it in the review section. If anyone could help it'd be greatly appreciated.</p>
javascript jquery
[3, 5]
3,932,396
3,932,397
using the jNotify plugin for jquery
<p>I am currently using <a href="http://www.givainc.com/labs/jnotify_jquery_plugin.htm" rel="nofollow">jNotify</a> to display my notifications. The problem is that all notifications seem to float over the website, instead of pushing the website down. I have looked at the above link and I can seen an option:</p> <pre><code>classContainer: "jnotify-container" // className to use for the outer most container--this is where all the </code></pre> <p>How do I make use of this and will it push the website content down while the notification is being displayed?</p>
javascript jquery
[3, 5]
5,926,988
5,926,989
how to bundle javascript files into Java application?
<p>Javascript is executed by Java application. However, something like Jquery library is really too long to fit into a String variable. I am able to read jquery.js from a file but not sure how to package it inside the .jar file.</p>
java javascript jquery
[1, 3, 5]
521,518
521,519
How can i restart toggle when another button is clicked?
<p>i have 2 buttons each of them has toggle function with 2 function inside the toggle. i have a problem that i want the toggle to be restarted if the user didn't click on the same button twice for example </p> <p>if the user clicks on X first function will fires if he clicks on Y and then re-click on X the first function will fires again. but if he clicks on X first function will fires and he clicks on X again then the second function will fires.</p> <pre><code>$('x').toggle( function(){ //something }, function(){ //something } } $('y').toggle( function(){ //something }, function(){ //something } } </code></pre> <p>please tell me your opinions and if there is a solution better than toggle ... please tell me </p>
javascript jquery
[3, 5]
5,479,319
5,479,320
How to provide a UI to generate the questions and answers
<p>I am using <a href="http://code.google.com/p/jquizme" rel="nofollow">Jquizme</a> plugin. Is there any way to provide a UI to create questions and answers instead of changing the code every time to generate the quiz, so that a non web programmer can create a quiz.</p> <p>Is there any way to save the results, statics of the quiz in to database </p>
javascript jquery
[3, 5]
2,619,211
2,619,212
Where to put JavaScript configuration functions?
<p>What is the general developer opinion on including javascript code on the file instead of including it on the script tag.</p> <p>So we all agree that jquery needs to be included with a script file, like below:</p> <pre><code> &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>My question is, in order to get functions on a page that is not on all pages of a site. Do we include the functions like below in the same page or in a global include file like above called mysite.js.</p> <pre><code>$(document).ready(function(){ $(".clickme").click(function(event){ alert("Thanks for visiting!"); }); }); </code></pre> <p>ok. So the question is: if the code above is going to be called in every class="clickme" on a specific pages, and you have the ability to call it either from an include separate file called mysite.js or in the content of the page. Which way will you go?</p> <p><hr /></p> <p>Arguments are: </p> <ul> <li><p>If you include it on the page you will only call it from those specific pages that the js functionality is needed.</p></li> <li><p>Or you include it as a file, which the browser cached, but then jquery will have to spend x ms to know that that function is not trigger on a page without "clickme" class in it.</p></li> </ul> <p><hr /></p> <p>EDIT 1: Ok. One point that I want to make sure people address is what is the effect of having the document.ready function called things that does not exist in the page, will that trigger any type of delay on the browser? Is that a significant impact?</p>
javascript jquery
[3, 5]
5,378,673
5,378,674
Quotes problem when passing value to Javascript
<p>I am using like</p> <pre><code>$myPage .= '&lt;td&gt;&lt;a href=\'javascript:editProduct(' .$row['id'] .',"' .$row['name'] .'")\'&gt;Edit&lt;/a&gt;&lt;/td&gt;'; </code></pre> <p>where <code>$row['name']</code> has quotes in its value. it breaks. how do i solve the issue both from php side and js side...</p> <p><code>$row['name']</code> is value from DB. and it will have value like <code>pradeep's</code> and <code>pradeep"s</code> also</p> <p>i used like</p> <pre><code>$myPage .= '&lt;td&gt;&lt;a href=\'javascript:editProduct('.addslashes($row['id']).',"'.addslashes($row['name']).'")\'&gt;Edit&lt;/a&gt;&lt;/td&gt;'; </code></pre> <p>it solves the issue of double quotes. but when i have single quotes in value the javascrit link looks like</p> <pre><code>javascript:editProduct(28,"pradeep\ </code></pre> <p>it actually breaks..</p> <p>And how do i strip down the slashes added by addslashes in javascript..</p> <p>UPDATE - FINAL CODE</p> <pre><code>$myPage .= '&lt;td&gt;&lt;a href=\'javascript:editProduct('.$row['id'].',"'.htmlentities($row['name'],ENT_QUOTES).'")\'&gt;Edit&lt;/a&gt;&lt;/td&gt;'; </code></pre> <p>and js looks like </p> <pre><code>function editProduct(id,name){ alert(name); } </code></pre> <p>can any one solve my issues</p>
php javascript
[2, 3]
5,352,672
5,352,673
How to fetch data from database in jquery file
<p>I have a js file that is using an image array . in that array there is name of images that are to be used on client side page. I want that image name from database. I am using asp.net technology. Please help me out.</p>
javascript jquery asp.net
[3, 5, 9]
3,304,978
3,304,979
What is the use of JavaScript?
<p>Why do I need script on an aspx page?</p>
asp.net javascript
[9, 3]
3,030,273
3,030,274
Loop through a php page until session reaches a certain value
<p>I am currently developing a web based examination. all the question and answers are save on mysql database. I started the system by retrieving and displaying one question together with the answers which is on radio type. i used a session $_SESSION['questionno']=1; to indicate on what question number will be retrieved and displayed. what i want to do next is that whenever the user clicks the next button it will forward informations to result.php and then the said page will add into the session the answer that was retrieved from the previous page at the same time result.php will increment the $_SESSION['questionno']; and then use</p> <pre><code>echo ("&lt;SCRIPT LANGUAGE='JavaScript'&gt; window.location='/OE/index.php'; &lt;/SCRIPT&gt;"); </code></pre> <p>to go back to the questions page (index.php) but this time question number two will be displayed because of the incrementation that happened in result.php.</p> <p>after a series of loops and the user reaches the last question a tally page will then appear.</p>
php javascript
[2, 3]
2,411,369
2,411,370
How can I highlight paragraphs from text input in jquery
<p>I'm starting to learn <code>jQuery</code> today. I'm currently on 24th tutorial <a href="http://www.youtube.com/watch?v=jIZFHjkUCrs&amp;feature=BFa&amp;list=PL6B08BAA57B5C7810" rel="nofollow">PHPachademy</a>. I'm having a lot of problems getting this particular tutorial to work correctly. I'm pretty sure it's a semantic error >_&lt;;;</p> <p>Heres an <a href="http://jsfiddle.net/Hg72b/6/" rel="nofollow">Attempt JSfiddles</a></p> <p>Lastly could someone explain why there this line to me? </p> <pre><code>('" + search_name + "') </code></pre> <p>why are there so many <code>+</code>'s and <code>'"</code> in the line? </p>
javascript jquery
[3, 5]
559,732
559,733
jQuery post inside another javascript function
<p>I have some code like:</p> <pre><code>function duplicatecheck(value, colname) { var invoiceLineId = $('tr[editable="1"]').attr('id'); var invoiceLine = { InvoiceLineId: invoiceLineId, InvoiceId: invoiceId, ActivityId: value }; $.post('/Invoice/InvoiceLineExistsForThisActivity/', invoiceLine, function (data) { if(data == true) { return[ false, "An invoice line already exists with this activity"] } else { return[ true, ""]; } }); } </code></pre> <p>The problem is that <code>duplicatecheck</code> is supposed to return a value. The value is inside the <code>post</code> callback function. So <code>duplicatecheck</code> runs and doesn't return anything because <code>post</code> is asynchronous and <code>duplicatecheck</code> finishes before the callback has even run.</p> <p>Is there a way to make <code>duplicatecheck</code> wait until the callback has finished and return what the callback returns.</p> <p>Am I going about this completely the wrong way and should be doing something else?</p>
javascript jquery
[3, 5]
3,420,656
3,420,657
constructing dynamic divs in jquery and javascript
<p>Hmmm All the answers I've seen here suggest that this should work, but...</p> <p>Is...</p> <pre><code> var qnDivName = "qnDiv" + i; var currentQnDiv = document.createElement("div"); var qnDivId = document.createAttribute("id"); qnDivId.nodeValue = qnDivName; currentQnDiv.setAttributeNode(qnDivId); currentQnDiv.className = "questionContainer"; </code></pre> <p>equivalent to...</p> <pre><code> var currentQnDiv = $("&lt;div/&gt;", { "class": "questionContainer", id: "qnDiv" + i }); alert("qndiv class: " + currentQnDiv.className); </code></pre> <p>?</p> <p>The alert gives 'undefined'. The 'i' is from a for loop. I'm dynamically creating divs to attach to a document further down the page...</p> <pre><code> testDiv.appendChild(currentQnDiv); } //end for loop </code></pre> <p>the ordinary js works, but the jQuery doesn't. I have other jQuery that works in a calling function, so...</p> <p>Any ideas?</p>
javascript jquery
[3, 5]
4,190,631
4,190,632
Stay right there after reloading
<p>I've created an Edit button in ASP.NET (C#). When this button is clicked, it will change to a Save button and a text field will appear for editing.</p> <p>The problem is this page is pretty long. If I hit an Edit button at the end of the page, it will be reloaded and the top page will show up. Then, I have to scroll the page down to the bottom to edit something.</p> <p>Is there anyway to get the page stay right there when a Edit button is clicked?</p> <p>Thank you!</p>
javascript asp.net
[3, 9]
6,027,903
6,027,904
Accessing the array with dynamic keys
<p>I have an array (name array) which is smarty assigned and I want to access the value of every element of an array. I know we need to use eval here, but not sure how to use it?</p> <pre><code>var loop = 'true' , text , i=0; while(loop == 'true') { text = ~$array[i] ;//ERROR :-( i++; if(text=='') loop = 'false'; } </code></pre>
javascript jquery
[3, 5]
5,092,597
5,092,598
MenuItemClick Event Not firing
<p>I am using asp:menu.In this asp menu,on clicking menu item,I want to get the menuitem,and its parent.I tried to use menuitemclick event.But menuitemclick event is not firing on clicking menu item.Can any body help?</p>
c# asp.net
[0, 9]
3,698,535
3,698,536
Onsubmit URL Redirection with jquery
<p>I am looking for best way to do Onsubmit URL Redirection.</p> <p>Currently I have form like this...</p> <pre><code>&lt;form action="dologin.php?" method="post" id="frmlogin"&gt; &lt;input type="hidden" value="something" /&gt; &lt;input type="submit" value="go" /&gt; </code></pre> <p>Currently this <strong>dologin.php</strong> is directing me to <strong>clientarea.php</strong></p> <p>I cant make any changes in <strong>dologin.php</strong> as it is encoded.</p> <p>I want me to redirect to <strong>clientdetails.php</strong> as soon as button is clicked.</p> <p>How can I achieve ?</p> <p><strong>Thanks</strong></p> <p><strong>UPDATE</strong></p> <p>Currently How I do this....</p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; function redirect() { window.location.href = '/clientarea.php?action=details'; } &lt;/script&gt; &lt;form action="dologin.php?" onsubmit="setTimeout('redirect()', 1000);" method="post" id="frmlogin"&gt; &lt;input type="hidden" value="something" /&gt; &lt;input type="submit" value="go" /&gt; </code></pre> <p>This Do my purpose, Even if login credentials fails it stick to login page with defining errors.</p> <p>I was just looking for if there is any better/another way of doing it.</p>
javascript jquery
[3, 5]
326,352
326,353
Naming ID in Android Applications
<p>If you are developing Android application, you will encounter such a id naming in xml files of view and layouts : </p> <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:id="@+id/new_game" android:icon="@drawable/ic_new_game" android:title="@string/new_game" /&gt; &lt;item android:id="@+id/quit" android:icon="@drawable/ic_quit" android:title="@string/quit" /&gt; &lt;/menu&gt; </code></pre> <p>and I am really wondering why such naming is applied to ids. It is because of Linux? What kinda meaning this naming --<code>@+id/...</code>--has?</p> <p>When I am looking at <code>android:icon</code> attribute I can interpret that it means <code>ic_new_game</code> is located under drawable folder and <code>@</code> means "located at" or I just assume that.</p> <p>But naming id attributes are kinda different because they also have <code>+</code> sign. Can somebody help me understand this convention?</p> <p>Thanks.</p>
java android
[1, 4]
4,218,469
4,218,470
getting the entire file code on the page while using include/ include_once/ require_once
<p>While using include / include_once / require_once of the form <code>include 'filename.js'; </code></p> <p>I get the entire code of the file displaying on the page. What am i doing wrong?</p>
php jquery
[2, 5]
4,349,582
4,349,583
Different values when ANDING and assigned uints to a char array in C++ and C#
<p>I have a very simple problem that is giving me a really big headache in that I am port a bit of code from C++ into C# and for a very simple operation I am getting totally different results:-</p> <p>C++</p> <pre><code>char OutBuff[25]; int i; unsigned int SumCheck = 46840; OutBuff[i++] = SumCheck &amp; 0xFF; //these 2 ANDED make 248 </code></pre> <p>The value written to the char array is -8</p> <p>C#</p> <pre><code>char[] OutBuff = new char[25]; int i; uint SumCheck = 46840; OutBuff[i++] = (char)(sumCheck &amp; 0xFF); //these 2 ANDED also make 248 </code></pre> <p>The value written to the char array is 248.</p> <p>Interestingly they are both the same characters, so this may be something to do with the format of a char array in C++ and C# - but ultimately I would be grateful if someone could give me a definitive answer.</p> <p>Thanks in advance for any help.</p> <p>David</p>
c# c++
[0, 6]
2,421,629
2,421,630
Efficient JQuery login script
<p>I have been able to create a login form using 2 different methods.</p> <p>1) Use $.POST to send password to server PHP script which returns a success true flag. The form then needs to be submitted a second time so PHP 'header' can be called to load a new page (this has the ajax advantage that an error message can be faded in if success flag returns false).</p> <p>2) Use JQuery Submit allowing the server PHP 'header' to redirect to a new page on first submission. However if the password is incorrect there is no way to pick up a returned value and fade in an error message - a complete new page needs to be loaded.</p> <p>Is there anyway of getting the best of both worlds, i.e. $.POST function or PHP 'header' can be made to direct to a new page on first submission OR Submit can pick up a return value?</p>
php jquery
[2, 5]
958,800
958,801
How to clear the textbox value after 5 sec using JQuery?
<p>I have tried this :</p> <pre><code> &lt;script type="text/javascript"&gt; $(function() { $("#button").click( function() { alert('button clicked'); // this is calling setTimeout(function(){ alert('setTimeout'); // this is not calling document.getElementById('clearTxt').value = ""; }, 9000); } ); }); &lt;/script&gt; </code></pre> <p>my HTML code:</p> <pre><code> &lt;form&gt; &lt;input type="text" id="clearTxt"/&gt; &lt;input type="submit" value="Search" id="button" /&gt; &lt;/form&gt; </code></pre> <p>But this code is not working.Please help me to solve this issue.</p>
javascript jquery
[3, 5]
4,231,166
4,231,167
jquery show() not working
<p>im making a todo list app in php and im using unordered lists to print them out.What I want is to display the titles of todo lists to be displayed first and their contents hidden initially but displayed later via the click event in jQuery.This is what i have tried so far...</p> <pre><code>&lt;?php include_once "connect_to_mysql.php"; $name = $_POST['name']; $todo = $_POST['todo']; $sql = mysql_query("INSERT INTO todo (todo,name) VALUES('$todo','$name')") or die (mysql_error()); $sql2 = mysql_query("SELECT DISTINCT name FROM todo"); $todofeed .= ' &lt;ul id = "nav"&gt;'; while($row = mysql_fetch_array($sql2)) { $name1 = $row["name"]; $todofeed.='&lt;li class="title"&gt;&lt;a href="#"&gt;' . $name1 . '&lt;/a&gt;&lt;/li&gt;'; $sql3 = mysql_query("SELECT id, todo FROM todo WHERE name='$name1' "); while($row = mysql_fetch_array($sql3)) {$todo1 = $row["todo"]; $todofeed.='&lt;ul&gt; &lt;li id="items"&gt;' . $todo1 . '&lt;/li&gt; &lt;/ul&gt;';}} $todofeed .= '&lt;/ul&gt;'; print "$todofeed"; ?&gt; &lt;style type="text/css"&gt; li#items { display:none; } &lt;/style&gt; &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('ul#nav li#title').click(function() { $('li#items').css('display' , 'visible'); }); }); &lt;/script&gt; </code></pre> <p>any way to fix this?</p>
php jquery
[2, 5]
3,676,690
3,676,691
How to detect if MediaRecorder is used by another application?
<p>I'm trying to detect if MediaRecorder is used by other application, to stop my recorder and continue for later use. I saw Androids Voice recorder app, it does what exactly I'm talking about, but HOW ? Thank you.</p>
java android
[1, 4]
2,456,471
2,456,472
How to make a readonly text box editable on mouse-over using J query
<p>I have a read-only text-box with text in it. How to make it editable on mouse-over using J query ?</p>
asp.net jquery
[9, 5]
4,371,079
4,371,080
C++ Equivalent java.util.concurrent.ArrayBlockingQueue
<p>May I know is there any C++ equivalent class, to Java java.util.concurrent.ArrayBlockingQueue</p> <p><a href="http://download.java.net/jdk7/docs/api/java/util/concurrent/ArrayBlockingQueue.html" rel="nofollow">http://download.java.net/jdk7/docs/api/java/util/concurrent/ArrayBlockingQueue.html</a></p>
java c++
[1, 6]
57,036
57,037
This difference
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1051782/jquery-this-vs-this">jQuery $(this) vs this</a> </p> </blockquote> <p>This code in this <a href="http://jqueryfordesigners.com/jquery-look-tim-van-damme/" rel="nofollow">video Tutorial</a></p> <p>in a Very useful blog <a href="http://jqueryfordesigners.com/" rel="nofollow">jquery for designers</a></p> <pre><code>$('.navigation').each(function () { var $links = $('a',this); $links.click(function () { var $link = $(this), link = this; if ($link.is('.selected')) { return; } $links.removeClass('selected'); $link.addClass('selected') }); }); </code></pre> <p>What is the difference between <code>$(this)</code> and <code>this</code>?</p> <p>Please explain the simple difference in coding.</p>
javascript jquery
[3, 5]
4,992,772
4,992,773
How to PHP echo when using multiple quotes
<p>How should I quote this:</p> <pre><code>&lt;tr onclick="$.colorbox({href:'information1.html'});"&gt; </code></pre> <p>When put in an <code>echo " ";</code> ?</p> <p>I have tried this:</p> <pre><code>echo "&lt;tr onclick='$.colorbox({href:'information1.html'});'&gt;"; </code></pre> <p>Which shows a Jquery error.</p> <p>And I tried this:</p> <pre><code>echo "&lt;tr onclick="$.colorbox({href:'information1.html'});"&gt;"; </code></pre> <p>Which shows a PHP error.</p> <p>Any workarounds? Thanks</p>
php jquery
[2, 5]
1,626,930
1,626,931
Add Javascript into a DOM
<p>Have any advice. Why I can not add the javascript into a DOM?</p> <pre><code>var strScript = "&lt;script type='text/javascript'&gt;&lt;/script&gt;"; $("#someElement").append(strScript); </code></pre>
javascript jquery
[3, 5]
3,413,849
3,413,850
Execute automatically in a loop a function
<p>I have this slider where the gotoslide function changes the slide when the navigation links are pressed. <a href="http://jsfiddle.net/AHYVr/" rel="nofollow">http://jsfiddle.net/AHYVr/</a></p> <p>What is the way to make a loop where the gotoslide function autoruns from 0 to lastone and then goes back to start?</p> <pre><code>var num_slides; var slides; var current; var sa_auto = true; jQuery(document).ready(function() { init_slide() }); function init_slide(){ slides = jQuery('.slides_container div'); num_slides = (slides).length; pagination = '&lt;ul class="pagination"&gt;'; var i=1; jQuery.each(slides, function() { pagination += '&lt;li&gt;&lt;a href="javascript:gotoslide('+i+')"&gt;'+i+'&lt;/a&gt;&lt;/li&gt;'; i++; }); pagination += '&lt;/ul&gt;'; jQuery(pagination).insertBefore('#slides'); } function gotoslide(n){ sa_auto = false; showslide(n); } function showslide(n){ current = n; var leftpos = (1-n)*700; pagination = jQuery('.pagination li') pagination.removeClass('current'); jQuery(pagination[n-1]).addClass("current"); slides.removeClass('current'); jQuery(slides[n-1]).addClass("current"); jQuery('.slides_container').animate({ left: leftpos }, 2000); } </code></pre> <p>I've tried to make a function that increases the gotoslide parameter by 1 and then use it with a setInterval, but it fails. This is the code:</p> <pre><code> var t; function time (){ if ( j &lt; num_slides ) { show_slide(j++); } }; t= setInterval(time, 2000); clearInterval(t); </code></pre>
javascript jquery
[3, 5]