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
2,285,180
2,285,181
jquery select all rows not containing specific text
<p>I would like to use jQuery to select all rows in a table that don't have a <code>td</code> containing certain text.</p> <p>I can select the rows with this line:</p> <pre><code>var x = $('td:contains("text"):parent'); //muliple td's in each tr </code></pre> <p>How would I use the <code>:not</code> selector to invert the selection?</p> <p>edit: I don't think the line of code above is really accurate. This is how I originally had the line:</p> <pre><code>var x = $('td:contains("text")).parent(); //muliple td's in each tr </code></pre> <p>When I tried to invert the selection, I get all the rows as they all happen to contain a td not containing the text. </p>
javascript jquery
[3, 5]
2,605,368
2,605,369
Capture PHP echo in Javascript
<p>I currently need to use a similar piece of PHP code. Modifying this code is not an option.</p> <pre><code>&lt;? session_start(); include '../connection.inc'; $conn = new Connection(); echo "ID:" . $conn-&gt;generateID(); echo "\n"; ?&gt; </code></pre> <p>In connection.inc a connection to a database can be made by creating a new Connection(). From there, the database can generate a unique 16-character ID (conn->generateID). Is there a way to retrieve to execute this PHP-file from javascript and extract the 16-character ID from the PHP-echo in javascript?</p>
php javascript
[2, 3]
2,715,045
2,715,046
file upload from iPhone to PHP not worked
<p>When uploading a file from iPhone, my code produces the following error:</p> <blockquote> <p>Warning: move_uploaded_file() Unable to move '/tmp/phpUcqFVq' to '/var/www/ds1134/http.www.xxx.com/app/1316254141147.jpg' in /var/www/ds1134/https.www.xxx.com/user.php on line 2866</p> </blockquote> <p><code>$_FILES</code> looks like: </p> <pre><code> [file] =&gt; Array ( [name] =&gt; 1316250632283.jpg [type] =&gt; [tmp_name] =&gt; /tmp/phpFio7gb [error] =&gt; 0 [size] =&gt; 35515 ) </code></pre> <p>My PHP code for uploading is: </p> <pre><code>if (move_uploaded_file($_FILES["file"]["tmp_name"], "/var/www/ds1134/http.www.xxx.com/app/".$_FILES["file"]["name"])) { echo "done"; } </code></pre>
php iphone
[2, 8]
5,928,481
5,928,482
How to know if return data is Json or String in jQuery and PHP?
<p>I want to check in client side(jQuery) whether return data from a PHP function is Json object or String to assign different function.</p>
php jquery
[2, 5]
4,794,868
4,794,869
Remember login information
<p>I would like to let the user register once and from that moment he won't need to login every time he open the app. How would I do that?should I save the login information on the device and load it every time he tries?is it safe?maybe save only his id and then load his info from the mysql db?</p> <p><strong>EDIT</strong> would you mind atleast telling me why do I get so many negative votes?so I could learn for the next time?</p>
java android
[1, 4]
4,115,245
4,115,246
jQuery custom toggle function?
<p>I'm trying to make a custom jQuery toggle function. Right now, I have 2 separate functions, <code>lightsOn</code> and <code>lightsOff</code>. How can I combine these functions to make them toggle (so I can just link to one function)?</p> <pre><code>function lightsOn(){ $('#dim').fadeOut(500,function() { $("#dim").remove(); }); }; function lightsOff(){ $('body').append('&lt;div id="dim"&gt;&lt;/div&gt;'); $('#dim').fadeIn(250); }; </code></pre>
javascript jquery
[3, 5]
365,796
365,797
Shortening javascript Jquery code
<p>I am wondering if there is a way to shorten the code below. I have shown the first 5 if statements. I will have a total of 10 when I am done.</p> <p>EDIT: FORGOT THE MOUSEMOVE PART</p> <pre><code>$("#bar").mousemove(function(e){ var vb = $(this); if(e.pageX &lt;=467 &amp;&amp; e.pageX &gt; 457){ vb.attr("src","images2/vb10.png"); vol =10; } if(e.pageX &lt;=457 &amp;&amp; e.pageX &gt; 447){ vb.attr("src","images2/vb9.png"); vol=9; } if(e.pageX &lt;=447 &amp;&amp; e.pageX &gt; 437){ vb.attr("src","images2/vb8.png"); vol=8; } if(e.pageX &lt;=437 &amp;&amp; e.pageX &gt; 427){ vb.attr("src","images2/vb7.png"); vol=7; } if(e.pageX &lt;=427 &amp;&amp; e.pageX &gt; 417){ vb.attr("src","images2/vb6.png"); vol=6 } }); </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
5,714,197
5,714,198
How can I get colors from an image?
<p>How can I get colors from an image? Like <a href="http://www.cssdrive.com/imagepalette/index.php" rel="nofollow">this site</a> does? I want to know how I can get that.</p>
php javascript jquery
[2, 3, 5]
920,206
920,207
ArrayList Find First and Last Element
<p>Good Evening,</p> <p>I have an ArrayList (instantiated as ld_data) and I iterate forward and back looking / displaying to the user the element data. In this process I need to know when I am at the first element and the last. Detecting when I am at the last element I do as such:</p> <pre><code>if((index + 1) &lt;= ld_data.size()) { .... } </code></pre> <p>This works because the size property also is the upper bound of the ArrayList. However detecting when I am at the first element is not as easy for me. The best I've been able to figure out is this which seems rather lame....but it works.</p> <pre><code>if((index - 1) &gt;= (ld_data.size() - ld_data.size())) { .... } </code></pre> <p>In the C# .NET world we have ArrayList.UpperBound or ArrayList.LowerBound is there something similiar in Java?</p> <p>JB</p> <p>EDIT: Further details. So for more information I am bound to a ListView. So when the user has scrolled to the first element of the list I want to show a msg "At start of list" and when they reach the end show "End of list". I know there is a scrollbar that makes this obvious I'm just trying to give an example of what I'm doing. So this check occurs in the "OnScroll" event.</p>
java android
[1, 4]
1,151,229
1,151,230
Serialize inputs and select option
<p>I need to serialize inputs and selected option in table row(tr)<br/></p> <pre><code>&lt;form action='' METHOD='post' id='formConfirmOrder'&gt; &lt;table id='viewTableOrders'&gt; &lt;tr id='vagon1'&gt; &lt;td&gt; &lt;select name="order[1][rail_path]" title="1"&gt; &lt;option value="" selected="selected"&gt;&lt;/option&gt; &lt;option value="1"&gt;Patch1&lt;/option&gt;&lt;option value="2"&gt;Patch2&lt;/option&gt; &lt;option value="3" selected="selected"&gt;Patch3&lt;/option&gt;&lt;option value="5"&gt;Patch4&lt;/option&gt;&lt;/select&gt; &lt;/td&gt; &lt;td&gt; &lt;input name="order[1][vagon_id]" value="210" type="hidden"/&gt; &lt;/td&gt; </code></pre> <p> </p> <pre><code> $('#formConfirmOrder &gt; #viewTableOrders tr#vagon1 select option:selected, #formConfirmOrder &gt; #viewTableOrders tr#vagon1 input').serializeArray(); </code></pre> <p>.. *<em>FireBug</em>*Only inputs <br/></p> <pre><code>[Object { name="order[1][vagon_id]", more...}] </code></pre> <p><br/> I can`t get selected value from option!<br/> Inputs were serialized. ,but not options.</p>
javascript jquery
[3, 5]
1,536,968
1,536,969
jQuery- Please explain to me Closure, variable context
<p>Ok so I don't understand why Firefox is saying that the $("#canvas")[0].getContext('2d'); is undefined. I put it out of the function so that all of the function can access it but here the ctx is still undefined.</p> <pre><code>(function($) { // Undefined var ctx = $('#canvas')[0].getContext("2d"); var x = 150; var y = 150; var dx = 2; var dy = 4; $(function() { setInterval(draw, 10); }) function draw() { ctx.clearRect(0,0,300,300); ctx.beginPath(); ctx.arc(x,y,10,0,Math.PI*2,true); ctx.closePath(); ctx.fill(); x+=dx; y+=dy; } })(jQuery); </code></pre> <p>However when I transferred the location of ctx to the unnamed function, the ctx is not undefined:</p> <pre><code>(function($) { var ctx; var x = 150; var y = 150; var dx = 2; var dy = 4; $(function() { //Not Undefined ctx = $("#canvas")[0].getContext('2d'); setInterval(draw, 10); }) function draw() { ctx.clearRect(0,0,300,300); ctx.beginPath(); ctx.arc(x,y,10,0,Math.PI*2,true); ctx.closePath(); ctx.fill(); x+=dx; y+=dy; } })(jQuery); </code></pre> <p>Whats wrong with the first code? I mean var ctx is declared on the top. So that would make it a global variable. Hmm the error that I got was $("#canvas")[0] is undefined. Means that it can't access the #canvas.. Why??</p>
javascript jquery
[3, 5]
5,178,133
5,178,134
ASP.NET: Global hook in Response?
<p>Is there any way to intercept all ASPX Page Responses? I'd like to intercept all the pages served and inject a small JavaScript at the end of each. </p>
asp.net javascript
[9, 3]
513,945
513,946
waypoints.js not working
<p>I'm using <a href="http://imakewebthings.github.com/jquery-waypoints/" rel="nofollow">waypoints.js</a> in a project to fire an event whenever a list element becomes visible. The only problem is, nothing seems to be happening - the waypoint.reached event does not seem to be firing.</p> <p>The file (waypoints.js) is being included correctly, as is jQuery, in the correct order.</p> <p>You can view the (work in progress) page <a href="http://smartvent.wasabi.co/" rel="nofollow">here</a>.</p>
javascript jquery
[3, 5]
4,992,959
4,992,960
How to truncate links to certain length using any of the javascript or jquery
<p>I have checked the web thoroughly but haven't found anything that tell how to truncate links to certain length</p>
javascript jquery
[3, 5]
3,318,622
3,318,623
Why use jQuery(selector).get(0) instead of jQuery(selector)[0] to get DOM element?
<p>Using jQuery is there any benefit to using <code>$(selector).get(0)</code> over <code>$(selector)[0]</code> if I just want to get the first item in the jQuery array as a DOM element?</p> <p>HTML:</p> <pre><code>&lt;form id="myForm"&gt;&lt;/form&gt; </code></pre> <p>Javascript: </p> <pre><code>var selector = '#myForm'; var domElement = $(selector).get(0); //Returns [object HTMLFormElement] //Or var domElement = $(selector)[0]; //Also returns [object HTMLFormElement] </code></pre> <ul> <li><code>.get()</code> is more characters to type.</li> <li>Both methods return the same result if the <code>$(selector)</code> is empty (<code>undefined</code>)</li> <li><a href="http://api.jquery.com/get/" rel="nofollow">The jQuery documentation on <code>.get()</code></a> notes that you can simply use the index accessor to get the nth element, but you don't get the other benefits of <code>.get()</code> such as using a negative number to return items from the end of the array.</li> <li>Also, you can call <code>.get()</code> with no arguments to return all the DOM elements of the jQuery array.</li> </ul>
javascript jquery
[3, 5]
5,417,352
5,417,353
jQuery or JS to show larger image
<p>I'm looking for a way too display images like google does. when someone hovers over an image, an larger view is shown I would like to know how I can achieve this.</p>
javascript jquery
[3, 5]
2,099,252
2,099,253
Insert value in relational table
<p>Tables:</p> <ol> <li>Board(BID(PK), BoardName, date, Status)</li> <li>Medium(MID(PK), MediumName, Date, status) </li> <li>BoardMedium(BMID(PK), BID(FK), MID(FK))</li> </ol> <p>above is my table structre .I wanted to Take Name Of Board and name of medium from dropdown(already filled) and insert into BoardMedium table only BID and MID.user will provide Boardname and Mediumname based on these two value i have to check wheather it is available in BoardMedium table or not if not then insert into BoardMedium table only BID and MID.can any on help me to achieve the same .Thanks in advance...</p>
c# asp.net
[0, 9]
5,394,906
5,394,907
Using javascript loading indicator with UpdatePanel/UpdateProgress?
<p>Is is possible to combine for instance <a href="http://fgnass.github.com/spin.js/" rel="nofollow">spin.js</a> with an UpdatePanel?</p> <p>The normal way is to put a gif in an UpdateProgress, but can it be done with a javascript driven spinner/loading indicator instead?</p>
jquery asp.net
[5, 9]
3,013,578
3,013,579
jQuery $(this).attr("id") not working
<p>as the title says, I keep getting "undefined" when I try to get the id attribute of an element, basically what I want to do is replace an element with a input box when the value is "other".</p> <p>Here is the code:</p> <pre><code>function showHideOther(obj){ var sel = obj.options[obj.selectedIndex].value; var ID = $(this).attr("id"); alert(ID); if(sel=='other'){ $(this).html("&lt;input type='text' name='" + ID + "' id='" + ID + "' /&gt;"); }else{ $(this).css({'display' : 'none'}); } } </code></pre> <p>The HTML:</p> <pre><code> &lt;span class='left'&gt;&lt;label for='race'&gt;Race: &lt;/label&gt;&lt;/span&gt; &lt;span class='right'&gt;&lt;select name='race' id='race' onchange='showHideOther(this);'&gt; &lt;option&gt;Select one&lt;/option&gt; &lt;option&gt;one&lt;/option&gt; &lt;option&gt;two&lt;/option&gt; &lt;option&gt;three&lt;/option&gt; &lt;option value="other"&gt;Other&lt;/option&gt; &lt;/select&gt; &lt;/span&gt; </code></pre> <p>It is probably something small that I am not noticing, what am I doing wrong?</p> <p>Thanx in advance!</p>
javascript jquery
[3, 5]
3,584,772
3,584,773
Java FileNotFoundException though the file exists.
<pre><code>package com.test.methods; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import android.R; import android.app.Activity; import android.app.ListActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView; import com.crumbin.main.R.color; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; public class JsonParserActivity extends Activity { String strLine = null; String[] values = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(com.main.R.layout.user_main); // Open the file that is the first // command line parameter try { FileInputStream fstream = new FileInputStream("/home/hic/jdata.txt"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); //Read File Line By Line while ((br.readLine()) != null) { // Print the content on the console strLine = strLine + br.readLine(); } this.parse(strLine); //Close the input stream in.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } parse(strLine); ListView contactLV = (ListView) findViewById(com.crumbin.main.R.id.user_contact_list); ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,com.main.R.layout.user_contact_list_item,com.main.R.id.contact_name,values); contactLV.setAdapter(adapter); } public void parse(String jsonLine) { JsonElement jelement = new JsonParser().parse(jsonLine); JsonObject jobject = jelement.getAsJsonObject(); JsonArray jarray = jobject.getAsJsonArray("contact"); jobject = jarray.get(0).getAsJsonObject(); values[0]= jobject.get("user").toString(); } } </code></pre> <p>I've tried file.CanRead() and file.exist() and both return False. The file exists. Also, the file is not being read by any other process. </p>
java android
[1, 4]
5,127,835
5,127,836
get php output from asp.net mvc
<p>good day </p> <p>we are working on mvc webpage using c# and we are on the making of a getting php output to display on a mvc webpage. we have 1 page created in php with the filename "hello.php" and it displays "hello word"</p> <p>we have place the code for calling the page in a usercontrol, but when place it in the site.master ad run it gives us the code of hello.php and not the "hello world.</p> <p>our usercontrol code is as follows </p> <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %&gt; &lt;%@ Import Namespace="System.IO" %&gt; &lt;script runat="server"&gt; protected void Page_Load(object sender, EventArgs e) { string file = Server.MapPath("Hello.php"); StreamReader sr; FileInfo fi = new FileInfo(file); string input = ""; if (File.Exists(file)) { sr = File.OpenText(file); input += Server.HtmlEncode(sr.ReadToEnd()); sr.Close(); } Response.Write(input); } &lt;/script&gt; </code></pre> <p>hope for anyone's response</p>
php asp.net
[2, 9]
1,657,175
1,657,176
how to create my own color name
<p>Given the following statement:</p> <pre><code>$('#upLatImb').append('&lt;span style="color:#F62817; text-decoration:blink"&gt;' + sprintf("%11.0f",fCargoLatMom).replace(/ /g,'&amp;nbsp;') + '&lt;/span'); </code></pre> <p>I would like to do something like:</p> <pre><code>var problemcolor=0xF62817; $('#upLatImb').append('&lt;span style="color:problemcolor; text-decoration:blink"&gt;' + sprintf("%11.0f",fCargoLatMom).replace(/ /g,'&amp;nbsp;') + '&lt;/span'); </code></pre> <p>but that results in numerous html errors.</p> <p>I could, of course, do a search and replace across all .js files to change the color, but I'd like to use logical names if possible and only change one statement per color.</p> <p>I'm just barely above absolute novice level, so all suggestions are most welcome.</p>
javascript jquery
[3, 5]
3,629,663
3,629,664
Options doesn't show up when hardware menu is pressed
<p>I have 2 devices on which i am testing my application, a Galaxy Nexus and a Desire HD (which has hardware buttons)</p> <p>I am implementing the menu like this</p> <pre><code>@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.feedback: Intent i = new Intent(Intent.ACTION_SEND); i.setType("message/rfc822"); i.putExtra(Intent.EXTRA_EMAIL , new String[]{"[email protected]"}); i.putExtra(Intent.EXTRA_SUBJECT, " feedback"); i.putExtra(Intent.EXTRA_TEXT , ""); try { startActivity(Intent.createChooser(i, "Send mail...")); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(MainActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show(); } return true; case R.id.about: Toast.makeText(MainActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show(); return true; default: return true; } } @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.activity_main, menu); return true; } </code></pre> <p>On the galaxy nexus the action bar menu button shows up, and it inflates the menu and everything works fine. On the Desire HD in the action bar the menu button doesn't show up because i have hardware buttons, but if i press the hardware menu button nothing happens.</p> <p>how can i fix this?</p> <p>EDIT: this is my xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:id="@+id/feedback" android:icon="@drawable/ic_launcher" android:title="Feedback" android:showAsAction="never"/&gt; &lt;item android:id="@+id/about" android:icon="@drawable/ic_launcher" android:title="About" /&gt; &lt;/menu&gt; </code></pre>
java android
[1, 4]
770,000
770,001
C# Matrix to Android Matrix?
<p>I have some code here in C#</p> <pre><code> //take a world Vector2D and make it a relative Vector2D public Vector2D WorldToRelative(Vector2D world) { Matrix mat = new Matrix(); PointF[] Vectors = new PointF[1]; Vectors[0].X = world.X; Vectors[0].Y = world.Y; mat.Rotate(-m_angle / (float)Math.PI * 180.0f); mat.TransformVectors(Vector2Ds); return new Vector2D(Vectors[0].X, Vectors[0].Y); } </code></pre> <p>The problem is android's Matrix does not seem to have rotate and transform vector.</p> <p>It has pre and post rotation and mapping vectors.</p> <p>What could I do to correctly port this code to android?</p> <p>Thanks</p>
c# java android
[0, 1, 4]
530,186
530,187
Set GridView Value ItemStyle ForeColor based on Row/Column Value
<p>I have an ASP.net GridView that spits out three columns of data: (OrderNumber, OrderStatus, and OrderDate).</p> <p>I want to set the OrderStatus Field Value = RED IF the status = "Cancelled"</p> <p>I am not sure how to look at the value of that field for each row of the output and determine if the status is Cancelled...then if it is set the color to RED.</p> <p>ASP.net GridView:</p> <pre><code>&lt;asp:GridView ID="gvOrders" runat="server" AutoGenerateColumns="False" GridLines="None" AllowPaging="true" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" &gt; &lt;Columns&gt; &lt;asp:BoundField DataField="OrderNumber" HeaderText="OrderNumber" SortExpression="OrderNumber" /&gt; &lt;asp:BoundField DataField="OrderStatus" HeaderText="OrderStatus" SortExpression="OrderStatus" /&gt; &lt;asp:BoundField DataField="OrderDate" HeaderText="OrderDate" SortExpression="OrderDate" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>C# DataBinding: </p> <pre><code>protected void navOrders_Onclick(object sender, BulletedListEventArgs e) { switch(e.Index) { case 0: //Orders DataTable dt = Procedures.GetOrderData(); gvOrders.DataSource = dt; gvOrders.DataBind(); break; } } </code></pre> <p>Any suggestions would be greatly appreciated.</p> <p>Thanks as always,</p> <p>S</p>
c# asp.net
[0, 9]
4,051,440
4,051,441
disable/enable outside asp button control on datalist checkbox checked javascript?
<p>I have a datalist inside that I am using a checkbox, I have 1 asp button and 2 image buttton which is outside of datalist something like this</p> <pre><code> &lt;asp:DataList ID="dlst1" runat="server" RepeatDirection="Horizontal" OnItemDataBound="dlst1_ItemDataBound" CaptionAlign="Left"&gt; &lt;ItemTemplate&gt; &lt;asp:ImageButton ID="btnImage" runat="server" /&gt; &lt;asp:CheckBox ID="Chkbox" runat="server" TextAlign="Right" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:DataList&gt; &lt;asp:Button ID="Button1" runat="server" Enabled="false" Text="Delete" /&gt; &lt;asp:ImageButton ID="ibtnok" runat="server" Enabled="false" /&gt; </code></pre> <p>I want to enable the Button1 and ibtok when any one checkbox is checked and disable the Button1 and ibtnok when no checkbox is checked.</p> <p>someone plz help me how to do that with javascript?</p>
c# javascript asp.net
[0, 3, 9]
2,420,924
2,420,925
How to apply tax, discount to invoice using jQuery
<p>How to apply Tax, discount to subtotal and calculate grand total??</p> <p>I have these paragraphs with the following ID's</p> <pre><code>&lt;p id="subtotal"&gt;15000&lt;/p&gt; &lt;p id="tax"&gt;10&lt;/p&gt; // In percentage &lt;p id="discount"&gt;1000&lt;/p&gt; &lt;p id="grandtotal"&gt;&lt;/p&gt; // Grandtotal will be calculated and displayed here using jquery </code></pre> <p>The grand total would be 15000 + (1500 //tax) - (1000 //discount) = 15500</p> <p>How do i calculate this using jQuery?</p>
javascript jquery
[3, 5]
2,846,736
2,846,737
need to understand eval in the code for ajax response
<p>The following code already exists in one of the javascript files i am working , may i know what does the following do</p> <p>Its jquery ajax , i saw the response result and its a json string which is manually created by the backend.</p> <p>I want to know what is eval doing here</p> <pre><code>success: function (response) { var response= response.replace(/\\/g, "%5C"); eval(response); }, </code></pre>
javascript jquery
[3, 5]
1,975,742
1,975,743
Expandable Listview Group Indicator half off screen?
<p>I am using a custom Group indicator as shown in the code below. Now if I leave the default I can use setBounds perfectly, but when using my custom image which is the same dimensions and setup as the same .9 patch file it is always half off screen. No matter what values I use for setBounds()</p> <pre><code> Drawable plus = (Drawable) getResources().getDrawable(R.drawable.expander_group); getExpandableListView().setGroupIndicator(plus); Display newDisplay = getWindowManager().getDefaultDisplay(); int width = newDisplay.getWidth(); getExpandableListView().setIndicatorBounds(0,0); </code></pre> <p>XML expander_group</p> <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_expanded="true" android:drawable="@drawable/minus" /&gt; &lt;item android:drawable="@drawable/plus" /&gt; &lt;/selector&gt; </code></pre> <p>EDIT:</p> <p>Interestingly. I have copied the exact xml and image files from the standard Android files. And when I use the above method to define it the exact same thing happens! So it is not the xml or image files that are causing the issue I think.</p> <p><img src="http://i.stack.imgur.com/GZD55.png" alt="enter image description here"></p>
java android
[1, 4]
1,731,749
1,731,750
TextChanged event only fires when I put my cursor in the textbox and change the text
<p>I have a TextChanged Even on a textbox and when I enter data into it, it updates another textbox which in turn is supposed to fire a TextChanged Event, but it is not firing until I put my cursor in the TextBox. Is there a solution to this?</p> <p>Code for updating the Extended Price when Qty Changes:</p> <pre><code>protected void txtQty1_TextChanged(object sender, EventArgs e) { if (txtQty1.Text != string.Empty &amp;&amp; txtUnitPrice1.Text != string.Empty) { int qty = Convert.ToInt32(txtQty1.Text); double unitPrice = Convert.ToDouble(txtUnitPrice1.Text); double extendTotal1 = qty * unitPrice; txtExtPrice1.Text = extendTotal1.ToString(); } } </code></pre> <p>Code for updating the extending price When Unit Price changes:</p> <pre><code> protected void txtUnitPrice1_TextChanged(object sender, EventArgs e) { if (txtQty1.Text != string.Empty &amp;&amp; txtUnitPrice1.Text != string.Empty) { int qty = Convert.ToInt32(txtQty1.Text); double unitPrice = Convert.ToDouble(txtUnitPrice1.Text); double extendTotal1 = qty * unitPrice; txtExtPrice1.Text = extendTotal1.ToString(); } } </code></pre> <p>Finally, this should update the Grand Total When Extending Price Changes:</p> <pre><code> protected void txtExtPrice1_TextChanged(object sender, EventArgs e) { if (txtExtPrice1.Text != string.Empty) { double extendedTotal1 = Convert.ToDouble(txtExtPrice1.Text); double grandTotal = Convert.ToDouble(txtGrandTotal.Text); grandTotal += extendedTotal1; txtGrandTotal.Text = grandTotal.ToString(); } } </code></pre> <p>Is it true that I should probably make Grand Total a Static Variable?</p>
c# asp.net
[0, 9]
4,514,262
4,514,263
Pass a javascript variable to a php function
<p>I would pass a variable javascript to a php function but it doesn't work.</p> <p>I call my javascript function in <code>&lt;a href='javascript:showDetail(5);'&gt;detail&lt;/a&gt;</code></p> <p>and this is the javascript function where call my <code>showInfo</code> php function</p> <pre><code>function showDetail(id) { $.ajax({ type: 'POST', data: {valore: id} }); var add = "&lt;?php showInfo($_GET['valore']); ?&gt;"; document.getElementById("detail").innerHTML = add; } </code></pre> <p>Where is my error? I call my function in the same page, without refreshing it.</p>
php javascript
[2, 3]
635,115
635,116
tinycarousel scrolling doesn't work in a default android browser
<p>I implemented tinycarousel for my little project and it works almost in all browsers, but scrolling doesn't work in a default android browser and I dunno how to debug it or fix, could anyone help me, please. Maybe anyone have the same issue?</p> <p>Here is a simple code, which I use for this carousel:</p> <pre><code>$('#videoResume .videoResumeHolder').tinycarousel({interval: false, pager: true}); </code></pre>
android jquery
[4, 5]
5,836,353
5,836,354
How to tell the difference between a page refresh and closing a page
<p>I have a web app game and while in the game I want to have it so if a user closes the page or their browser, it will automatically log them out. I tried using the onbeforeunload event attached to the window:</p> <pre><code>window.onbeforeunload = function() { // perform logout functions here } </code></pre> <p>The problem is, that will also fire if the user refreshes the page. Is there a way I could detect whether or not the user is completely closing the whole page, or just refreshing it?</p>
php javascript
[2, 3]
5,802,223
5,802,224
Open main-activity one time
<p>For my news-reader app, I made a widget. Using the widget it is possible to start the news-app. But if the user goes back to the home screen, with the back button, there still is an instance of the application. So if the user goes the applications-list (all the app's) and start the news-app again. There are 2 instances of the news app :S For closing the app, the users needs to push 2 times on the back button (because you see 2 times the same app). Can I do anything about it?</p> <p>Here my code:</p> <pre><code>static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId) { Intent configIntent = new Intent(context, Main.class); PendingIntent configPendingIntent = PendingIntent.getActivity(context, 0, configIntent, 0); RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget); remoteViews.setOnClickPendingIntent(R.id.headlinesBox, configPendingIntent); // Tell the widget manager appWidgetManager.updateAppWidget(appWidgetId, remoteViews); </code></pre> <p>}</p>
java android
[1, 4]
1,845,826
1,845,827
Canvas game not updating score?
<p>Hello I have made a snake game and all it good except I want to update a textfield if the score is higher than the previous score when they die, eventually I will make a top 10 list etc.</p> <p>the code I have is: </p> <pre><code>score2 = document.getElementsByName('updateScore').value; if(score &gt; score2) { document.getElementById('updateScore').innerHTML = score; } </code></pre> <p>This gets called in the init method before the score is reset for the net game when they die</p> <p>you can view game and source here: <a href="http://www.taffatech.com/Snake.html" rel="nofollow">http://www.taffatech.com/Snake.html</a></p>
javascript jquery
[3, 5]
2,507,956
2,507,957
Can't get two functions to initialize each other
<pre><code>function funcA() { var fB; function init() { fB = new funcB(false); //error here } init(); } function funcB(usefuncA) { var fA; function init() { if (usefuncA) fA = new funcA(); } init(); } $(function() { var test = new funcB(true); }); </code></pre> <p>I know how to get around this problem in C++, but no idea what tricks there are to fix it in javascript. There is a way, though, right? I absolutely must have each function in the other, and the only other alternative I can think of is putting the contents of funcB in its own .js file then using PHP to create two versions of funcB, one for funcA to use and one in current place of funcB. But that's ridiculous...</p>
javascript jquery
[3, 5]
4,295,361
4,295,362
Converting String to Message Object Android Application
<p>How can I convert a string to an Object of Message Type?</p> <p>as shown below: </p> <pre><code>String str= "Hello"; Message msg ; // I want to assign str to msg.. </code></pre> <p>thanks .. </p>
java android
[1, 4]
3,864,661
3,864,662
Design question on web application
<p>I want to design a web application running inside tomcat to do interact with the backend database. What's the framework you could recommend to adopt? Spring MVC or Struts? Also, which works better with JQuery if needing Javascript in the frontend. Also, heard about Tapestry/ Webworks, how is that fit into the role?</p>
java jquery
[1, 5]
3,317,319
3,317,320
How do I pass any validation control to a method?
<p>I am creating a webform using ASP.NET and C#. I created a method that posts an error message which is picked up by the Validation Summary control. </p> <pre><code>protected void PostErrorToCusVal(ref System.Web.UI.WebControls.CustomValidator ErrorObj, string ErrHead, string ErrMsg) { ErrorObj.ErrorMessage = "*SomeHTML/CSS*" + ErrHead + "*SomeHTML/CSS*" + ErrMsg + "*SomeHTML/CSS*"; } </code></pre> <p>I am having trouble passing anything other than a CustomValidator control to it. I want to be able to pass any validation control to it and set the ErrorMessage property. I tried using using BaseValidator and casting, but that wouldn't work. Is it possible for this to be done?</p> <p>Thanks, Ozzy</p>
c# asp.net
[0, 9]
5,137,772
5,137,773
JQuery Vs. C#: Using a master textbox
<p>I have a list of 100+ textboxes on my page. I want to have one textbox at the top that can change all of them to its value, yet still have the others able to be independent (as in, using one variable for all wouldn't work). They should be able to be changed individually, with the master one sort of acting as a "Change All".</p> <p>My question is, would this work better by looping through and doing a postback in c#? Or can I dynamically change them all in jquery? Which would you recommend?</p>
c# javascript jquery
[0, 3, 5]
2,281,673
2,281,674
how do I clear the values in my text input fields?
<p>My code doesn't run and I want the value to be cleared when you click on another </p> <p>what am I doing wrong?</p> <p><a href="http://jsfiddle.net/AL2vS/" rel="nofollow">http://jsfiddle.net/AL2vS/</a> </p> <pre><code>var placeholderText = $('input').val(); $(placeholderText).focus(function() { $(this).attr('value', ""); }); $(placeholderText).blur(function() { $(this).attr('value', phTextVal); });​ </code></pre>
javascript jquery
[3, 5]
1,551,178
1,551,179
jCrop / PHP upload problem
<p>Hey guys, I am not very familiar with jquery &amp; am trying to implement jCrop + upload via PHP. I found exactly what I needed ( <a href="http://webdevcodex.com/mashup-application-image-uploader-cropper-using-jquery-php/" rel="nofollow">http://webdevcodex.com/mashup-application-image-uploader-cropper-using-jquery-php/</a> ) and attempted to use it but the script is not going past step 6 (from the demo code). </p> <p>I am able to upload an image to the folder &amp; it will let me select an area to crop, but that's where it ends. When I hit 'crop image' it says "here is your cropped image:)" but does not show anything nor has it uploaded anything. </p> <p>I checked to make sure the folder permissions are set proper &amp; they are. Donno why it's not working. Any pointers?</p>
php javascript jquery
[2, 3, 5]
1,838,820
1,838,821
Passing parameters to popup window?
<p>I am trying to pass parameters to a popup window via query string(a hidden field id &amp; a textbox id). However, since I am using master pages the id's are very long (ct100_someid). Is there a way to elegantly pass my ids ?Can I shorten my id's or not show them to the user at all ? Please tell me any alternates. </p>
javascript asp.net
[3, 9]
5,378,350
5,378,351
How to get a byte array from FileInputStream without OutOfMemory error
<p>I have a FileInputStream which has 200MB of data. I have to retrieve the bytes from the input stream.</p> <p>I'm using the below code to convert InputStream into byte array.</p> <pre><code>private byte[] convertStreamToByteArray(InputStream inputStream) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { int i; while ((i = inputStream.read()) &gt; 0) { bos.write(i); } } catch (IOException e) { e.printStackTrace(); } return bos.toByteArray(); } </code></pre> <p>I'm getting OutOfMemory exception while coverting such a large data to a byte array. </p> <p>Kindly let me know any possible solutions to convert InputStream to byte array.</p>
java android
[1, 4]
3,329,154
3,329,155
Javascript order on which functions are being called
<p>Hi I am still pretty new to programming and I haven't had the chance to fully understand Java or Javascript the only programming languages I know but I am trying really hard to understand Javascript.</p> <p>What I am facing is that some times I do not understand when javascript is calling my created functions for example. I have created a small plugin for jQuery: <a href="http://jsfiddle.net/a9gjK/1/" rel="nofollow">http://jsfiddle.net/a9gjK/1/</a></p> <p>The plugin is very easy the images are set on top of each other using position absolute. I then take the first image and set the z-index to 100 then I take the next image and set it's z-index to 50 after this I take the first image again and fade it to 0 opacity, then I call a callback function witch sets the first image's z-index to 0 and fade it to 1 opacity and the next image's z-index to 100.</p> <p>After this hole process is done the variable first is set to the next element.This is where my problem appears. If I set the variable first to the next img inside the callback function the plugin works well and everything is well, but if I do this outside the callback function after the script is ran once on each image and has to start again from the first image when it fade's out I see the background. This doesn't happen if I set the first image to next inside the callback function.</p> <p>Can anyone explain why this is happening and on what topic is this related so I can read and understand better what's happening.</p>
javascript jquery
[3, 5]
4,995,142
4,995,143
combining js scripts from a js newb
<p>I've got a small .js file on my wp site where I have been adding in all of my small js scripts. It works perfectly, but I am stuck trying to figure out how to add in another script. So far jslint does not complain about my current file and says it is ok.</p> <p>my script:</p> <pre><code>jQuery(function ($) { function mycarousel_initCallback(carousel) { jQuery('.jcarousel-control a').bind('click', function() { carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text())); return false; }); jQuery('.jcarousel-scroll select').bind('change', function() { carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value); return false; }); // Next Button $('#mycarousel-next').bind('click', function() { carousel.next(); return false; }); // Prev Button $('#mycarousel-prev').bind('click', function() { carousel.prev(); return false; }); }; } </code></pre> <p>The script I want to add in starts like this:</p> <pre><code>jQuery(document).ready(function($) { var gallery = $('#thumbs').galleriffic({ delay: 3000, // in milliseconds }); }); </code></pre> <p>Where I keep getting stuck, is that I am finding a lot of scripts that start with the jQuery(document) part. When I try to add scripts that begin like that then everything breaks.</p> <p>I'm guessing this is a really stupid question, but what do I need to change in the new addon script so that it will play nice with my current file?</p> <p>thank you for your help and time on this one. Trying hard to learn js though it's a slow process here.</p>
jquery javascript
[5, 3]
5,920,847
5,920,848
wrapping plain javascript object in jquery $({})
<p>I have this fragment of code from a book I am reading. And want to understand what <code>$({})</code> means and what is its use exactly.</p> <p>I tried searching on several search engines and even on SO. <code>$({})</code> wasn't a search-friendly term. </p> <pre><code> var Events = { bind: function(){ if ( !this.o ) this.o = $({}); this.o.bind.apply(this.o, arguments); }, trigger: function(){ if ( !this.o ) this.o = $({}); this.o.trigger.apply(this.o, arguments); } }; </code></pre> <p>I did find a similar <a href="http://stackoverflow.com/questions/3587372/what-does-mean-in-jquery">question</a> about <code>$([])</code> but I don't think it is quite the same thing.</p>
javascript jquery
[3, 5]
591,240
591,241
Passing TextBox value from jquery dialog to variable in a function
<p>I have the following files:</p> <p>FILE1.ASPX</p> <pre><code>function DDialog(url, title, height, width) { HideDialogs(); var dialogButtons = [{ text: "Save", click: function () { var data = {}; data.HolidayDate = $('#txtHireDate').val(); alert(data.HolidayDate); var jsondata = $.toJSON(data); ajaxManager.add({ type: "POST", url: "ChangeHireDate.aspx/DoIt", data: jsondata, contentType: "application/json; charset=utf-8", dataType: "text json", beforeSend: function (xhr) { xhr.setRequestHeader("Content-type", "application/json; charset=utf-8"); }, success: function (msg) { alert("WORKS"); }, /* error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Could not save holiday."); }*/ error: function (xmlRequest) { alert(xmlRequest.status + ' \n\r ' + xmlRequest.statusText + '\n\r' + xmlRequest.responseText); } }); ... </code></pre> <p>FILE2.ASPX (dialog window) TextField gets date from calendar extender</p> <p>Problem is I dont know how to pass the date from the textfield to the data.HolidayDate when the button is clicked.</p>
javascript jquery asp.net
[3, 5, 9]
4,427,499
4,427,500
Making a specific <select> option automatically check and disable check box in another form field
<p>I have a very simple form for uploading a file. In the form, there's a dropdown menu where you can choose a category for the file you're uploading. I also have another checkbox which is by default unchecked. How can I make it so that if the third in the dropdown is selected, the checkbox is automatically checked and disabled? Thanks for your help.</p>
javascript jquery
[3, 5]
5,763,026
5,763,027
How to convert hover function with on in jquery
<p>I have this code</p> <pre><code>$("td").hover(function(){ $(this).find('a.btn').show(); }, function(){ $(this).find('a.btn').hide(); }) </code></pre> <p>How can i convert this function for new dom elements with <code>on</code></p>
javascript jquery
[3, 5]
2,957,526
2,957,527
Know how of Cross Domain Request in Jquery
<p>Can anyone please explain how jquery handles cross domain requests? I understand the theory that it does via script using src attribute as url. But i was trying to test the same thing in plain javascript . I need to know the sequence of activities to be done for a post request. at what stage the data is sent and script element is constructed ? I am tired of asking the same at different forums where i got to see links explaining CORS. i need a to-do solution here. Thanks</p> <p>PS: sorry if i am asking too much :)</p>
javascript jquery
[3, 5]
3,906,913
3,906,914
Scope in jQuery(javascript)
<p>I simplified my code for next example. So, please don't be wondered why I'm using ajax here.</p> <pre><code> &lt;!DOCTYPE&gt; &lt;head&gt; &lt;style&gt;.not { background:yellow; }&lt;/style&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $(".not").click(function(e){ e.stopPropagation(); alert('good'); }); $(".click").click(function(e){ $.post('page2.php', 'q=1', function(data){ $('body').append('&lt;p class="click"&gt;Click here to add new paragraph &lt;span class="not"&gt;[not here]&lt;/span&gt;&lt;/p&gt;'); }, "json"); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p class="click"&gt;Click here to add new paragraph &lt;span class="not"&gt;[not here]&lt;/span&gt;&lt;/p&gt; &lt;/body&gt; </code></pre> <p>New rows don't make any alert for class=not! It is inexplicably for me :'(</p> <p>Thanks for unswer!</p>
javascript jquery
[3, 5]
4,173,744
4,173,745
How to know which button clicked using this.Request.Form
<p>I am using .net 1.1 In My page,i have few <code>ImageButtonClientSide</code> Controls and some other buttons which causes <code>postback.Now</code> I want to know,when page postbacks,In <code>Page_Load</code> which control has been clicked?I am currently doing like this </p> <pre><code> if ( Check.IsNotNulOrBlank(this.Request.Form["__EVENTTARGET"]) ) { if(this.Request.Form["__EVENTTARGET"].Equals("imgButtonSearch")) { } } </code></pre> <p>But <code>this.Request.Form["__EVENTTARGET"]</code> is showing empty values.</p>
c# asp.net
[0, 9]
4,053,466
4,053,467
Basic jQuery function
<p>Could someone please explain, why do we need <strong>each(function <code>(i)</code></strong> what does <code>(i)</code> do? seems like <strong><code>i</code></strong> could be any letters. why <code>(i)</code> is necessary? I don't quite understand. Many Thanks </p> <pre><code>&lt;body&gt; &lt;div&gt;Click here&lt;/div&gt; &lt;div&gt;to iterate through&lt;/div&gt; &lt;div&gt;these divs.&lt;/div&gt; &lt;script&gt; $(document.body).click(function () { $( "div" ).each(function (i) { if ( this.style.color != "blue" ) { this.style.color = "blue"; } else { this.style.color = ""; } }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,144,361
2,144,362
jQuery Validation to Restrict A Textbox to only dd/mm/yyyy
<p>Is there a jQuery method or workaround that someone has found that will not let the user type anything but dd/mm/yyyy in a textbox ?</p> <p>Thanks</p>
asp.net javascript jquery
[9, 3, 5]
279,736
279,737
Making dyanamic link in dot net
<p>I want a functionality in which i want following thing:</p> <p>when i open a page created by me for download, it should dynamically create links for all the documents present in particular directory.</p> <p>for eg: if i have folder at web server as /download/document and i have following document in this folder</p> <p>a.txt b.txt c.doc d.pdf</p> <p>now when i open page then i should have 4 links each for these of documents n when i click on this link, the file can be downloaded</p>
c# asp.net
[0, 9]
2,448,079
2,448,080
jquery: using appendTo in second to last row of table
<p>I have a piece of the DOM that I'd like to insert into my page. Currently I'm just blindly using:</p> <pre><code>$(myblob).appendTo(someotherblob); </code></pre> <p>How do I do the same thing, but append myblob to the second to last row that is within someotherblob. someotherblob in this case is a table and I want to inject a row above the second to last one.</p>
javascript jquery
[3, 5]
4,886,751
4,886,752
Jquery-Object expected
<p>Can somebody tell me why Jquery is erroring out at this point?</p> <pre><code> &lt;script type="text/javascript" language="javascript"&gt; var myLayout; // a var is required because this page utilizes: // myLayout.allowOverflow() method $(document).ready(function() { myLayout = $('body').layout({ // enable showOverflow on west-pane // so popups will overlap north pane // west__showOverflowOnHover: true }); }); &lt;/script&gt; </code></pre>
asp.net jquery
[9, 5]
2,382,179
2,382,180
Adding numbers together
<p>I have this Jquery code and i need to add the var data and a number together...</p> <pre><code>$('div[name=price]').html(""); $.post("getprice.php", { unit: $('input[name=property]:checked').val() , date: $('#car').val() + $('#smh').val() } ,function(data){ $('div[name=price]').html(data + 1); $('#bprice').val(data); }); </code></pre> <p>But data equals 499 but it just displays as 4991 when it should say 500</p> <p>Thanks</p> <p>Lee</p>
javascript jquery
[3, 5]
404,586
404,587
Regex for negative decimal values client and server side c# jquery
<p>I have a keypress function bound to an element, this element needs to only allow positive and negative decimal characters. i.e. 0-9, '.' , '-'</p> <p>any other characters I need to prevent the character being inputted</p> <p>Is there any way to achieve this in the current keypress function</p> <pre><code> $('.test').keyup(function (event) { //if character is NOT ok i.e. 0-9, '.' , '-' //STOP ..ELSE //continue to do something }); </code></pre> <p>P.s. I am using jquery</p>
javascript jquery
[3, 5]
2,398,303
2,398,304
populate datagrid with codebehind dropdownlist value
<p>i have the following query in asp.net codebehind</p> <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Server=hussein-pc;database=datbase;integrated security=true" SelectCommand="SELECT * FROM [Spreadsheet]...... </code></pre> <p>where spread sheet is the name of a table i want to change the name of the table according to the value of my drop down list in asp.net code behind! </p>
javascript asp.net
[3, 9]
4,728,688
4,728,689
PHP : how to return back to previous page while closing pop up
<p>I have a form submission. While i Click Submit button, will check for mandatory fields and if the fields are blank, I am opening a popup window using javascript to show error message. So once I close the popup I am not going back to previous page Instead it shows a white blank screen.</p> <p>My code for verification and opening popup is :</p> <pre><code>&lt;?php if (isset($_POST['submit'])) { if ($task == '' || $comments == '') { // generate error message print "&lt;script type='text/javascript'&gt;"; print "window.open('error.php','new_window1','status=1,scrollbars=1,resizable=0,menu=no,width=320,height=220');"; print "&lt;/script&gt;"; } else { $sql3= "INSERT INTO work (task, comments, assignee, type, priority, dataum1, dataum2, status) VALUES ('$task', '$comments', '$assignee', '$type', '$priority', '$dataum1', '$dataum2', '$status')"; mysqli_query($mysqli,$sql3) or die(mysqli_error($mysqli)); } } ?&gt; </code></pre>
php javascript
[2, 3]
1,653,826
1,653,827
AndroidManifest.xml errors
<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android"&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name"&gt; &lt;activity android:name=".hba1c" android:label="@string/app_name" android:screenOrientation="portrait"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; </code></pre> <p> </p> <p>I'm trying to learn Java and need some help with AndroidManifest.xml </p> <p>My little hello world project is working code-wise, but I'm confused with making changes to the manifest. Specifically, in the code above package name is "com.android" and in data/app my app shows up as com.android-1.apk. When I try to change it to something like com.jocala or com.jocala.hba1c I get package R does not exist errors through my compile, which fails.</p> <p>What changes do I need to make? Anything else here that is glaringly bad?</p> <p>I am working using ant,vi and the linux console. No eclipse.</p>
java android
[1, 4]
3,570,501
3,570,502
C# Url Builder Class
<p>I often end up rolling my own wrapper/extension methods for/around System.Uri and was wondering if anyone knows of a good open source implementation. What I like to do most is parse querystring parameters, build a new query string (this is the key), and replace page names. Got any good ones, or is System.Uri good enough for you?</p>
c# asp.net
[0, 9]
4,449,325
4,449,326
How to remove line breaks with PHP or JS
<p>I've tried about everything to delete some extra <code>\n</code> characters in a web application I'm working with. I was hoping someone has encountered this issue before and knows what can be causing this. All my JS and PHP files are UTF-8 encoded with no BOM.</p> <p>And yes I've tried things like</p> <p>In JS:</p> <pre><code>text.replace(/\n/g,"") </code></pre> <p>In PHP:</p> <pre><code>preg_replace("[\n]","",$result); str_replace("\n","",$result); </code></pre> <p>and when I try </p> <pre><code> text.replace(/\n/g,"") </code></pre> <p>in the firebug console using the same string I get from the server it works but for reason it doesn't work in a JS file.</p> <p>I'm desperate, picky and this is killing me. Any input is appreciated.</p> <p><strong>EDIT:</strong></p> <p>If it helps, I know how to use the replace functions above. I'm able to replace any other string or pattern except <code>\n</code> for some reason.</p> <p><strong>Answer Explanation:</strong></p> <p>Some people do and use what works because it just works. If you are like me and for the record I always like to know why what works WORKS!</p> <p>In my case:</p> <p>Why this works? <code>str_replace('\n', '', $result)</code></p> <p>And this doesn't? <code>str_replace("\n", '', $result)</code></p> <p>Looks identical right? Well it seems that when you enclose a string with a character value like <code>\n</code> in double quotes <code>"\n"</code> it's seen as it's character value NOT as a string. On the other hand if you enclose it in single quotes <code>'\n'</code> it's really seen as the string <code>\n</code>. At least that is what i concluded in my 3 hours headache.</p> <p>If what I concluded is a setup specific issue OR is erroneous please do let me know or edit. </p>
php javascript
[2, 3]
4,195,901
4,195,902
File input output question with Inputstreamreader
<p>I made an android app which writes to a file in an activity. The writing to file, it works like a charm: <pre>FileOutputStream fOut = openFileOutput("myfeeds.txt", MODE_WORLD_READABLE); OutputStreamWriter osw = new OutputStreamWriter(fOut); osw.write(file); osw.flush(); osw.close();</pre> But when I want to read it back from another acivity it can't find the file...the file exists I checked with DDMS file explorer. Reading file contents:</p> <pre> FileInputStream fis = new FileInputStream("myfeeds.txt"); // cant find file InputSource input = new InputSource(fis); xr.setContentHandler(this); xr.parse(input); </pre> <p>What is the correct location to my file?</p>
java android
[1, 4]
3,755,960
3,755,961
Check for required exact keyword(s) in text (javascript)
<p>I need to be able to check for required keyword(s).</p> <p>Here's what i'm currently using:</p> <pre><code> // Check for all the phrases for (var i = 0; i &lt; phrases.length; i++) { if (value.toLowerCase().indexOf(phrases[i].toLowerCase()) &lt; 0) { // Phrase not found missingPhrase = phrases[i]; break; } } </code></pre> <p>The problem is that it'll say 'random' is fine if 'randomize' is included.</p> <p>I found this: <a href="http://stackoverflow.com/questions/4785340/how-to-check-if-text-exists-in-javascript-var/4785521#4785521">how to check if text exists in javascript var</a> (just an example)</p> <p>But not sure of the best way to incorporate it in jQuery with the possibly to check for multiple keywords.</p>
javascript jquery
[3, 5]
5,894,769
5,894,770
Extract string from img src attribute?
<p>How could i take fontsize, fonttext and fonttype value from following img src <br></p> <pre><code>&lt;img src="bin/contenthandler.php?fontsize=36&amp;fonttext=apple&amp;fonttype=fonts/FOO.ttf" class="selected content resizable"&gt; </code></pre> <p>I think it can be done with regular expressions but I am bad with them. </p>
javascript jquery
[3, 5]
3,973,563
3,973,564
Stop Countdown Timer Javascript onClick
<p>Given the Following code:</p> <pre><code> $('#myButton02').click(function(){ $('#myButton02').hide(); $('#counter').animate({width: 'toggle'}); var count=65; var counter=setInterval(timer, 1000); function timer(){ count=count-1; if (count &lt;= 0){ clearInterval(counter); return; } document.getElementById("secs").innerHTML=count + " segs.";} }); $('#myButton03').click(function(){ recognition.stop(); $('#myButton02').show(); $('#counter').toggle(); }); </code></pre> <p>I can have the following workflow:</p> <ul> <li>User clicks a button, that button gets replaced by another one.</li> <li>A div appears with a countdown timer of 65 seconds.</li> </ul> <p>If the user clicks the other button (the one wich replaced the first one) the first button appears again hiding the second one and then the appeared div (#counter) dissapears. <strong>The problem is</strong>, when the user clicks the first button again, the countdown timer goes nuts and starts toggling random numbers instead of starting a new countdown (only if the user clicks it again before the first countdown stops).</p> <p>How can I make the timer stops the countdown when <strong>"#myButton03"</strong> gets clicked so it "reboots itself" every time you click <strong>"#myButton02"</strong> without going nuts?</p>
javascript jquery
[3, 5]
5,382,248
5,382,249
How best to deal with dynamic page settings in a C# ASP.NET web application?
<p>I have a single page that has a number of controls configured a certain way depending on some condition (e.g. if it is a user accessing the page or an admin). How I currently achieve this is by having an interface for the settings which are common to all pages, and then extending classes which implement the properties specific to the type of user.</p> <p>For example:</p> <pre><code>public interface Display_Type { string backgroundColor { get; } } public class AdminPage : Display_Type { string backgroundColor { get { return "orange"; } } } public class UserPage : Display_Type { string backgroundColor { get { return "blue"; } } } </code></pre> <p>And my page's codebehind:</p> <pre><code>public partial class MyPage : System.Web.UI.Page { Display_Type pageSettings; protected void Page_Load(object sender, EventArgs e) { if ((bool)Session["Is_Admin"]) { pageSettings = new AdminPage(); } else { pageSettings = new UserPage(); } // ... string backgroundColor = pageSettings.backgroundColor; // ... Do stuff with background color } } </code></pre> <p>This works fine for me, but since these settings are constant across the application, they seem to make more sense as static classes. However, I'm having trouble figuring out how to do this because I can't assign a static class to a variable.</p> <p>My questions are:</p> <ol> <li>Is there a better way I can accomplish what I'm trying to do here?</li> <li>Or, if this is okay, how could I accomplish what I'm doing with static classes / members?</li> </ol> <p>It may be worth noting that the user/admin example is not how I'm using this structure in my web application, and in fact has nothing to do with the user themselves but rather other factors such as request parameters.</p>
c# asp.net
[0, 9]
1,861,627
1,861,628
How to get the ID of a selected <li> or <a> with jQuery?
<p>I have a list like this:</p> <pre><code>&lt;li class="nav" id="1"&gt;&lt;a href="#detail"&gt;a&lt;/a&gt;&lt;/li&gt; &lt;li class="nav" id="2"&gt;&lt;a href="#detail"&gt;b&lt;/a&gt;&lt;/li&gt; &lt;li class="nav" id="3"&gt;&lt;a href="#detail"&gt;c&lt;/a&gt;&lt;/li&gt; </code></pre> <p>Now I want to use jQuery to save the id (1,2 or 3) which was clicked. How to do this?</p>
javascript jquery
[3, 5]
5,012,468
5,012,469
Getting the proper document height with Jquery
<p>Goodevening/night </p> <p>A small yet annoying jquery problem. I would like to get the height of my document. To do that i use the following code: </p> <pre><code>$docHeight = $(document).height(); </code></pre> <p>When i visit my page in a normal way (by clicking at a href at some other page) I get the correct height of my document. (about 4000px). But when i refresh i get my windowheight (1037px). Any way to avoid/fix this?</p> <p>Grats,</p> <p>W.</p> <p>*<strong><em>Solution</em>*</strong></p> <p>$(window).load(function({...}); does the trick. My images(so imageheight also) don't get loaded with document.ready, only the tags. window.load loads the entire page with heights etc, which gives me the right height of my doc.</p>
javascript jquery
[3, 5]
273,631
273,632
strip part of a filename with jquery/js
<p>I am using the code below to send an ID to my page:</p> <p>The image names will always look like this 12.jpg 12-1.jpg 12-2.jpg 12-3.jpg e.t.c</p> <p>I need to alter the line below so it will only send the 12 not the -1,-2,-3 e.t.c My code below already removes the .jpg part</p> <pre><code>var id = $(this).attr('src').split('/').pop().replace('.jpg',''); </code></pre>
javascript jquery
[3, 5]
2,849,586
2,849,587
on() method with select element not firing
<p>I'm using <code>jQuery 1.9.0</code> and I'm trying to trigger the <code>on()</code> method whenever an option is changed inside a select. It worked with <code>live()</code> but I think its probably something simple that I'm not seeing.</p> <p>This is my HTML:</p> <pre><code>&lt;select class="select_exercise"&gt; &lt;option class="option_exercise"&gt;Example 1&lt;/option&gt; &lt;option class="option_exercise"&gt;Example 2&lt;/option&gt; &lt;/select&gt; </code></pre> <p>and my Script:</p> <pre><code>$("option.option_exercise").on("change","option.option_exercise",function() { alert("i am changing"); }); </code></pre> <p>Here is <a href="http://jsfiddle.net/fNjL3/1/" rel="nofollow"><strong>the fiddle</strong></a></p>
javascript jquery
[3, 5]
5,978,146
5,978,147
jQuery "please wait" while php executes
<p>I have a script that connects to the PayPal api to check for a valid credit card input. The script can take about 5 seconds to execute and in an effort to keep users from clicking "submit" multiple times if they don't see an immediate response, I'd like to place a "Please wait" indicator.</p> <p>I have a div, "pleaseWait" which is hidden. In jQuery I have:</p> <pre><code>$('#submit').click(function(){ $('#pleaseWait').show(); }); </code></pre> <p>The only problem is if there is an issue, it will send the php error back and the "Please wait" will continue on screen. I decided to try another approach and echo the jQuery in php after the script starts to run, and hide it if there is an error.</p> <pre><code> /* Echo the jQuery so the "Please wait" indicator will show on screen */ echo "&lt;script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js\"&gt;&lt;/script&gt;"; echo "&lt;script type='text/javascript' charset='utf-8'&gt;"; echo "\$(document).ready(function(){"; echo "\$('#pleaseWait').show();"; echo "});"; echo "&lt;/script&gt;"; if($error == ""){ /* There is not an error, run php. */ }else{ /* There was an error, stop the jQuery from displaying the "please wait" and display the error */ echo "&lt;script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js\"&gt;&lt;/script&gt;"; echo "&lt;script type='text/javascript' charset='utf-8'&gt;"; echo "\$(document).ready(function(){"; echo "\$('#pleaseWait').hide();"; echo "});"; echo "&lt;/script&gt;"; } </code></pre> <p>This can work, but seems really messy. Is there a better way to do this other than multiple echos in php?</p>
php javascript jquery
[2, 3, 5]
2,567,349
2,567,350
cookie with php and javascript
<p>Can I edit a cookie created by javascript with php and vice versa</p> <p>is a cookie a cookie basically?</p>
php javascript
[2, 3]
5,124,981
5,124,982
How to authenticate a user using OAuth in PHP
<p>How do I implement OAuth authentication to log in a user?</p> <p>I am making a code where I am using OAuth authentication but I am not getting the satisfactory action.</p>
php javascript
[2, 3]
5,237,078
5,237,079
how to get value of more than one text box in a loop
<p>I have some text boxes in my page. I want to get all text box values in an array and insert in to table of database.</p> <p>Is there any option to work by loop</p>
c# asp.net
[0, 9]
1,001,376
1,001,377
how to display text in a table dynamically?
<p>i m using asp.net..In login form i m using requiredfield validator and regularexpression validator for username.so i need to display the error message in same td for both validation.that first it need to validate required field and display the error msg in td.if that is field it need to checkfor that expression and overite the error message in same td..</p> <p>This my html.on button click validations are working but error message are displaying in consecuent position..</p> <pre><code> &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID="l_uname" runat="server" CssClass="label" Text="User Name" &gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:TextBox ID="t_uname" runat="server" CssClass="text" ToolTip="Enter Username"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;td&gt; &lt;label class="l" runat="server"&gt;*&lt;/label&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:RequiredFieldValidator ID="rf_uname" CssClass="t" runat="server" ErrorMessage="Enter the username" ControlToValidate="t_uname" ValidationGroup="logingroup"&gt;&lt;/asp:RequiredFieldValidator&gt; &lt;asp:RegularExpressionValidator ID="Re_name" runat="server" CssClass="t" ControlToValidate="t_name" ValidationGroup="logingroup" ValidationExpression="^[A-Za-z ]{6,20}$" ErrorMessage="Name should be 6-20 character"&gt; &lt;/asp:RegularExpressionValidator&gt; &lt;/td&gt; &lt;/tr&gt; &lt;asp:Button ID="login" runat="server" Text="Login" ValidationGroup="logingroup" onclick="login_Click"/&gt; </code></pre>
javascript asp.net
[3, 9]
4,033,396
4,033,397
UseSubmitBehavior="false" and binding OnClientClick?
<pre><code>&lt;asp:Button ID="RecoverButton" runat="server" Text="Recover" OnClick="RecoverButton_OnClick" UseSubmitBehavior="false" /&gt; </code></pre> <p>I kind of figured out <code>UseSubmitBehavior="false"</code> overwrites the <code>OnClientClick</code> function I was providing.</p> <p>I went with this then:</p> <pre><code>$(document).ready(function() { $("[id$=RecoverButton]").live("click", RecoverButton_OnClick); }); function RecoverButton_OnClick(s, e) { var input = $("[id$=MasterUsername]").val(); var valid = $dn.s.MailValidation(input); if (!valid) { // prevent postback here } } </code></pre> <p>But I don't know how I can prevent the postback event from firing up. I tried doing something like <code>e.preventDefault()</code> but it didn't work, ideas?</p> <p><strong>Update</strong> thing is both the <code>__doPostback</code> and <code>jQuery</code>'s click handler seem to fire up at the same time (or maybe ASP.NET's fires first), but I placed an alert on my RecoverButton function and firebug already shows the postback happening while the alert is there, blocking execution.</p>
jquery asp.net
[5, 9]
5,524,876
5,524,877
Packaging android code into jar file
<p>I am trying to package the android code into a jar file so that I can use it in another project. But when I do that I get the following error messages. I am not sure how to do this correctly if someone has done it please post a link and some details would be really helpful.</p> <p>Thanks</p> <pre><code>Error generating final archive: Found duplicate file for APK: AndroidManifest.xml Origin 1: C:\Users\Admin\workspace\Test\bin\resources.ap_ Origin 2: C:\Users\Admin\workspace\Test\lib\JarLib.jar </code></pre> <p>I have to use it in lots of project so I want to compile it as jar just like other libraries available online such as twitter4j, googleAnalytic, androidsupportlibrary and I need to know which folder are compulsory to include in Jar file. I have tried building it by excluding the resources folder and using eclipse->export, though it builds the jar but upon including it in another test project displays the above errors messages.</p>
java android
[1, 4]
2,476,246
2,476,247
Run jQuery ready block again after ajax loaded?
<p>I'm not sure if I'm asking the right question here, but basically I'm inserting html with an ajax request:</p> <pre><code>// data-active_chart if ($("#charts").attr("data-active_chart") == "barchart") { $.ajax({ url: $("#charts").attr("data-path") + "/barchart", success: function(data) { $('#charts').html(data); console.log('Load was performed.'); } }); } </code></pre> <p>And my HTML is something like:</p> <pre><code>&lt;div id="charts" data-active_chart="barchart" data-path="http://example.com/something"&gt; &lt;/div&gt; </code></pre> <p>But the point is I need jQuery to be aware of the updated DOM, like I need my tool tips and such to work in the HTML that's been inserted, along with a bunch of other things in the inserted HTML all need to respond to JS, how do I do this in a best practices way?</p>
javascript jquery
[3, 5]
907,568
907,569
Uncaught SyntaxError: Unexpected token var (Javascript)
<pre><code>$.each(data.results, function(i,data) var div_data = '&lt;li class="right-block-list-image"&gt;'+ data.Model_Number +'&lt;/ul&gt;'; }); </code></pre> <p>Where is my syntax error within <code>div_data</code>?</p>
javascript jquery
[3, 5]
733,431
733,432
How can I make POST query for my web-service on Java, Android?
<p>I have code for POST query on Java</p> <pre><code> ArrayList&lt;HashMap&lt;String, String&gt;&gt; books=SQLiteDbWrapper.getInstance().getAllBooks(); JSONObject object=new JSONObject(); object.put("key", KEY); JSONArray isbns=new JSONArray(); for (HashMap&lt;String, String&gt; book:books) { isbns.put(book.get(SQLiteDbHelper.ISBN13_FIELD)); } object.put("isbns", isbns); object.put("email", email); Log.e("log", object.toString()); HttpClient client = new DefaultHttpClient(); HttpPost request = new HttpPost(BASE_URL+SUBMIT_SCRIPT); request.setEntity(new ByteArrayEntity( object.toString().getBytes("UTF8"))); HttpResponse response = client.execute(request); </code></pre> <p>I need to send JSON data into server; my web-service must get this data from $POST['json'] variable, but I don't know how can I put my JSONObject object into 'json' field for POST query? Please, help me</p>
java android
[1, 4]
5,929,971
5,929,972
Creating a google plus / digg like social bookmark button
<p>For a client of ours we need to create a share button for his site so that the users of his site can add this button to their blogs / sites and others can click on it and it will just open up a popup asking the user to login (if already logged in, the link bookmark page appears) to the clients site and bookmark it. Can somebody guide me on how to do it with php and javascript?</p>
php javascript
[2, 3]
5,753,467
5,753,468
Unable to get updated value of session variable and Textbox
<p>I am building a web application in asp.net and c#, I am storing text of textbox in Session variable like this:</p> <pre><code>Session["data"]=TextBox1.Text; </code></pre> <p>and on the button click event I am redirecting user to another page.In the second page I am using this variable <strong>Session["data"]</strong> and in page2 there is a back button where I am again Redirecting to page1 where the textbox1 is present.Now on the button click event where I am redirecting to page2 and event is code like this,</p> <pre><code>Session["data"]=TextBox1.Text; Response.Redirect("page2.aspx"); </code></pre> <p>now when I am accessing the value of the Session["data"] it is giving me the previous value.As the content of TextBox1 may get changed,these changes have not been shown.</p> <p>Please tell me where I am going wrong.</p>
c# asp.net
[0, 9]
3,407,282
3,407,283
asp:LinkButton code to open new browser window/tab after other code
<p>For my internal webpage at work, I display a DataGrid based on entries in a SQL table (not directly, but with some processing on entries).</p> <p>Each row in the DataGrid has a button that the user clicks. I need this button to open a new window or tab (I believe I can't decide as this is based on browser config) and also change a value in the SQL table to say the button was clicked.</p> <p>If I use an asp:Hyperlink then the page opens nicely, but I don't know how to update SQL. Vice-versa if I use an asp:LinkButton I can get the SQL updated but can't get a new page to open.</p> <p>Is what I am trying to do impossible?</p> <p>Thanks</p> <p>EDIT:</p> <p>I've tried both these in my .cs file, but neither worked:</p> <pre><code>ClientScript.RegisterStartupScript(GetType(), "openwindow", "window.open('" + url + "','_preview'"); Response.Write("&lt;script type='text/javascript'&gt;detailedresults=window.open('" + url + "');&lt;/script&gt;"); </code></pre>
c# asp.net
[0, 9]
5,442,885
5,442,886
jquery strange flickering on mouseover/out
<p>The HTML:</p> <pre><code>&lt;div id="timerList"&gt; ... &lt;li rel="project" class="open"&gt; &lt;a class="" style="" href=""&gt;&lt;ins&gt;&amp;nbsp;&lt;/ins&gt;Project C&lt;/a&gt; &lt;/li&gt; ... &lt;/div&gt; </code></pre> <p>The javascript/jquery:</p> <pre><code>$('#timerList li[rel="project"]').mouseover(function(){ $('a:first',this).after('&lt;span class="addNew"&gt;&lt;a href="#"&gt;Add Timer&lt;/a&gt;&lt;/span&gt;'); }).mouseout(function(){ $('.addNew',this).remove(); }); </code></pre> <p>When I hover my mouse over an li element, a span.addNew element is created within</p> <p>THE PROBLEM: When I put my mouse ofer the span.addNew, it flickers on and off. Perhaps the mouseout event is firing, but I don't understand why it would or how to prevent it.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
308,689
308,690
Regarding an input variable on .aspx page which is not running on server and code behind
<p>I have an input variable which is manipulated using JavaScript on the client side: </p> <pre><code>&lt;input type="text" id="field1" value="Sunday, July 30th in the Year 1967 CE" /&gt; </code></pre> <p>How can I use the input value to write to the database on click event in my code-behind?</p>
c# javascript asp.net
[0, 3, 9]
4,088,608
4,088,609
Can I load lots of data only once and use it on each request?
<p>Is there a way to load a big data object into the memory, which usually has to be loaded at each request, only once?</p> <p>In Java you can instantiate an object in a servlet when this servlet is loaded, but once it's there you can use it in any request. Example is below. Can this be done in PHP?</p> <pre><code>public class SampleServlet extends HttpServlet { private static HugeGraphObject hgo; public void init() { hgo = HugeGraphObjectFactory.get(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String param = request.getParameter("q"); response.getWriter().write(hgo.getSomeThing(param)); } } </code></pre>
java php
[1, 2]
984,799
984,800
Android SMS Service that run in background whole time
<p>Actually I have new hand on Android and I have Finished my job for developing a SMS service that run in background but when another service like facebook etc then service does not capable to read sms how I can resolved this issue pl help me. I also bind the code that I have written for service</p> <p>thanks n regards</p> <p>public class SmsService extends Service {</p> <pre><code>private SMSReceiver mSMSreceiver; private IntentFilter mIntentFilter; @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } @Override public void onCreate(){ super.onCreate(); mSMSreceiver = new SMSReceiver(this); mIntentFilter = new IntentFilter(); mIntentFilter.addAction(ConstantClass.SMS_RECEIVED); registerReceiver(mSMSreceiver,mIntentFilter); } @Override public int onStartCommand(Intent intent , int flags, int type){ return START_STICKY; } @Override public void onDestroy(){ super.onDestroy(); unregisterReceiver(mSMSreceiver); } </code></pre> <p>}</p>
java android
[1, 4]
3,715,314
3,715,315
301 error and search engine
<p>I want to know about 301 Error for website, I Binged about it and got the some overview about 301 Redirect Error.</p> <p>I also got the code for ASP.NET redirect,</p> <pre><code>&lt;script runat="server"&gt; private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.new-url.com"); } &lt;/script&gt; </code></pre>
c# asp.net
[0, 9]
761,676
761,677
jquery focus not setting on firefox
<p>I want to set focus into my text area. Following is my code:</p> <pre><code>$this.textInput.val('').show().focus(); </code></pre> <p>But it is not working. Actually when I press mouse button it appeared but when I mouseup it remove from text area. So after lot of searching I found setTimout method like : </p> <pre><code>$this.textInput.mouseover(function(){ setTimeout($this.focus(),0); }); </code></pre> <p>But still its not working in firefox. I have the latest 13.0 version but still it containing the problem but google chrome it is working properly. What's the problem with firefox is there any solution for it.</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
2,446,020
2,446,021
Which language is most suitable for an efficient web-crawler?
<p>i need to write an web crawler and i need need which is best language for performance like memory and performance ..</p> <p><strong>Edit:</strong> Original title was "which language is optimized for speed and perfomance c++ or C#"</p>
c# c++
[0, 6]
4,619,594
4,619,595
Jquery and IE8 animate opacity solution
<p>I am trying to animate opacity with Jquery an it is working fine in every browser except, you guess it dreaded <b>IE8</b>!<br/> Problem: on animation I am seeing some ugly artifacts:( <br/>I know that I can solve this by removing background and adding the same background color to my animated div and to my container div,but it is <b>NOT</b> an option in my case. <br/>Can somebody suggest solution to this? My code:</p> <pre><code>$(document).ready(function() { $(".img").animate({ opacity: 0 }); $(".glow").click(function() { $(".img").animate({ opacity: 1 }, 5000); }); }); </code></pre>
javascript jquery
[3, 5]
4,260,436
4,260,437
hide div that contains <p> that contains "text" - how to
<pre><code>&lt;div id="example"&gt; &lt;ul&gt; &lt;p&gt;text&lt;/p&gt; &lt;/ul&gt; &lt;div&gt; </code></pre> <p>i need to hide div itself</p>
javascript jquery
[3, 5]
2,380,516
2,380,517
Enclosing listbox inside DIV tag
<p>I want to enclose listbox inside a DIV tag in the code behind file using C#.I am adding all the required attributes and adding the list box as below:</p> <p>Controls.Add(listBox);</p> <p>I want the generated listbox to be enclosed with in a div. Please suggest how this can be done.</p> <p>Thanks in advance.</p>
c# asp.net
[0, 9]
4,773,915
4,773,916
ASP.NET [from metadata]
<p>I was stepping through some code and hit a method I wanted to see the code for. I clicked on 'go to definition' and it would usually take me to the method definition, but now it takes me to what appears to be an auto generated [from metadata] class. I've never experienced this before. What's going on and how do I get the old functionality back?</p> <p>If it helps, the method is being called in a code behind file and the method definition is in the code behind of a UserControl.</p>
c# asp.net
[0, 9]
5,090,544
5,090,545
Inserting a text where cursor is using Javascript/jquery
<p>I have a page with a lot of textboxes. When someone clicks a link, i want a word or two to be inserted where the cursor is, or appended to the textbox which has the focus.</p> <p>For example, if the cursor/focus is on a textbox saying 'apple' and he clicks a link saying '[email]', then i want the textbox to say, 'apple [email protected]'.</p> <p>How can I do this? Is this even possible, since what if the focus is on a radio/dropdown/non textbox element? Can the last focused on textbox be remembered?</p>
javascript jquery
[3, 5]
1,404,589
1,404,590
XML file in layout folder error: can not be resolved or is not a field
<p>I'm using Eclipse with Android SDK. I have added a XML file in the layout folder called <code>voice_recog.xml</code> by <em>File > New > Other > Android > Android Xml File</em>.</p> <p>On this code line:</p> <pre><code>setContentView(R.layout.voice_recog); </code></pre> <p>I'm getting the following error:</p> <blockquote> <p>voice_recog.xml can not be resolved or is not a field</p> </blockquote> <p>Thus, I think it is not seeing the file I created even though it's in the layout folder. How is this caused and how can I solve it?</p>
java android
[1, 4]