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
4,651,661
4,651,662
Dynamic data input for pie chart
<p>I am getting values from the database to javascript array. Javascript code which I am using to create pie chart with static value is as follows.</p> <pre><code> $(function () { $('#container').highcharts({ chart: { type: 'pie' }, plotOptions: { pie: { dataLabels: { distance: -30, color: 'white' } } }, series: [{ data: [ [test[0], 44.2], [test[1], 26.6], [test[2], 20], [test[3], 3.1], [test[4], 5.4] ] }] }); }); </code></pre> <p>I want my data to be dynamic like </p> <pre><code> series: [{ data: [ for (var i=0;i&lt;count;i++) { [test[i], 44.2] } ] }] </code></pre> <p>Any idea?</p>
javascript jquery
[3, 5]
3,454,014
3,454,015
How to show an element in Jquery after 1 seconds only if the mouse is still over the element?
<p>I'm trying to create a hover-menu inside a gridview like the one of Gmail when you put the mouse over the names in the chatlist. </p> <p>How to show an element in Jquery after 1-2 seconds <strong>only if the mouse is still over the element</strong>?</p> <p>The following is not working properly because if i just move the mouse throughout the list, all the elements will show up (even though with a delay of 1 sec.)</p> <pre><code> $('.label, .popup').hover(function(e) { setTimeout(function() { $(e.target).closest("tr").find(".popup").show(); }, 1000); }, function(e) { setTimeout(function() { $(e.target).closest("tr").find(".popup").hide(); }, 1000); }); &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID="label1" CssClass="label" runat="server" Text='&lt;%# Eval("Column1") %&gt;'&gt;&lt;/asp:Label&gt; &lt;asp:Panel runat="server" ID="popup" CssClass="popup" Style="display: none; position: absolute; margin-left: 60px; width: 250px;"&gt; Random text &lt;/asp:Panel&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre>
c# jquery asp.net
[0, 5, 9]
661,276
661,277
Simple javascript issue
<p>It turns out this does exactly what I want it to do. But HTML does not replace the function call with a value, which is why I got confused. The correct value IS passed into the array though. I am leaving this question here in case others have the same issue.</p> <p>I have some javascript:</p> <pre><code>&lt;script type="text/javascript"&gt; var $SAT = $SAT || []; $SAT.push(['setContent','subtype','sub']); $SAT.push(['setUser', '1234']); &lt;/script&gt; </code></pre> <p>but I want to replace 'sub' with a function call to retrieve the value by other means, like so:</p> <pre><code>&lt;script type="text/javascript"&gt; function getValue() { return 'Some Value'; } var $SAT = $SAT || []; $SAT.push(['setContent','subtype',getValue()]); $SAT.push(['setUser', '1234']); &lt;/script&gt; </code></pre> <p>however the resulting code does not replace the getValue() function call with 'Some Value' as I would have expected. Does anybody know why, and what I need to do to fix this?</p> <p>Much appreciated!</p>
javascript jquery
[3, 5]
2,563,680
2,563,681
Executing method from object, where method name is passed as string?
<p>I'd like to know if I have a function defined as:</p> <pre><code>void executeFunc(String funcName) </code></pre> <p>can I somehow execute MyObject.funcName();?</p> <p>What I'm trying to do is have one Class that handles all calls to a server and they return XML data back, so I'd like to use the one AsyncTask to handle the 15 or so different types of calls.</p> <p>Thanks!</p>
java android
[1, 4]
4,130,721
4,130,722
having a lookup form in asp?
<p>OK. Normal winform thing that I do all the time but now in asp.net. You have a browse button on Form A and you open a new form B. For example you have user click on a browse button to select list of friends. User clicks on the button, picks one or more friends and then presses select. you then add them to the original forms grid.</p> <p>Same idea using asp.net ( 2010 version using windows 7 IE browser). How do I do it? I have a button. User clicks on the button a new web page opens. User selects what she wants and then presses select. There is where i am stuck. I would like to call a delegate in the original form which displayed the popup so that it knows which session variable to use to get the data. How do I do this?</p>
c# asp.net
[0, 9]
709,087
709,088
what's type for data in success: function(data)?
<p>Here $fruit is encoded by js_encode() and send back to data in ajax. My questions is what datatype of data is(string or array)? Thanks in advance!</p> <pre><code>$.ajax({ type:"post", dataType:"json", url:"phpFile.php", success: function(data) { } }); &lt;?php $fruits = array(array("1","apple"),array("2","pear")); echo js_encode($fruits); ?&gt; </code></pre>
php jquery
[2, 5]
1,587,170
1,587,171
Detecting when user scrolls to bottom of div with jQuery
<p>I have a div box (called flux) with a variable amount of content inside. This divbox has overflow set to auto.</p> <p>Now, what I am trying to do, is, when the use scroll to the bottom of this DIV-box, load more content into the page, I know how to do this (load the content) but I don't know how to detect when the user has scrolled to the bottom of the div tag? If I wanted to do it for the entire page, I'd take .scrollTop and subtract that from .height.</p> <p>But I can't seem to do that here?</p> <p>I've tried taking .scrollTop from flux, and then wrapping all the content inside a div called inner, but if I take the innerHeight of flux it returns 564px (the div is set to 500 as height) and the height of 'innner' it returns 1064, and the scrolltop, when at the bottom of the div says 564.</p> <p>What can I do? :S</p> <p>Thanks! :)</p>
javascript jquery
[3, 5]
4,042,841
4,042,842
Add a class to an element not in the viewport due to overflow:hidden with jQuery
<p>I am trying to add either a class (with display:none) to or hide() divs that are not currently in the viewport due to the fact that I am using overflow-x:hidden. Here's a jsFiddle to hopefully better explain: <a href="http://jsfiddle.net/kendelaney_me/5e2Uz/3/" rel="nofollow">http://jsfiddle.net/kendelaney_me/5e2Uz/3/</a></p> <p>I have an unordered list where each list item contains divs that are floating left. The ul has a fixed width that is larger than the viewport with overflow-x:hidden. The problem I'm having is if you use the browser's native "find" to search for content Firefox will show a result count but you cannot see the result (since its in the hidden area), Safari and IE manually scroll over to the result which is not desired. My solution is to set all divs that are not currently in the viewport to 'display:none' and therefore hidden from the "find" results. In my application the div that contains the ul has its width set dynamically (as I have done in the jsfiddle). Any help would be greatly appreciated.</p> <p>Ken</p>
javascript jquery
[3, 5]
5,800,308
5,800,309
How to listen or poll for an event
<p>I have an Android app in which I'd like to display a fullscreen ad as soon as it becomes available. The ad network's SDK allows me to call a "ready" method to determine whether the ad is ready to display; it returns a boolean. How do I listen for this? Should I be polling this method every few seconds? What's the best Android practice to do this?</p>
java android
[1, 4]
4,981,959
4,981,960
Need help with manipulating some string
<p>ok so I have a string, let's say..</p> <pre><code>string s="My Page"; </code></pre> <p>Now I want to manipulate this string s and make it "mypage" i.e. all small letters and no spaces in between and then store this value in another string. How can I do this ?</p>
c# asp.net
[0, 9]
3,049,927
3,049,928
Remembering the current index of a paged ASP.NET gridview
<p>I have a gridview in ASP.NET. If I go to any page (obviously not the 1st page). edit a record (using a custom bound button as I have a custom appearance). When I edit the record, it does not display in the gridview so I refresh the page, to do so.</p> <p>However, refreshing the page (done via C#), means that the current index of the grid is lost. How can I retain the current index?</p> <p>I am using ASP.NET 2.0 web forms or 3.5 (not sure, need to check). But definately not MVC.</p> <p>Thanks</p>
c# asp.net
[0, 9]
3,249,082
3,249,083
window.setInterval jQuery function does not work on IE8
<pre><code>window.setInterval(function(){ $('#Notify-Bar').html('a new notification'); }, 5000); </code></pre> <p>Did not work on IE, however works fine on other major web browsers (like Chrome, Firefox, Opera)...</p>
javascript jquery
[3, 5]
2,606,328
2,606,329
RedirectFromLoginPage - The resource cannot be found error
<p>I am setting a login up in c#</p> <pre><code>if (TextBox1.Text == System.Convert.ToString(row["Username"]) &amp;&amp; (TextBox2.Text == System.Convert.ToString(row["Password"]))) System.Web.Security.FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, false); else Label1.Text = "Invalid Username/Password"; //If incorrect show this label </code></pre> <p>Once the user enters the correct details I get a page saying <code>The resource cannot be found</code> My question is where to I set the page which it should be redirected to?</p> <p>So far my web.config looks like this</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms&gt; &lt;/forms&gt; </code></pre> <p></p> <p>I am connecting to a database to get the correct details, this section all works its just the redirecting of the page.</p>
c# asp.net
[0, 9]
2,411,481
2,411,482
Get specified texts in a div, than search for them in a different div
<p>I am trying to get texts from a div, than i want to search for these titles on the same page, but in a different div. And if one of the title exist there, i want to put some text after it. I tried to do it, but i don't know what is the problem. Last time i tried it with this jquery code:</p> <pre><code>var cim = $.trim($('.hirblokk span.comments:contains("új")').parent(".hirblokk").children("h3").text()); jQuery.each(cim, function(X) { $("ul.s_hir.show li.hir a:contains(X)").find("small").append(" (Új!)"); return (this == cim.length); }); </code></pre> <p>As you can see i put the texts what i wanted to 'cim'(it is working). Than i tried (line 3) to check if one of the 'ul.s_hir.show li.hir a' contains one of the text, and if it containes, i put (append) something in the small tag (there is a small tag inside a tag : Text..)(this is not working). I tried it in more ways, but none of them worked. If i write:</p> <pre><code>$("ul.s_hir.show li.hir a:contains(a)").find("small").append(" (Új!)"); </code></pre> <p>than it will put ' (Új)' after every <em>small</em> tag when the <em>a</em> contains a character. So it looks like the problem is how i want to check if it <em>a</em> contains one of the text. Oh, and i can get more than whan text for example: 'I am new' and 'Oh, hello darling' and only one of them contains *ul.s_hir.show li.hir a*</p>
javascript jquery
[3, 5]
4,458,661
4,458,662
How should I store KEY from AES encrypt?
<p>How should I store KEY from AES encrypt?</p> <pre><code> SceAES secaes = new SceAES("pomboSenha","G567EF33WQ19PL1S",12,45,256,"SHA1","systemSCE"); </code></pre> <p>"pomboSenha" is the secretKey above.Is safe to mantain it hardcoded in a class?</p>
c# asp.net
[0, 9]
4,533,622
4,533,623
tablesorter - Don't want the Footer to sort
<p>I'm using an asp.net repeater control with tablesorter. How can i disable sorting on the footer.I have a total on the footer but i don't want sorting to apply. Thanks in Advance</p>
jquery asp.net
[5, 9]
5,129,805
5,129,806
How to save file in the droid local media store Java, Android?
<p>How can I save file in the Android local media store?</p>
java android
[1, 4]
18,053
18,054
How to become an expert in Python, PHP and Javascript?
<p>So I've been programming for about 9ish months now, and I've taught myself some Python, some PHP and some Javascript.</p> <p>I want to become better at these languages - I can hack something out, but a lot of things like OOP, using lists in the most effective ways, etc, is lost on me.</p> <p>What are the best ways to become an "expert" programmer? Does it depend on the nuances of the language, or is it more general? Is there any math I should be studying alongside it? Obviously a lot depends on what you want to do with it - so far I've mostly done small scale internal applications as well as web programming. How do I find out about good program design?</p>
php javascript python
[2, 3, 7]
4,333,331
4,333,332
AutoCompleteTextView onItemSelectedListener does not work
<p>I have AutoCompleteTextView and set onItemSelectedListener to it, which does not work. Have you any idea what is the problem? Here is my activity, I can also provite main.xml file if it is needed</p> <pre><code> package com.chidem; import android.app.Activity; import android.app.AlertDialog; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; public class ChidemActivity extends Activity implements OnItemSelectedListener{ /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String hop[]=new String[]{ "Karen","Mika","Gevor" }; AutoCompleteTextView searchHotels = (AutoCompleteTextView) findViewById(R.id.autoSearch); searchHotels.setOnItemSelectedListener(this); ArrayAdapter&lt;String&gt; adapter1 = new ArrayAdapter&lt;String&gt;( this, R.layout.list_item, hop); searchHotels.setAdapter(adapter1); } public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) { Log.d("autocomplete", "itemselected"); } public void onNothingSelected(AdapterView&lt;?&gt; arg0) { // TODO Auto-generated method stub } } </code></pre>
java android
[1, 4]
5,303,078
5,303,079
Custom KeyDown Control
<p>I am very new to ASP.NET and this is my first job and I need to perfom good. </p> <p>I am stuck on this search page where I have two text boxes. One searches by ID which is int, the second by last name. Both the searched populate a grid view. As per the requirement when the user types in last name and clicks search the grid view should populate which I got working. Now if the user stats typing in the ID Search text box the Lastname Search text box should clear as well as the grid view that had gotten populated should be hidden.</p> <p>I achieved clearing the text box by using </p> <pre><code>txtSNumberSearch.Attributes["onKeyDown"] = "clearTextBox(this.id)"; txtSNumberSearch.Attributes.Add("onKeyDown", string.Format("document.getElementById('{0}').innerText='';", txtLastNameSearch.ClientID)); txtLastNameSearch.Attributes.Add("onKeyDown", string.Format("document.getElementById('{0}').innerText='';", txtSNumberSearch.ClientID)); </code></pre> <p>But am not able to clear or hide the grid view on key down in the text box, my boss says I need to create a custom key down event handler. I do not know how to do it. Any help would be appreciated as I really need to perform at this job.</p>
c# asp.net
[0, 9]
3,052,740
3,052,741
adjust only iframe src from youtube
<p>how can I adjust the width and height for all iframe that has only youtube link</p> <pre><code>&lt;iframe width="420" height="315" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/xbGv2T456dfg3"&gt; </code></pre> <p>because I have some the uses iframe also but I only need to adjust all iframe that has a youtube link.</p> <p>css</p> <pre><code>iframe {width:560px;height:316px;} </code></pre> <p>need help on this</p>
php javascript jquery
[2, 3, 5]
5,495,229
5,495,230
use Save File Dialog in Asp.net to save directly in Client PC
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1227032/save-as-dialog-in-asp-net">save as dialog in asp.net</a> </p> </blockquote> <p>i need to use SaveFileDialog in asp.net to save TextFile in Client PC. how can i do that ? i don't want to upload to server then download. i need to save in Client Pc Directly . Is there an alternative Control in asp.net</p>
c# asp.net
[0, 9]
5,043,125
5,043,126
How do i use an asp.net variable value in javascript
<p>i have a asp.net application. It is assumed that every Bus has a android device which continuously sends its current location to wcf rest service. Now the administrator on the other side needs to monitor the current location of theses buses. I have a dropdow list from where he chooses the bus number. now i need to send this bus number to the wcf service and show the current location on the map I have no clue as to how do i do this. please help. The plotting algorithm is in javascript and i need to use the asp.net variable in java script to plot the current loacation. </p>
javascript asp.net
[3, 9]
1,819,926
1,819,927
Use variable as an argument inside function
<p>I am very bad in programming...</p> <p>I have a javascript variable</p> <pre><code>var a = 'S_QEEFCEAPU'; </code></pre> <p>Then there is another html like this</p> <pre><code>&lt;a href="#" onClick='jQuery("#youtube-player-container").tubeplayer("play","S_QEEFCEAPU")'&gt;Video 1&lt;/a&gt; </code></pre> <p>I want to use the variable name instead of the string S_QEEFCEAPU in tubeplayer function call. How can I do it?</p>
javascript jquery
[3, 5]
4,904,230
4,904,231
anticipating a click event within a while loop - jquery/javascrip
<p>I'm working on a little dice game app with javascript/jquery and the part where I run into trouble is in the following while loop. I want the user to click the button and then the body of the while loop should execute. However, with the following code, the contents of the while loop execute without waiting for the user to click each time. Is this the right way to approach what I'm trying to do?</p> <pre><code> while (dice.value != rollFirst &amp;&amp; dice.value != 7) { $("#roll").click(function() { $("#roll").unbind('click'); dice.roll(); }); </code></pre> <p>update: Based on the responses, maybe I wasn't totally clear in what I'm trying to do. For every iteration of the while loop, I want to user to click the roll button and only then do I want to continue execution of the contents of the while loop. In other words, I want the while loop to wait until the users clicks "roll" for each iteration.</p> <p>As it is right now, the logic of the program works but it doesn't wait for the user to click the roll button.</p>
javascript jquery
[3, 5]
4,029,322
4,029,323
jQuery tool plugging for dynamic controls
<p>in my application i creating a dynamic controls like ( 2 label controls in 2 tds of under 1 tr of a table doing this in .cs file). now i need to provide the tool tip for these dynamic controls what i have generated </p> <p>can any one help me out to give solution for this</p> <p>thank you</p>
asp.net jquery
[9, 5]
1,064,088
1,064,089
Overlay Image over Image
<p>I am searching for a way to overlay an image on an existing image.</p> <p>e.g:</p> <p><img src="http://i.stack.imgur.com/N0REB.gif" alt="img1"> + <img src="http://i.stack.imgur.com/OM7bj.jpg" alt="img2"></p> <p>I have found a great example over here: <a href="http://www.tjkdesign.com/articles/png_overlay_with_no_extra_markup.asp" rel="nofollow">PNG overlay using one single Image element.</a> but I have <strong>two</strong> problems with these. </p> <p><strong>First</strong> of all, I don't want the dimensions to be equal to each other. e.g (215*215 on 215*215). This is because my users would have the ability to choose where they want to put their image. (Top, left, bottom, top-right) so 8 directions.</p> <p>The <strong>second</strong> problem is that in that example, only 2 images are allowed to overlay. My users (again) will have the ability to put multiple images on top of it.</p> <p>I have a little knowledge of Javascript and PHP, so it would be great if you guys (and girls) could help me out.</p> <p>Sincerely,</p>
php javascript
[2, 3]
2,683,523
2,683,524
Picking a server control depending on environment
<p>I have an aspx page that references a server control from an assembly and lives in Sharepoint (knowledge/experience in Sharepoint is not required to answer this question, i'm simply giving you context). The implementation looks something like this:</p> <pre><code>&lt;%@ Register TagPrefix="wc" Assembly="Test.Controls" Namespace="Test.Controls" %&gt; &lt;wc:WYSIWYG runat="server"&gt;&lt;/wc:WYSIWYG&gt; </code></pre> <p>I can NOT change the .aspx page's content which currently lives in Sharepoint and I have to to take the same code and run it outside of Sharepoint but still on an ASP.NET environment. It's cool and crazy at the sametime, I know.</p> <p><strong>Challenge</strong></p> <p>When this aspx page is running in Sharepoint, I have to get the WYSIWYG editor control to use Sharepoint's WYSIWYG control. When the same aspx page is running outside of Sharepoint but still in an ASP.NET environment, I need it to use a different server control that's not dependent/from Sharepoint. How could I modify the code-behind to perform this toggling? Is this even possible? Does my question even make sense?</p> <p>Thanks</p>
c# asp.net
[0, 9]
449,152
449,153
In a time when starting to turn off the display of the activity, and then start it
<p>I now have a activity receiver display information from service to send, receive after there will be no closed the activity, led him to stay on after completion of reception interface. The beginning want to once again start time time, to close out the activity, then open it again, service came from the information receiving display. Timing start broadcasting there through the log to see is received by the start time information, but because the activity received after the page has no exit, or not to move ... ...</p> <p>The problem is this:</p> <p>For example, every eight points from time to time to start at eight tomorrow, start, and then after a few hours, finished the work, the display of the activity will stop at the last page does not turn off, always stop until the day after tomorrow, when the day after tomorrow eight broadcast from time to time, the activity life has no reaction.</p> <p>This problem I began with a solution is to turn it off and then restart, and now is in the service off him, after switching off, acquired the regular broadcast can start his ... Eight.</p> <p>The activity with dynamic registration broadcasting, receiving and displaying service information ( service's sendBroadcast ( intent ) continued to broadcast, until the thread to run over ); and the activity is made by another assignment activity boot, this arrangement the task of activity is true by regular broadcasting started.</p> <p>Again, now want to once again start time time, do not shut off the activity, let him continue to receive display service pass information ... How to write ah.</p> <p>CSDN for help with link: <a href="http://topic.csdn.net/u/20120626/10/7d163b1d-d689-4dda-a7f5-b117e4c1f7e4.html" rel="nofollow">http://topic.csdn.net/u/20120626/10/7d163b1d-d689-4dda-a7f5-b117e4c1f7e4.html</a></p> <p>差不多解决了,原因是这个activity的mainfest里面有个属性是这样的:android:launchMode="singleTask" 改成android:launchMode="singleTop" 就可以了,不过出现了新问题,我要继续苦逼下去了……</p>
java android
[1, 4]
47,591
47,592
Android JSON Parse Error Undetermined Object
<p>I have a json with the following contents:</p> <pre><code>{ "Dictionary":[ { "word": "abc" "meaning": "meaning of abc" }, { "word": "def" "meaning": "meaning of def" } ] } </code></pre> <p>The code which I have written for parsing the json file is as follows:</p> <pre><code> public class JSONParser extends Activity { static JSONObject jObj = null; static String json = ""; // constructor public JSONParser() { } public JSONObject getJSONFromInput(InputStream location) { InputStream isr = location; Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reader = new BufferedReader(new InputStreamReader(isr,"UTF-8")); int n; while ((n = reader.read(buffer)) != -1) { writer.write(buffer, 0, n); } isr.close(); json = writer.toString(); } catch (Exception e) { Log.e("Buffer Error", "Error converting result " + e.toString()); } try { jObj = new JSONObject(json); } catch (JSONException e) { Log.e("JSON Parser", "Error parsing data " + e.toString()); } // return JSON String return jObj; } } </code></pre> <p>I'm getting the below Error:</p> <pre><code>E/JSON Parser(555): Error parsing data org.json.JSONException: Unterminated object at character 47 of { E/JSON Parser(555): "Dictionary":[ E/JSON Parser(555): { E/JSON Parser(555): "word": "abc" E/JSON Parser(555): "meaning": "meaning of abc" E/JSON Parser(555): }, E/JSON Parser(555): { E/JSON Parser(555): "word": "def" E/JSON Parser(555): "meaning": "meaning of def" E/JSON Parser(555): } E/JSON Parser(555): ] E/JSON Parser(555): } </code></pre> <p>Can anyone help me out.</p>
java javascript android
[1, 3, 4]
1,446,816
1,446,817
Size of file which we get through AssetManager function getAssets in Android
<pre><code>AssetManager mngr = getAssets(); test_file = mngr.open("sample.txt"); </code></pre> <p>above test_file variable is of InputStream type. Any way to calculate the file size of sample.txt from it?</p>
java android
[1, 4]
520,127
520,128
jquery event handler and php script nested inside a div block
<p>Supposing I have the following script</p> <pre><code>&lt;div id="something"&gt; &lt;?php // execute a loop ?&gt; &lt;/div&gt; &lt;script&gt; //use jquery to show "something" div block on and off &lt;toggle&gt; by a button click event, for example &lt;/script&gt; </code></pre> <p>My question is about whether or not the loop in the php tag code is executed each time the div is to be displayed. I think this is not a good way to handle this for possible performance issues, but I have been unable to find another way around to deal with this. Thank you for any advice and corrections.</p>
php jquery
[2, 5]
2,610,035
2,610,036
How to call a Java class from a Android Activity
<p>I have an Android activity called main.java and BPMClass.java class. I need to call the BPMClass.java within the main.java class. I wrote the code in the following way (does not show function name):</p> <pre><code>import com.app.BPMClass; ... public class main extends Activity { BPMClass bpmclass; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); bpmclass = new BPMClass("filename"); bpmclass. // does not show the function name of BPMClass. } } .... BPMClass{ String fname; public BPMClass(String filename){ fname=filename } public int fun1(fname){ int val=0; ....... return val; } } </code></pre>
java android
[1, 4]
3,986,901
3,986,902
How to cast TextView with my custom TextView?
<p>I take text view instance from here:</p> <pre><code> TextView date = null; try { date = (TextView) getLayoutInflater().inflate( R.layout.some_textview, null); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } </code></pre> <p>I created my custom textview:</p> <pre><code>public class MyTextView extends TextView{ public MyTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public MyTextView(Context context, AttributeSet attrs) { super(context, attrs); } public MyTextView(Context context) { super(context); } } </code></pre> <p>Now i want to cast those:</p> <pre><code>MyTextView my = (MyTextView)date; </code></pre> <p>I get exeption for this one:</p> <pre><code> java.lang.ClassCastException: android.widget.TextView cannot be cast to com.myapp.name.MyTextView </code></pre> <p>So how it should be done ?</p> <p>Thanks.</p> <p><em><strong>Edit:</em></strong></p> <p>If i declare <code>date</code> as <code>MyTextView</code>, still get same exception, ther is my xml of some_textview:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="This is a template for date text view" /&gt; </code></pre>
java android
[1, 4]
2,438,342
2,438,343
How can I use a jquery array in asp.net, and reading values of array from asp.net
<p>I have an array in jquery, and I'm adding values on runtime to this array.After I will access this aray from asp.net page ie: jquery:</p> <pre><code>var marker=[]; marker[0]='world'; marker[1]='sky'; </code></pre> <p>asp.net:</p> <pre><code>string []values=new string[]; values[0]=marker[0]; values[1]=marker[1]; </code></pre> <p>how can I do it, is there any way to access jquery veriables from asp.net pages</p>
jquery asp.net
[5, 9]
4,410,557
4,410,558
replace ids of html elements in jquery clone object
<p>So I have some HTML that I would like to be cloned several times and appended to the document. It's just typical HTML form stuff. But since things like <code>&lt;label for="something"&gt;</code> works based on element IDs, it would be nice if each HTML element within the jquery <code>clone()</code>'d element could have a unique ID, apart from all their cloned counterparts. Just as a guess to how I could do this, I wonder if it would be possible to make the IDs within my initial element all contain some unique string. I could then somehow traverse the element and replace that string with a _1,_2,_3 etc. </p> <p>I haven't gotten very far, but it seems like something like this should work. </p> <pre><code>$(document).ready(function(){ var toReplace = "containerUniqueCharacterString1234"; var copy = $('#containerUniqueCharacterString1234').clone(true); copy[0].style.display = "block"; //so i can reference the first element like this console.log(copy[0]); //[object HTMLDivElement] $('body').append(copy); $.each(copy, function(index, value){ var children = copy[index].childNodes; console.log(children); //[object NodeList] var len = children.length; if (copy[index].childNodes.length &gt; 0){ if (copy[index].childNodes.hasOwnProperty('id')){ //replace the toReplace string with an incremented number here(?) //annnnd this is where i've gotten in too deep and made this overly complex } } $('#otherResults').append(len); }); }); </code></pre> <p><a href="http://jsbin.com/ecojub/1/edit" rel="nofollow">http://jsbin.com/ecojub/1/edit</a></p> <p>Or perhaps there's a much much simpler way to do this. Thanks!</p>
javascript jquery
[3, 5]
3,704,823
3,704,824
Where do I put the dll when I've compiled a httphandler into a class?
<p>I have a httphandler that I got from msdn, looks this way </p> <pre><code>using System.Web; public class HelloWorldHandler : IHttpHandler { public HelloWorldHandler() { } public void ProcessRequest(HttpContext context) { HttpRequest Request = context.Request; HttpResponse Response = context.Response; // This handler is called whenever a file ending // in .sample is requested. A file with that extension // does not need to exist. Response.Write("hello"); } public bool IsReusable { // To enable pooling, return true here. // This keeps the handler in memory. get { return false; } } } </code></pre> <p>So I compiled it to <code>Handler.dll</code> and put it in <code>C:\inetpub\wwwroot\Handler</code></p> <p>I then added this Web.config file </p> <pre><code>&lt;configuration&gt; &lt;system.web&gt; &lt;httpHandlers&gt; &lt;add verb="*" path="*.abc" type="HelloWorldHandler", "HelloWorldHandler" /&gt; &lt;/httpHandlers&gt; &lt;/system.web&gt; &lt;/configuration&gt; </code></pre> <p>and put it in <code>C:\inetpub\wwwroot\Handler</code> also </p> <p><img src="http://i.stack.imgur.com/U1YPz.png" alt="enter image description here"></p> <p>I thought with this then I could go to <code>http://localhost/Handler/page.abc</code> and the handler would intercept the request, but this doesn't go this way? I suspect it is maybe the .config file? Please help. </p> <p><img src="http://i.stack.imgur.com/YHOIx.png" alt="enter image description here"></p>
c# asp.net
[0, 9]
5,686,810
5,686,811
duplicate functions, how may I combine them?
<p>I have a function that remains pretty much constant except for the changing class names. I was hoping to make the code a little less text heavy. How may I go about making it just a small function instead of repeating it <em>n times</em>. My concern is also about removing the active class for the last li that was clicked. I've provided only 2 instances here, but this code is repeated <em>n</em> number of times.Any ideas would be much appreciated. </p> <pre><code> $('a.app1-preview').click(function() { //remove last active classes $(".app2").removeClass('active'); $(".app2-preview").removeClass('active'); //Add active class for this $(this).parent().addClass('active'); $(this).addClass('active'); $('.app-preview-2').fadeOut("slow", function () { $('.app-preview-1').fadeIn("slow"); }); }); $('a.app2-preview').click(function() { //remove last active classes $(".app1").removeClass('active'); $(".app1-preview").removeClass('active'); //Add active class for this $(this).parent().addClass('active'); $(this).addClass('active'); $('.app-preview-1').fadeOut("slow", function () { $('.app-preview-2').fadeIn("slow"); }); }); </code></pre> <p>HTML code: </p> <pre><code> &lt;div class="app-container"&gt; &lt;ul class="apps"&gt; &lt;li class="app1"&gt; &lt;a title href="#" class="app1-preview blocklink"&gt; &lt;span&gt;ANOTHER&lt;br /&gt; APP&lt;/span&gt; &lt;/a&gt; &lt;/li&gt; &lt;li class="app2"&gt; &lt;a title href="#" class="app2-preview blocklink"&gt; &lt;span&gt;SECOND&lt;br /&gt; APP&lt;/span&gt; &lt;/a&gt; &lt;/li&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
5,070,002
5,070,003
R.layout.menu cannot be resolved
<p>Everything was working fine earlier. I then happened to add a new xml file to my layouts. now, one of my classes is giving an error when setContentView points to (R.layout.menu). Eclipse is telling me that R.layout.menu cannot be resolved. I can't figure out why; I have a layout called menu defined in my layout folder.</p> <p>Any suggestions?</p>
java android
[1, 4]
3,265,726
3,265,727
connect over ssl without certificate
<p>I'm trying to connect to my server over SSL port 443 without a certificate.</p> <p>I'm getting an error thrown: </p> <blockquote> <p>javax.net.ssl.SSLException: Not trusted server certificate</p> </blockquote> <p>Reading other questions to solve the problem, the following code should work, but I'm still getting the error message. What could I be doing wrong?</p> <pre><code>HostnameVerifier hostnameVerifier = org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER; DefaultHttpClient client = new DefaultHttpClient(); SchemeRegistry registry = new SchemeRegistry(); SSLSocketFactory socketFactory = SSLSocketFactory.getSocketFactory(); socketFactory.setHostnameVerifier((X509HostnameVerifier) hostnameVerifier); registry.register(new Scheme("https", socketFactory, 443)); SingleClientConnManager mgr = new SingleClientConnManager(client.getParams(), registry); httpclient = new DefaultHttpClient(mgr, client.getParams()); // Set verifier HttpsURLConnection.setDefaultHostnameVerifier(hostnameVerifier); HttpGet httpget = new HttpGet(this.requestedURL); httpget.addHeader(new BasicScheme().authenticate(creds, httpget)); try { response = httpclient.execute(httpget); } catch(java.lang.Throwable t) {} </code></pre>
java android
[1, 4]
4,321,483
4,321,484
Is there a way to delete a form element without using jQuery .remove()?
<p>Using <a href="http://api.jquery.com/remove/" rel="nofollow">.remove()</a> so that the select all check box is not submitted to the server. </p> <p>However, it is visible to the user as the select all checkbox is "physically" removed from the web page, upon submit.</p> <p>Instead, I would like removing the select all check box to appear seamless but NOT on the server side. i.e. - I would like to keep the input on the page but remove the element in the form array before it is sent.</p> <p>Can I manipulate the element[] array of the form before it is sent to the server and delete it there?</p> <p>Thank you. </p>
javascript jquery
[3, 5]
4,683,470
4,683,471
jquery click callback
<p>I have jquery function that is triggered by a 'click' handler:</p> <pre><code>$('#showDatesCheckbox').click(function(){ var table = $('#planningViewTable').find('tr'); if ($('#showDatesCheckbox').is(':checked')) { table.find('.textDate').stop().animate({ "opacity": 1 }, 1000); table.find('.inlineTextDate').stop().animate({ "opacity": 1 }, 1000); } else { table.find('.textDate').stop().animate({ "opacity": 0 }, 1000); table.find('.inlineTextDate').stop().animate({ "opacity": 0 }, 1000); } }); </code></pre> <p>I wanted to have an <em>ajax loading indicator</em> animation, so I need it to show when the click is triggered, and hide when the operation is completed, so I figure <strong><em>callback</em></strong> but it doesn't seem to be working when I set it up as follows:</p> <pre><code>$('#showDatesCheckbox').click(function(){ $('#planningView').mask('Loading...'); var table = $('#planningViewTable').find('tr'); if ($('#showDatesCheckbox').is(':checked')) { table.find('.textDate').stop().animate({ "opacity": 1 }, 1000); table.find('.inlineTextDate').stop().animate({ "opacity": 1 }, 1000); } else { table.find('.textDate').stop().animate({ "opacity": 0 }, 1000); table.find('.inlineTextDate').stop().animate({ "opacity": 0 }, 1000); } }, $('#planningView').unmask(); ); </code></pre>
javascript jquery
[3, 5]
586,962
586,963
features of asp.net
<p>what are the most important features a web developer should know about in asp.net?<br> i am asking this question because i am a newbie and i want to learn c#, and i found a lot of books about: ajax,edmx,asmx,custom controls,jquery,wcf,silverlight......<br> so in what order should i learn them, and what is are the most important ones?</p>
c# asp.net
[0, 9]
203,554
203,555
How can I check if the value of a parameter passed to a javascript function is null?
<p>I have the following javascript code:</p> <pre><code> function changeButtonState(targetSelector, action, iconClass) { var $target = $(targetSelector); var $targetSpan = $(targetSelector + ' span'); $targetSpan.removeClass('sprite-blank').addClass(iconClass); </code></pre> <p>How can I make it so that the <code>$targetSpan.removeClass(..).addClass</code> only work if the iconClass has a value when the function is called. I guess what I am confused about is do I check if it is defined or do I check if it has a length of 0 or more?</p>
javascript jquery
[3, 5]
3,286,146
3,286,147
Failed to load resource: Frame load interrupted - Agian
<p>I have code which downloads a picture from a fake link. I have looked at others comments / sites but nothing has helped me find the solution to the annoying :</p> <p>"Failed to load resource: Frame load interrupted" </p> <p>my php headers are after I read the GET value: </p> <pre><code>header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: private",false); // required for certain browsers //header('Content-Length: '. @filesize($id)); header('Content-Type: '.$mim); header('Content-Disposition: attachment; filename="'.$date.basename($fileName).'"'); header('Content-Transfer-Encoding: binary'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); readfile($fileName); </code></pre> <p>and I have jQuery script which calls an iframe to download the file: </p> <pre><code>$('body').append('&lt;iframe class="download" src="download.php?id='+downloading+'" style="visibility:hidden;" width="0" height="0"&gt;&lt;/iframe&gt;'); </code></pre> <p>I downloads the file correctly, but shows an error in the console, please let me know if its fixable??</p>
php jquery
[2, 5]
3,685,164
3,685,165
how to read the response from a web site?
<p>I have a website url which gives corresponding city names by taking zip code as input parameter. Now I want to know how to read the response from the site.</p> <p>This is the link I am using <a href="http://zipinfo.com/cgi-local/zipsrch.exe?zip=60680" rel="nofollow">http://zipinfo.com/cgi-local/zipsrch.exe?zip=60680</a></p>
c# asp.net
[0, 9]
5,372,303
5,372,304
Getting dropdownlist.selectedvalue trough Postback
<p>I've got this dropdownlist wich i populate using programming code :</p> <pre><code> while (teller &lt; modellen.Length) { SqlCommand cmd2 = new SqlCommand("SELECT Mod_Naam FROM Model WHERE Mod_ID = '" + modellen[teller] + "' ", con); string modnaam = (string)cmd2.ExecuteScalar(); ddlModel.Items.Add(new ListItem(modnaam, modellen[teller])); teller++; } </code></pre> <p>When I select something in the dropdownlist I get an autopostback (wich I use to display a form on the screen for the selected item) but the selecteditem in the dropdownlist get's lost during the postback. How do I keep the selecteditem trough the postback ?</p> <p>thank you, Nico</p>
c# asp.net
[0, 9]
3,162,232
3,162,233
"this file is blocked because it came from another computer" - ajax permission issue
<p>Im fetching a local xml file using jQuery ajax through an html that i download from my site. </p> <p>The problem is that each and every time the file gets downloaded, the user must right click on it -> properties -> unblock. Otherwise jquery ajax throws a "permission denied" error.</p> <p>Is there any way to mark the file as trusted or something similar? Should i implement something on the serverside when downloading the file? Or add something on the client side in the saved html file? Thanks in advance.</p> <p><img src="http://i.stack.imgur.com/RcjkF.png" alt=""></p>
c# javascript jquery asp.net
[0, 3, 5, 9]
4,655,844
4,655,845
reuse code when binding to click
<p>Given the following:</p> <pre><code> $(document).ready(function() { $('a.went-cold-turkey').click(function() { $("body").css("cursor", "progress"); var activity_day = this.rel; $.ajax({ url: this.href, type: "GET", cache: false, success: function (html) { $('#'+activity_day).replaceWith(html); $("body").css("cursor", "auto"); } }); return false; }); $('a.did-it-once').click(function() { $("body").css("cursor", "progress"); var activity_day = this.rel; $.ajax({ url: this.href, type: "GET", cache: false, success: function (html) { $('#'+activity_day).replaceWith(html); $("body").css("cursor", "auto"); } }); return false; }); }); </code></pre> <p>As you can see both ".click" calls are practically identical. How can I share repetitive code in both to keep things DRY?</p>
javascript jquery
[3, 5]
3,280,713
3,280,714
what is the Best way to learn object oriented principles
<p>I am interesed in OOP principles and i found lots of documentations and books about it, for instance in C++, Java, .NET, PHP and so on, but if i only want to learn OOP principle, differences and not in language, what can i do? i want a good documentation, not just like a whole book about something except OOP :) specific answers, how it works, main features, pictures, or videos, or forum, or even stack... in every time I began studying i read a whole history of programming, computer science, software development and bla bla... i need specific answers, if it is possible</p> <p>i really need to learn, i need <strong><em>examples and exercises</em></strong></p> <p>thanks in advance</p>
php c++
[2, 6]
407,730
407,731
Javascript checkboxes with <asp:checkbox />
<p>The Javascript checkbox script (<a href="http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/" rel="nofollow">by ryanfait</a>) worked beautifully when I used it at first. Then I needed to alter the form I made so that asp.net could process the form, but now the checkboxes are default.</p> <p>Is there a way to alter the script to make it work on the asp:checkbox? I call the function like so:</p> <pre><code>$(document).ready(function() { $('input[type=checkbox]').checkbox(); }); </code></pre> <p>And <a href="http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/custom-form-elements.js" rel="nofollow">here</a> is the actual javascript.</p> <p>I have two different types of checkboxes on my page at the moment, one <code>&lt;asp:Checkbox ... /&gt;</code> and one <code>&lt;input type="checkbox" ... /&gt;</code>. The second one gets styled, the asp checkbox doesn't...</p> <p>I haven't contacted Ryan Fait yet, as I hoped this was a common "bug".</p> <p>EDIT: The way the script works is, it finds all elements with class="styled", hides it and then puts a span next to the element. Somehow in my sourcecode, for the asp:checkbox this happens too early I think. Look:</p> <pre><code>&lt;input type="checkbox" class="styled" /&gt;&lt;span class="styled"&gt;&lt;input id="ctl00_contentPlaceHolderRightColumn_newsletter" type="checkbox" name="ctl00$contentPlaceHolderRightColumn$newsletter" /&gt;&lt;/span&gt; </code></pre> <p>The span is there, visible and all, which it should not (I believe, as the first checkbox shows up in the style I want it to be, the second doesn't).</p> <p><em>So far, I found a part of the problem. The javascript cannot change the asp checkbox somehow, but when I manually add the span the javascript is supposed to create, the checkbox doesn't work as a checkbox anymore. I added some details in my answer below.</em></p>
asp.net javascript
[9, 3]
2,356,855
2,356,856
Is there a OnExit or Leave event on ASP.NET textbox?
<p>I need to run some code on server when user leaves the Textbox, it will do some calc over what's been typed. I'd rather avoid doing it with jQuery, because it would involve creating a JSON server, etc.</p> <p>Isn't there a way to do a postback for such an event?</p>
c# asp.net
[0, 9]
2,389,167
2,389,168
Where can I find all the selector xml attributes, include sub-attributes as well?
<p>I am new to android, recently encounter selector xml, found that selector can contains "item", in "item" it can contains "shape", "gradient" and more! I try to search the documentation regarding to this but can't locate. </p> <p>Anyone know where can I locate all the xml attributes related to Selector?</p>
java android
[1, 4]
5,944,060
5,944,061
javascript/jquery shortening a string without cutting word off
<p>say i had the string text = "this is a long string i cant display" i want to trim it down to 10 characters but if it doesnt end with a space finish the word i don't want the string variable to look like this "this is a long string i cant dis" i want it to finish the word until a space occurs. I'm trying this which was suggested by other people but .replace doesn't seem to be working but .length does? I read somewhere that javascript functions don't work inside jquery functions but i still don't understand why .length works</p> <pre><code>$(document).ready(function(){ $('.article').each(function(index){ var text = $(this).children('p').text() var maxLength = 6; var url = $(this).find('.article-link').attr('href'); alert(text.replace(/^(.{1}[^\s]*).*/, "$1")); var trimmedString = text.substr(0, maxLength); var text = trimmedString.substr(0, Math.min(trimmedString.length, trimmedString.lastIndexOf(" "))); //var text = text.substring(0, 80); //text = text.replace(/^(.{10}[^\s]*).*/, "$1"); }); }); </code></pre>
javascript jquery
[3, 5]
4,167,354
4,167,355
Tips on rendering html on client
<p>What are the points to bear while designing and coding a web application where the approach is to render components on the client using jQuery/ScriptServices (as data source), similar to an igoogle page?</p>
javascript jquery
[3, 5]
3,620,832
3,620,833
Is there a c++ wrapper that compile php into a c++ program?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1090124/convert-php-to-c-code">Convert PHP to C++ code</a> </p> </blockquote> <p>Is there a c++ wrapper that compile php into a c++ program?</p> <p>I want to program something for the steam distribution platform but they require it be programmed in c++. I don't know how to program in c++ but I do know how to program in php.</p> <p>If possible I'd like a compiler/wrapper that will let me compile a php script into a c++ program.</p> <p>It should be able to run c++ in the php script.</p> <p>Maybe a "&lt;?c++ &nbsp; ?&gt;" tag for running c++ code?</p> <p>I'm not asking anyone to make I am asking if there is a free one that does what I want.</p>
php c++
[2, 6]
2,275,688
2,275,689
Why do I need to define custom constructor?
<p>If I have a class, let's say, extended from DialogFragment and define custom constructor for it, why should I define a default one? If I wouldn't I get the error message if runtime change occurs. </p>
java android
[1, 4]
4,328,443
4,328,444
Convert Feb 17, 2012 to 17/02/2012 with jQuery
<p>I have this code:</p> <pre><code>var Date = "Feb 17, 2012"; </code></pre> <p>How can I convert it to</p> <pre><code>Date = "17/02/2012" </code></pre> <p>using jQuery?</p>
javascript jquery
[3, 5]
897,594
897,595
jQuery: Global Variable Namespace Problem
<p>Is there a way to declare a global variable in jQuery in its own namespace?</p> <p>Sure, I can declare global variables with plain old JavaScript, but they will fall in the <code>window</code>'s namespace. For example, if I had a variable named <code>document</code>, it would surely overwrite the <code>document</code> object of the <code>window</code>.</p> <p>Does jQuery have a hash table that lets you store any object by their name?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
3,326,494
3,326,495
Validate form using jQuery
<p>When a form submit button is clicked, a function to validate all the field is to be called. Nothing is to happen, however, if the validation fails.</p> <p>I am using <code>mailto:</code> as my action, does this make a difference?<br> I would like to get clarification on two things:</p> <ol> <li><p>Is this the correct way to call a function when clicking the submit button?</p> <pre><code>$(document).ready(function(){ $('#contactForm').submit(function(){ checkMail(); }); }); </code></pre></li> <li><p>Can I still validate the fields even though I'm using <code>mailto:</code>?</p></li> </ol> <p>Here is the rest of the code:</p> <pre><code>function checkEmail(){ var email = document.contact.email.value; if(email == "") { document.getElemtById("email_error").innerHTML = "No Email Address"; return false; } else { document.getElementById("email_error").innerHTML = "" return true; } } </code></pre> <p>HTML:</p> <pre><code>&lt;form name="contact" action="mailto:exampleemail@hotmail.com" method="post"&gt; &lt;li&gt; &lt;label for="email"&gt;Email&lt;/label&gt; &lt;input id="email" type="text" name="email" placeholder="Enter Email Address"&gt; &lt;/li&gt; &lt;span id="email_error"&gt;&lt;/span&gt; </code></pre> <p>Further, I don't get an error message on clicking submit.</p>
javascript jquery
[3, 5]
1,097,954
1,097,955
Not able to append options to select
<p>I am not sure why this works but not when I pass in numbers</p> <pre><code>&lt;form id="form1" runat="server"&gt; &lt;div id="facebookPhotos-iFrameContent"&gt; &lt;div&gt; &lt;p&gt;Log in&lt;/p&gt; &lt;p id="LoginButtonContainer"&gt;&lt;input type="image" id="btnLogin" src="images/loginBtn.jpg" /&gt;&lt;/p&gt; &lt;p&gt;&lt;select id="facebookAlbumDropdown" /&gt;&lt;/p&gt; &lt;div id="facebookPhotosContainer" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p></p> <pre><code>AddDropdownItem("-Select something test-", "-1", "testDropdown"); function AddDropdownItem(sText, sValue, sDropdownID) { $("#" + sDropdownID).append("&lt;option value=" + sValue + "&gt;" + sText + "&lt;/option&gt;"); } </code></pre> <p>that works</p> <p>but this does not:</p> <pre><code>var id = 104388426283811; AddDropdownItem("-Select something test-", id.toString(), "testDropdown"); </code></pre> <p>What happens is the default option shows up but then when it tries to add the second option it bombs out with no errors that I can see in the firebug console and then in the end the list goes blank (no options) when my code is done running.</p>
javascript jquery
[3, 5]
1,571,563
1,571,564
html page loading message
<p>My html page loads a bit slowly because of the jquery that's in it. I want an image that tells the user that it's loading, until the entire page get loaded. How should I go about doing this?<br> Many thanks in advance.</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ //my jquery here.... }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,260,863
2,260,864
gridview on edit event , on update event?
<p>I would like to know how I can access the edit and the update button from <code>GridView</code>?<br> I mean, if I click the edit button from the website in the <code>GridView</code>, I want to get some values from the tables.<br> For example: the <code>button1</code> event.</p>
c# asp.net
[0, 9]
1,512,229
1,512,230
How do I fade in a div by id if cookie=1?
<p>I have a page with few tabs. I am looking for a way that if you select tab 5 and cookie = 1 then show tab6 otherwise show tab5.</p> <p>The code for the tabs is:</p> <pre><code>jQuery(".tabs a").click(function () { stringref = jQuery(this).attr("href").split('#')[1]; jQuery('.tab_content:not(#' + stringref + ')').hide(); jQuery('.tab_content#' + stringref).fadeIn(); return false; }); </code></pre> <p>I want the tab number 5, if clicked and cookie=1 to show tab6. The code that shows the div5 or Div6 if cookie is 1 or null is:</p> <pre><code>alreadyClosed = $.cookie(stateCookieName); if (alreadyClosed != 1) { $DIV5.show(); $DIV6.hide(); } else { $DIV5.hide(); $DIV6.show(); } </code></pre> <p>How do I add them together? I assume their should be a way to say:</p> <pre><code>If tab1.click and cookie = 1 then show $div1 else tab1.click and cookie = null then show $div2 </code></pre> <p>The body looks like:</p> <pre><code>&lt;!-- buttons --&gt; &lt;ul id="boxes" class="tabs"&gt; &lt;li&gt;&lt;a href="#Div5"&gt;Div 5&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#Div6"&gt;Div 6&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;!-- content --&gt; &lt;div class="tab_content" id="Div5"&gt;DIV 5&lt;/div&gt; &lt;div class="tab_content" id="Div6"&gt;DIV 6&lt;/div&gt; </code></pre> <p>I hope you guys can help me. Thanks alot &amp; Regards, rallyboy.</p>
javascript jquery
[3, 5]
761,836
761,837
Blurry text on link hover in jQuery?
<p>I would like to create a blurry effect that will last e.g. 500 ms and then it goes back to normal in some animation that will last e.g. 250ms. So, if the user hover over the link it will animate a blurry/fuzzy effect on this link text and then goes back to normal.</p> <p>Let's say I have this code:</p> <pre><code>&lt;a class="link-to-blurry" href="http://example.com"&gt;Text to blurry on hover&lt;/a&gt; </code></pre> <p>Can this be done using jQuery or some additional JavaScript plugin?</p>
javascript jquery
[3, 5]
2,357,202
2,357,203
Get the the last inserted record in the code behind
<p>I have an insert stored procedure likes this </p> <pre><code> insert into Profile_Master(FirstName,LastName,Dob,Gender,MobileNo,Country,State,EmailId,Password) values (@FirstName,@LastName,@Dob,@Gender,@MobileNo,@Country,@State,@EmailId,@Password) set @id=SCOPE_IDENTITY() return end </code></pre> <p>I want to get the last inserted record in the code behind,how to catch the value?</p> <pre><code> pid = cmd1.Parameters.Add("@id", System.Data.SqlDbType.Int); pid.Direction = System.Data.ParameterDirection.Output; int res = Convert.ToInt32(pid.Value); HttpContext.Current.Session["value"] = res.ToString(); </code></pre> <p>here i am getting res as 0 so the values are not getting updated in the second page.</p>
c# asp.net
[0, 9]
1,870,902
1,870,903
Traffic estimation of a website
<p>How can we find traffic estimation of a website ?? for example 200,000 to 1,000,000 visitors/month.I am using asp.net,c#. Thank You</p>
c# asp.net
[0, 9]
4,176,990
4,176,991
Simulate a click on JavaScript function in Java
<p>I'm writing a program that interacts with a website automatically in Java. I figured out how to build and send GET/POST requests to simulate a click or form submit. But I encountered a link that runs a JavaScript function.</p> <pre><code>&lt;a href="javascript:function()"&gt;Run&lt;/a&gt; function function() { document.myform.submit(); } </code></pre> <p>After clicking, the webpage is redirected to another URL. How do I simulate this behavior in Java?</p>
java javascript
[1, 3]
5,294,526
5,294,527
Hiding radio button list items based on selection of a item in other radiobutton list using jquery
<p>In my scenario I have 2 radio button lists(asp.net server controls). If I select an item in my 1st radio button list then two items in the 2nd radio button list should not be visible.</p>
jquery asp.net
[5, 9]
3,685,130
3,685,131
checking collection of functions if equals to false
<p>I have a group of methods that bring back a true / false deppending on the outcome. I have a collection of 3 - 4 methods and if any of these return false then throw an error.</p> <p>But to check these all I can think of is </p> <pre><code>if(!myfunction) OR (!myOtherFunction) OR (!myOtherOtherFunction) return error </code></pre> <p>basically stacking on check ontop of each other. Is there a way I can more egelgent way to do this?</p>
c# asp.net
[0, 9]
2,573,582
2,573,583
check that a collection is not empty
<p>How do you check that <code>data.results</code> in the following is not empty before trying to perform actions on it?</p> <pre><code>$.getJSON(myurl, function(data) { // if data.results is not empty // { // console.log(data.results.size); // } }); </code></pre>
javascript jquery
[3, 5]
5,768,345
5,768,346
Java: constructing a file from a URI?
<p>I need to obtain a File object from a URI, working in Java, but keep getting a length of zero - though I know the file size is not zero. </p> <p>I need the File object to pass to <a href="http://code.google.com/apis/gdata/javadoc/com/google/gdata/data/media/MediaFileSource.html#constructor_summary" rel="nofollow">another constructor</a>.</p> <p>I'm not sure if it's because I'm constructing it in the wrong way? Here's my code:</p> <pre><code> File videoFile = new File(videoURI.getPath()); if (videoFile == null) { Log.d(LOG_TAG, "File not found!"); return false; } Log.d(LOG_TAG, "about to upload, filepath: " + videoFile.getPath()); Log.d(LOG_TAG, "File length: " + String.valueOf(videoFile.length())); </code></pre> <p>The log output doesn't spit out 'File not found!', and prints a non-null path, but shows a length of 0. </p>
java android
[1, 4]
2,935,812
2,935,813
Get selected radio buttons of certain class
<p>I'm trying to get the radio buttons that has a certain class that is selected.</p> <p>Getting the radio buttons of that class comes with </p> <pre><code>$("input:radio.someClass"); </code></pre> <p>I thought that this would work to get the selected radio button -</p> <pre><code>$("input:radio.someClass:selected"); </code></pre> <p>But that returns empty - what am I doing wrong? </p>
javascript jquery
[3, 5]
5,819,728
5,819,729
jquery flyout menu background li
<p>Playing around with <a href="http://tympanus.net/Tutorials/CufonizedFlyOutMenu/" rel="nofollow">http://tympanus.net/Tutorials/CufonizedFlyOutMenu/</a> I dropped the fly-in descriptions and now trying to get it to load the extra li with style that would "highlight" the li.current-menu-item.</p> <p>It sets up an object with: </p> <pre><code>var $moving = $('&lt;li /&gt;',{ class : 'move', top : $selected[0].offsetTop + 'px', width : $selected[0].offsetWidth + 'px' }); </code></pre> <p>Later in the code, it is manipulated with:</p> <pre><code>function moveTo($elem,speed){ $moving.stop(true).animate({ top : $elem[0].offsetTop + 'px', width : $elem[0].offsetWidth + 'px' }, speed, 'easeOutExpo'); } </code></pre> <p>It creates the li item I want...but it shows up like this:</p> <pre><code>&lt;li class="move" top="41px" style="width: 73px; "&gt;&lt;/li&gt; </code></pre> <p>How do I get the top to show up as a style? Everything is mostly working...but upon page load it's not getting the "top" style until everything starts?</p> <p>I loaded up a <a href="http://jsfiddle.net/jq7YQ/26/" rel="nofollow">http://jsfiddle.net/jq7YQ/26/</a> but I can't get it to work there at all...sigh...but it does work locally?</p> <p>I'm a rookie...so I'm probably missing something stupid...or there's a better way to do this? Any thoughts?</p>
javascript jquery
[3, 5]
5,282,930
5,282,931
what's the equivalent of jquery's 'trigger' method without jquery?
<p>what's the equivalent of <em>jQuery</em>'s <code>trigger</code> method without <em>jQuery</em>?</p> <p>e.g., how do i do something like <code>$('.blah').trigger('click');</code> without <em>jQuery</em>?</p>
javascript jquery
[3, 5]
1,491,251
1,491,252
Is it possible to overload a method this way?
<p>I am trying to allow people to login using their UserID(int) or their username (string). The way I thought about doing this is creating two seperate methods, one that accepts a string, and one that accepts an int. But I could not get this to work and it seems there might be a better solution.</p> <pre><code>public static string ForgotPassword ( string username ) { using ( var conn = new SqlConnection( GetConnectionString() ) ) using ( var cmd = conn.CreateCommand() ) { conn.Open(); cmd.CommandText = @"SELECT Password FROM Distributor WHERE Username = @username"; cmd.Parameters.AddWithValue( "@username", (string)username ); using ( var reader = cmd.ExecuteReader() ) { if ( !reader.Read() ) { // no results found return null; } return reader.GetString( reader.GetOrdinal( "Password" ) ); } } } public static string ForgotPassword ( int username ) { using ( var conn = new SqlConnection( GetConnectionString() ) ) using ( var cmd = conn.CreateCommand() ) { conn.Open(); cmd.CommandText = @"SELECT Password FROM Distributor WHERE DistributorID= @username"; cmd.Parameters.AddWithValue( "@username", (int)username ); using ( var reader = cmd.ExecuteReader() ) { if ( !reader.Read() ) { // no results found return null; } return reader.GetString( reader.GetOrdinal( "Password" ) ); } } } </code></pre> <p>What is the best way to allow them to login with a user_id or a username?</p>
c# asp.net
[0, 9]
3,293,714
3,293,715
Is there any way to implement MaintainScrollPositionOnPostBack functionality in jQuery
<p>ASP.NET 2.0 had the following property MaintainScrollPositionOnPostBack and it could be used to maintain browser position on post back. Can this be achieved using jQuery and if yes how? I have read a few articles mentioning that MaintainScrollPositionOnPostBack doesnt work in some browsers like Chrome/Safari etc. </p>
asp.net jquery
[9, 5]
4,681,630
4,681,631
decrypting cypher value in web.config
<p>I have an asp.net web site with connection string in external config file like this:</p> <p></p> <p>and external file looks like this:</p> <pre><code>&lt;connectionStrings configProtectionProvider="DataProtectionConfigurationProvider"&gt; &lt;EncryptedData&gt; &lt;CipherData&gt; &lt;CipherValue&gt; some long string here&lt;/CipherValue&gt; &lt;/CipherData&gt; &lt;/EncryptedData&gt; &lt;/connectionStrings&gt; </code></pre> <p>I want to decrypt it. Please suggest me how to do it ?</p>
c# asp.net
[0, 9]
1,916,253
1,916,254
Find out if a Variable exists
<p>I would like to find out if a Javascript variable exists. This is what I have so far which was cobbled together from different forums:</p> <pre><code>function valueOfVar(foo){ var has_foo = typeof foo != 'undefined'; if(has_foo){ alert('1 = true'); return true; } else { alert('1 = false'); return false; } } </code></pre> <blockquote> <p>Please note, I wish to pass in a string as foo. Example: valueOfVar(box_split[0]+'_2')</p> </blockquote> <p>Now, I don't think this works because it returns true when certain variables don't even exist. In fact, it seems to return true all the time.</p> <p>A JQuery implementation that works would also be great as I make use of this.</p> <p>Thanks all for any help</p>
javascript jquery
[3, 5]
1,773,902
1,773,903
"Waiting" for ReadyState to be 4 before returning a value
<p>I have looked in lots of places for this, and I'm probably being an idiot because this is done a lot, but here's my situation.</p> <p>I am trying to display a checkbox next to an e-mail field on my website iff the e-mail has not been used to register already.</p> <p>What I have is something like this:</p> <pre><code>$('[name=reg_email]').change( function() { if(!emailUsed()) { //Update image to be a green checkmark } else { //Update image to be a huge red X } } </code></pre> <p>And my "emailUsed" function should be returning a Javascript boolean variable depending on whether or not the e-mail address is in the database. To facilitate this, I've created a script which will determine if it's there or not. So the emailUsed() function just needs to call the script and return, but I need to wait until readystate == 4 before I return, and all of the methods I have found for waiting for readystate to equal 4 prevent me from returning a value at all:</p> <pre><code>function emailUsed() { var req = $.get('scripts/email_used.php?email='+$('[name=reg_email]').val()); //Wait for req.readystate to be 4 return req.responseText == 'True'; } </code></pre> <p>But nowhere can I find something that explains how to do this and still return a value. Everything seems to use callback functions and this and that, but I can't get THIS method to return a value.</p> <p>Help, please!</p>
javascript jquery
[3, 5]
980,267
980,268
Show message if user has entered content on page and not saved
<p>How can I show a message like a popup modal if a user has entered some content and then not saved it and try to leave the page?</p> <p>Something like:</p> <p><img src="http://i.stack.imgur.com/ZFQF9.png" alt="enter image description here"></p> <p>This appears if you try to go to another page within Facebook BUT if you type in the URL then you get a native alert box like:</p> <p><img src="http://i.stack.imgur.com/P5dRO.png" alt="enter image description here"></p> <p>1.) What is the difference? Is the alert something that is built into browsers?</p> <p>2.) How can I use jQuery to create my own custom modal boxes when similar events happen?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,711,306
1,711,307
How to alter concurrent list items from multiple nested lists with jQuery
<p>If I have the following nested lists</p> <pre><code>&lt;ul&gt; &lt;li class="hide"&gt;list 1.1&lt;/li&gt; &lt;li&gt;list 1.2&lt;/li&gt; &lt;li&gt;list 1.3 &lt;ul&gt; &lt;li&gt;list 2.1&lt;/li&gt; &lt;li class="hide"&gt;list 2.2&lt;/li&gt; &lt;li&gt;list 2.3 &lt;ul&gt; &lt;li id="list-item"&gt;list 3.1&lt;/li&gt; &lt;li class="hide"&gt;list 3.2&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="hide"&gt;list 2.4&lt;/li&gt; &lt;li class="hide"&gt;list 2.5&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="hide"&gt;list 1.4&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>How do I show items 3.2, 2.4, 2.5 and 1.4 using jquery without showing the other hidden items. (In the displayed tree these items are all next to one another even if they are from different lists.)</p> <p>I have tried the folllowing with no success - it only hides the next li.</p> <pre><code>$("li").find("#list-item").nextUntil(":not(.hide)").removeClass("hide"); </code></pre> <p>How do I make it select from all li elements and not just those in the current ul?</p> <p>Edit to add: Here is an example on JS Bin: <a href="http://jsbin.com/usoyul/2/edit" rel="nofollow">http://jsbin.com/usoyul/2/edit</a></p>
javascript jquery
[3, 5]
4,670,833
4,670,834
Javascript triple greater than in PHP
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3325640/php-shift-right">PHP shift right</a> </p> </blockquote> <p>What is the ability to get the same result of javascript's <a href="http://msdn.microsoft.com/en-us/library/342xfs5s%28v=vs.94%29.aspx" rel="nofollow">triple great than ( >>> )</a> in php ?</p>
php javascript
[2, 3]
5,545,512
5,545,513
radio button to enable form fields
<p>I have a form containing two radio buttons, I want to enable corresponding fields when a radio button is checked. My code just isn't working, here it is:</p> <pre><code>&lt;head&gt; &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { var $type = $('select'), $field1 = $("#fieldID1"), $field2 = $("#fieldID2"); $type.change(function() { var isDisabled = ($type.filter(":checked").val() === "1"); $field1.prop("disabled", !isDisabled); $field2.prop("disabled", isDisabled); }).change(); }); &lt;/script&gt; &lt;/head&gt; </code></pre> <p>My html body is like:</p> <pre><code>&lt;body&gt; &lt;form action="" method="post"&gt; &lt;input type="radio" name="select" value="1" /&gt; &lt;input type="text" name="fieldID1" id="fieldID1"/&gt; &lt;input type="radio" name="select" value="2" /&gt; &lt;table id="fieldID2"&gt; &lt;tr&gt;...&lt;/tr&gt; &lt;tr&gt;...&lt;/tr&gt; ... &lt;/table&gt; &lt;input type="submit" value="Add"&gt; &lt;/form&gt; &lt;/body&gt; </code></pre> <p>I referenced the code from <a href="http://stackoverflow.com/questions/6036635/improving-use-of-radio-buttons-to-enable-disable-form-fields">this post</a>. Can anyone point me out what the problem is, I am not quite familiar with jQuery, thanks!</p> <p>Still cannot be fixed...</p>
javascript jquery
[3, 5]
3,740,633
3,740,634
C# Image.FromStream is that secure?
<p>after reading the data from the request as Stream i needed to convert it to Image so i used this Method:</p> <pre><code>Stream inputStream = HttpContext.Current.Request.InputStream; Image img = Image.FromStream(inputStream) </code></pre> <p>my question is, while im unable to know what was in that inputStream (file format is done already but still..) there may be a virus or malware, so in that case FromStream(Stream) would throw ArgumentException. since it's not an image.</p> <p>my question is - If the file uploaded contains a virus, and the method throws an exception while trying to convert the stream to Image, did that make any harm to the server? if so, how to avoid it? what should be the scenario for handling file upload in the server?</p>
c# asp.net
[0, 9]
3,517,950
3,517,951
Can you force compilation despite errors
<p>Is it possible to build and compile an Android applications even though it has errors and missing classes? (Assume the errors are in classes that won't be used during a round of testing for example).</p>
java android
[1, 4]
2,827,689
2,827,690
Can anybody explain what is the best way to update latest post automatically in the page?
<p>Can anybody explain what is the best way to update latest post automatically in the page ?</p> <pre><code>(Newly added posts will just prepend to the old wall posts) </code></pre> <p>And</p> <pre><code> (The number which tells number of newly added posts. Number should be displayed in the top of the wall.) </code></pre> <p>Like <code>twitter</code> and <code>facebook</code>, they update wall in each interval .</p> <p>What is the technique they use ?</p> <p>(I know i can set up the timeInterval in JS. But I need to send a request to server only if any new post added to the system.)</p> <pre><code>(Using cron or something we can just go and hit the client ?. In phone there is a method called "PUSH". ) </code></pre>
php javascript
[2, 3]
4,128,600
4,128,601
IE7 ignores :not-selector
<p>Internet Explorer 7 seems to ignore the :not-selector in the second line in following example, it shows and then hides the content - instead of showing the content with the right index and hiding the rest.</p> <pre><code>$('.dashboard-module-content:eq(' + indexFoo + ') .expand-collapse').show('fast'); $('.dashboard-module-content:not(:eq(' + indexFoo + ')) .expand-collapse').hide('fast'); </code></pre> <p>Anyone knows who to tackle a problem like this?</p>
javascript jquery
[3, 5]
3,203,302
3,203,303
Compiled code spreadsheet-like cell management? (auto-updating)
<p>Okay so I am fully aware how spreadsheets manage cells, they build dependency graphs where when one cell changes it tells all the other cells that are dependent on it that it changed. So they can from there update. </p> <p>How they update I think involves either re-evaluating the formulas stored as strings, or re-evaluating the abstract syntax tree which I think is stored differently and might be faster. Something like that.</p> <p>What I'm looking to do is manage a few variables in my code so I don't have to update them in the correct way, which would be a nightmare. But I also want it much faster than spreadsheets. And since I'm not looking for any functionality as great as are in these spreadsheets, I just figured from that thought point that there has to be a way to have a very fast implementation of this functionality. Especially since I don't have to modify cells after compiling unless that would be an option.</p> <p>I'm very new to programming so I have no idea. One example might be to have a code-generator that generates code that does this for me. But I have no clue what the generated code would look like. Specifically, how exactly would variables inform others that they need to update, and what do those variables do to update?</p> <p>I'm looking for any kind of ideas. Programming is not my job but nonetheless I was hoping to have some kind of system like this that would greatly help me with some stuff. Of course I have been programming plenty lately so I can still program. I just don't have the full scope on things.</p> <p>I'm looking for any kind of ideas, thank you very much in advance!</p> <p>Also, please help me with the tags. I know C# and Java mainly and I'm hoping to implement this in either of those languages and I'm hoping this can stay in those tags. Forcing this into some kind of spreadsheet tag wouldn't be accurate. </p>
java c#
[1, 0]
2,417,945
2,417,946
Does javascript have a shorthand way of setting up fields in an object?
<p>I am using the following:</p> <pre><code>var link = {}; link.action = $link.attr('data-action') || ''; link.dialogType = $link.attr('data-dialogType') || ''; link.params = $link.attr('data-params') || ''; link.title = $link.attr('title') || ''; link.viewURL = $link.attr('data-href') || ''; link.entity = $link.attr('data-entity') || ''; link.row = $link.attr('data-row'); </code></pre> <p>But is there a better way to do this?</p>
javascript jquery
[3, 5]
1,829,768
1,829,769
filtering ListBox according to input value
<p>Javascript</p> <pre><code> &lt;script type="text/javascript"&gt; //note that you would put these functions in a library .js that you include on every page //the jQuery default contains function is case-sensitive //this declaration creates a new Contains function that's case-insensitive jQuery.expr[':'].Contains = function (a, i, m) { return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) &gt;= 0; }; var Util = new Object(); //just a namespace object //the original YUI DataTable filter function Util.yuiDtFilter = function (tableDivId, filter) { $("#" + tableDivId + " .yui-dt-data").find('tr').hide(); $("#" + tableDivId + " .yui-dt-data").find('td:Contains("' + filter + '")').parents('tr').show(); } //slightly modified version of the above to work on any table with a tbody Util.tableFilter = function (tableBodyId, filter) { $("#" + tableBodyId).find('tr').hide(); $("#" + tableBodyId).find('td:Contains("' + filter + '")').parents('tr').show(); } //this one works on any &lt;select&gt; list Util.selectFilter = function (selectId, filter) { $("#" + selectId).find('option').hide(); $("#" + selectId).find('option:Contains("' + filter + '")').show(); } &lt;/script&gt; </code></pre> <p>Asp.Net controls</p> <pre><code> &lt;input type="text" onkeyup="Util.selectFilter('copyUserListBox', this.value)" style="width: 300px" value="Enter a text..." /&gt; &lt;br /&gt; &lt;asp:ListBox ID="copyUserListBox" runat="server" Width="300px" Height="200px"&gt;&lt;/asp:ListBox&gt; </code></pre> <p>I'm filtering ListBox accordding to input value. In Firefox, Chrome, it works correctly but in IE it doesn't work. How to do this?</p>
javascript jquery asp.net
[3, 5, 9]
5,441,916
5,441,917
Why browser doesn't cache java script(Ajax)?
<p>I have made a cascade drop down list box using jquery. user selects state from first drop down and according to selected state the second drop down will fll by appropriate cities. my problem is about caching of second drop down. when user clicks on back browser button and then click on forward button the city drop down contents is empty. Is there any way to tell browser cache the data?</p>
javascript asp.net
[3, 9]
2,659,793
2,659,794
Fadein on hover then fade out to orginal state but stay on hover state when onclicked
<p>What I have to create is a fade in/out of an image to show the image behind it which has text on it, the user can stay on that button by clicking it. Then it will go back to its orginal state when an other button is clicked on. But while an image has been clicked on the other buttons can be hovered over.</p> <p>There are 8 images/buttons. </p>
javascript jquery
[3, 5]
5,162,091
5,162,092
JQuery Detect class changes
<p>I am using a plugin that added a class <code>open</code> to <code>.slide-out-div</code> when opened.</p> <p>So I am trying to change some css if the open is detected.</p> <p>What I need to do is </p> <pre><code>IF $('.slide-out-div **open**') IS Detected then $('.otherDiv').css('top','0px'); </code></pre> <p>Not sure how to put this together...</p>
javascript jquery
[3, 5]
3,015,229
3,015,230
Remove HTML tags from a javascript string
<p>I have this code :</p> <pre><code>var content = "&lt;p&gt;Dear sms,&lt;/p&gt;&lt;p&gt;This is a test notification for push message from center II.&lt;/p&gt;"; </code></pre> <p>and I want to remove all <code>&lt;p&gt;</code> and <code>&lt;/p&gt;</code> tags from the above string. Just want to display the string values without html tags like :</p> <pre><code>"Dear sms, This is a test notification for push message from center II." </code></pre>
javascript jquery
[3, 5]
92,729
92,730
weird PHP shell_exec Java behavior
<p>i am having a very unusual problem related to PHP shell_exec(). well, i am actually going to execute external java program. i make a test like this</p> <pre><code>&lt;?php $command = 'C:\\Program Files\\Java\\jdk1.6.0_35\\bin\\java.exe'; $val = shell_exec($command); echo('command:' . $command); echo('&lt;BR&gt;'); echo('val:' . $val); ?&gt; </code></pre> <p>everything is OK, but when i am trying to do this</p> <pre><code>&lt;?php $command = 'C:\\Program Files\\Java\\jdk1.6.0_35\\bin\\javac.exe'; $val = shell_exec($command); echo('command:' . $command); echo('&lt;BR&gt;'); echo('val:' . $val); ?&gt; </code></pre> <p>no output produced. really odd. i have also tried to use exec() but no different. the next odd thing is when i am try this one</p> <pre><code>&lt;?php $command = 'C:\\Program Files\\Java\\jdk1.6.0_35\\bin\\java.exe -version'; $val = shell_exec($command); echo('command:' . $command); echo('&lt;BR&gt;'); echo('val:' . $val); ?&gt; </code></pre> <p>i use the exact java.exe but add a -version as an extra option. no output come up.</p> <p>either java.exe and javac.exe give output when they are executed in the command line. i use Win 7 64bit, XAMPP 1.8.1 (Apache 2.4.3, PHP 5.4.7) and JDK 1.6 update 35.</p> <p>i searched about this thing here, and tried to implement answer given to the related question, but they don't solve.</p> <p>any explanation related to this,.? thank you for helping :)</p>
java php
[1, 2]
2,383,579
2,383,580
How to append row to table id="address" on click of button?
<p>How to append row to table <code>id="address"</code> on click of button </p> <pre><code> &lt;tr&gt; &lt;td&gt;address:&lt;/td&gt; &lt;td&gt;&lt;input type="text"&gt;&lt;/input&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text"&gt;&lt;/input&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text"&gt;&lt;/input&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre>
javascript jquery
[3, 5]
3,649,871
3,649,872
Using a C++ class in C#
<p>How can I use a C++ class in C#? I know you can use DllImport and have the class as IntPtr, but then how would I call the functions inside the class? And I don't want to create a new method for each method in the class and export that, then there is not point for me to use a class then...</p> <p><strong>Without creating a COM app</strong></p> <p>C++ Class:</p> <pre><code>class MyCPPClass { public: MyCPPClass(); ~MyCPPClass(); void call_me(); } extern "C" { extern __declspec(dllexport) MyCPPClass* __cdecl CreateClass() { return new MyCPPClass(); } } </code></pre> <p>C#:</p> <pre><code>class MyCSClass { [DllImport("MyCPPDll.dll")] static extern IntPtr CreateClass(); public static void Main() { IntPtr cc = CreateClass(); // Now I want to call cc-&gt;call_me(); } } </code></pre>
c# c++
[0, 6]
1,285,578
1,285,579
How to find the closest element to the current position with jQuery
<p>I have a document with several sections like this:</p> <pre><code>&lt;div class='section' id='sec1'&gt; lalala lalala lalala &lt;/div&gt; &lt;div class='section' id='sec2'&gt; lalala lalala lalala &lt;/div&gt; &lt;div class='section' id='sec3'&gt; lalala lalala lalala &lt;/div&gt; &lt;div class='section' id='sec4'&gt; lalala lalala lalala &lt;/div&gt; </code></pre> <p>How do I grab the closest <code>&lt;div.section&gt;</code> to the current scroll position (presumably, this would equate to the section that the reader is currently looking at)?</p>
javascript jquery
[3, 5]
758,798
758,799
Javascript TRUE is not defined or in quotes
<p>I have a XML file that contains </p> <pre><code>&lt;car&gt; &lt;id&gt;123&lt;/id&gt; &lt;sunroof&gt;FALSE&lt;/sunroof&gt; &lt;service&gt;TRUE&lt;/service&gt; &lt;/car&gt; </code></pre> <p>The following code only works if I wrap TRUE inside quotes e.g <code>(service == "TRUE")</code></p> <pre><code>var service = tis.find("service").text(); if(service === TRUE){ var service_tag = '&lt;a title="Service" href=""&gt;Service&lt;/a&gt;' } else { var service_tag = ''; } </code></pre>
javascript jquery
[3, 5]