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,850,644 | 2,850,645 |
Updating an ImageView with an image from a URL
|
<p>Within my android application, I'm wanting to update an ImageView, with an image specified from a URL. This URL has been fetched via an API as part of an AsyncTask.</p>
<p>I have defined the ImageView as follows:</p>
<pre><code><ImageView
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:layout_height="wrap_content"
android:id="@+id/product_image"
android:src="@drawable/no_product_image"
android:layout_marginRight="6dip"
android:layout_width="wrap_content"
/>
</code></pre>
<p>That way, whilst the data is loading, there is a blank image present behind a ProgressDialog.</p>
<p>As part of the doInBackground of the AsyncTask, after fetching the product details, I call:</p>
<pre><code>private void createProductScreen(Product product){
Log.i(TAG, "Updating product screen");
//Set the product image
ImageView imgView =(ImageView)findViewById(R.id.product_image);
Drawable drawable = loadImageFromWeb(product.getImageUrl());
imgView.setImageDrawable(drawable);
Log.i(TAG, "Set image");
}
</code></pre>
<p>The image is loading from the web as follows:</p>
<pre><code>private Drawable loadImageFromWeb(String url){
Log.i(TAG, "Fetching image");
try{
InputStream is = (InputStream) new URL(url).getContent();
Drawable d = Drawable.createFromStream(is, "src");
Log.i(TAG, "Created image from stream");
return d;
}catch (Exception e) {
//TODO handle error
Log.i(TAG, "Error fetching image");
System.out.println("Exc="+e);
return null;
}
}
</code></pre>
<p>When this runs I see <em>"Created image from stream"</em> in the log, but don't see <em>"Set image"</em> and the onPostExecute of the AsyncTask is never called.</p>
<p>Does anyone have any ideas on the issue or a better way of updating the image from the blank image to the product image?</p>
|
java android
|
[1, 4]
|
5,740,930 | 5,740,931 |
Sleep in For loop
|
<p>I am developing a simple game. I want to have small wait in each interation of a <code>for</code> loop that will be executed on button click.</p>
<p>I have tried using <code>Thread.sleep(2000)</code>, but to no avail.</p>
<p>Here is the code of button click:</p>
<pre><code>public void playClick(View v) {
String item;
try{
final Handler handler = new Handler();
for (int i = 0; i < stringList.size(); i++) {
Thread.sleep(2000);
item = stringList.get(i);
if(item.equals("left")){
leftclick();
}else if(item.equals("right")){
rightClick();
}else if(item.equals("up")){
upClick();
}else if(item.equals("down")){
downClick();
}
}
}catch(Exception e){
Toast.makeText(this, ""+e.toString(), Toast.LENGTH_SHORT).show();
}
</code></pre>
<p>I want to wait in each execution of the <code>for</code> loop.</p>
|
java android
|
[1, 4]
|
3,910,759 | 3,910,760 |
What are the best Idiomatic Java guides?
|
<p>(Cross posted to <a href="http://www.quora.com/What-are-the-best-Idiomatic-Java-guides" rel="nofollow">Quora</a>)</p>
<p>I just found <a href="https://github.com/rwldrn/idiomatic.js" rel="nofollow">Idiomatic Javascript</a>, a github repo that contains a ton of useful links & style directions about javascript. Unlike some Java styles guides I saw, it:</p>
<ul>
<li>Gives a lot of pointers to useful links - this is essential for newbies</li>
<li>Is not a frozen document, but rather an open github repo</li>
</ul>
<p>Is there an equivalent for Java? What are the best Idiomatic Java style guides you know?</p>
|
java javascript
|
[1, 3]
|
3,614,167 | 3,614,168 |
label text change to call for pageload/ javascript
|
<p>basically i got no idea to starts so i cant provide any better code
i have a null label</p>
<pre><code>lblErrorMsg = "" ;
</code></pre>
<p>once if there are any error, my label will display error msg with css</p>
<pre><code>lblErrorMsg.Text = "some error Msg";
</code></pre>
<p>at the same time i am trying to display another image label as well, but i dont want to make it like button click then display the error msg, due to this is an on-going project, so there are lot of button, so what i want to ask is, is there any method can perform during page load to detect label text change?</p>
<p>something like</p>
<pre><code>pageload(){
check lblErrorMsg
if(lblErrorMsg.Text!=""){
lblImg.Visible= true;
}else{
lblImg.Visible= false;
}
}
</code></pre>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
4,994,935 | 4,994,936 |
Call function when we click the html button
|
<p>How to call function in .cs file when we click the html button in aspx file.</p>
|
c# asp.net
|
[0, 9]
|
3,554,539 | 3,554,540 |
jquery chaining function issue
|
<p>i wrote this function to toggle a class name, of next div using jquery chaining function, but it doen't work...</p>
<pre><code> $('a.back-btn,a.front-btn').click(function(e){
e.preventDefault();
$(this).toggleClass('back-btn front-btn').end()
.next().find('.models').toggleClass('rotated');
})
</code></pre>
<p>in case if i write separate line, then it works fine :</p>
<pre><code>$('a.back-btn,a.front-btn').click(function(e){
e.preventDefault();
$(this).toggleClass('back-btn front-btn');
$(this).next('.models').toggleClass('rotated'); // separate line
})
</code></pre>
<p>what is the issue with my chaining function, how it need to end a process in case if i use the chaining. i used end(), is it wrong? any best clarification to use end()?</p>
<p>thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
2,991,679 | 2,991,680 |
open a popup outside the iframe but link is inside the iframe
|
<p>In a html page i have include one iFrame.</p>
<p>In iFrame, have one link,</p>
<pre><code><a href="#" class="modal {targetelement:'#newstyle',closetext:'Close details',opentext:'View details'}">open window</a>
</code></pre>
<p>if i am adding the link and popup html on parent window its working fine.</p>
<p>but if i am adding link on inside the iframe popup html is not opening.</p>
<p><strong>My exact requirment : open the popup above the iframe.</strong></p>
<p>i can move the position of popup html ( inside iframe or parent page ) anywhere but cant change the position of <code><a href="#" id="modelboxnew">open window</a></code> its should be in iframe only</p>
<p>Here is my popup</p>
<pre><code><div id="newstyle" > xyax text ..my popup html </div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,859,232 | 2,859,233 |
scroll event not firing on div element in IE
|
<p>I have tried everything I can think of to get this event to trigger when scrolling on the div tag. I made sure that it was actually reaching this code and it does. It never triggers when scrolling though. I also tried using .scroll(...) and .bind('scroll'...) Any thoughts on what the issue is?</p>
<pre><code>$('.ScrollIEContainer').scroll(function ()
{
var scrollPos = $(this).scrollTop();
if (scrollPos != null && scrollPos != undefined)
{
$(this).contents('table.GridView').children('thead').children('tr').css({ 'top': scrollPos + 'px' });
}
});
</code></pre>
<p>The goal here is to update the top position of the header in my grid view to implement fixed header scrolling.</p>
<p>UPDATE:
I have been unable to debug any of this code with the exception of alert statements for some inexplicable reason but I was able to debug and use the watch window to check on my selector elements by inserting a a line of code right before it that would result in a Null Reference exception (WTF). Anyways, I looked at the dom inside my element and the onscroll event is null event after the code above is executed.</p>
|
jquery asp.net
|
[5, 9]
|
3,146,427 | 3,146,428 |
How to rebind checkboxlist
|
<p>I have a checkboxlist which contain 3 checkboxes whose values are check1,check2,check3. In database, in table, there is a field to save the values of checked checkboxes.</p>
<p>If that field conatins values check1, check2, check3 and if I use following code to bind checkboxlist, only check3 gets checked, but check1 and check2 is unchecked</p>
<pre><code> string[] strSourceOfInformation = dtEnquiry.Rows[0]["SourceOfInformation"].ToString().Split('&');
for (int i = 0; i < strSourceOfInformation.Length; i++)
{
if (strSourceOfInformation[i].ToString() != "")
{
foreach (ListItem htlRmItem in chkSourceOfInformation.Items)
{
if (htlRmItem.Value == strSourceOfInformation[i].ToString())
{
htlRmItem.Selected = true;
}
}
}
}
</code></pre>
<p>how can I modify the code to get check1, check2 and check3 gets checked?</p>
|
c# asp.net
|
[0, 9]
|
3,029,885 | 3,029,886 |
How to escape ' in setParameter
|
<p>I have a javascript function which is broken because the ' ('Côte d'Azur') is not escaped:</p>
<p>Javascript:searchDay('month', 'France', 'Côte d'Azur', '0', '201208', '18');</p>
<p>The parameters are set as followed:</p>
<pre><code>$jsUrl = new JavascriptUrl(
"searchDay",
array("id", "country", "region", "city" , "month", "startDay" )
);
$jsUrl->setParameter("id", "month");
$jsUrl->setParameter('month', $monthCode);
$jsUrl->setParameter('country', $countryName);
$jsUrl->setParameter('region', $regionName );
</code></pre>
<p>How can i fix this?</p>
|
php javascript
|
[2, 3]
|
2,153,503 | 2,153,504 |
How to create tabbed interface in asp.net?
|
<p>I want create the tabbed interface in asp.net, for this i have searching in internet at finally i found a link below i paste that link please verify that.</p>
<p>i am using this link to create tabbed items but this showing some errors like namespace are not found. Please help me where i can change to rectify this error.</p>
<p>Hope you can understand my problem please...</p>
<p><a href="http://weblogs.asp.net/alessandro/archive/2008/01/05/tabmenu-missing-in-the-asp-net-toolbox-not-anymore.aspx" rel="nofollow">http://weblogs.asp.net/alessandro/archive/2008/01/05/tabmenu-missing-in-the-asp-net-toolbox-not-anymore.aspx</a></p>
|
c# asp.net
|
[0, 9]
|
5,030,344 | 5,030,345 |
How to close dialog box which is opened by jQuery?
|
<p>I have a webpage in which I open a dialog box, which shows another webpage. When I click on the submit button on this child webpage, it is loaded in the browser window.</p>
<p>Here is the whole synopsis:</p>
<p>On the parent page, I have a div which loads the child.</p>
<pre><code><div id="divMyDialog" title="Child Dialog Title">
</div>
</code></pre>
<p>In a jQuery file, I have the following:</p>
<pre><code>$("#divMyDialog").dialog({
autoOpen: false,
bgiframe: true,
width: 800,
height: 400,
modal: true,
draggable: false,
resizable: false
});
function OpenDialog(FirstID, SecondID) {
$("#divMyDialog").dialog("open").load("ChildPage.aspx?FirstID=" + FirstID+ "&SecondID=" + SecondID);
}
</code></pre>
<p>Now, once I click on an asp:button in ChildPage.aspx (after a database action), I want ChildPage.aspx to show an alert and then close. Instead, what is happening is that it shows the alert correctly, and then loads ChildPage.aspx in the browser.</p>
<p>For the alert, I have this in the OnClick event for that asp:button:</p>
<pre><code>Page.ClientScript.RegisterStartupScript(this.GetType(), "showalert", "<script>CloseMyDialog();</script>");
</code></pre>
<p>To close ChildPage.aspx dialog, I have this:</p>
<pre><code><script type="text/javascript">
function CloseMyDialog() {
parent.$.fn.colorbox.close();
return false;
}
</script>
</code></pre>
<p>Please let me know if you need any more clarification. I have already tried many things, but so far none worked correctly.</p>
<p>Thanks.</p>
|
jquery asp.net
|
[5, 9]
|
3,908,295 | 3,908,296 |
Create a link from text
|
<p>I have code</p>
<pre><code><div class="row1">
<em>My text</em>
</div>
</code></pre>
<p>How can I make a link like:</p>
<pre><code><div class="row1">
<em><a href="/mylink">My text</a></em>
</div>
</code></pre>
<p>I understand that the issue is a primitive but can not find the same simple solution.</p>
|
javascript jquery
|
[3, 5]
|
3,986,352 | 3,986,353 |
How can I get the average colour of an image
|
<p>I want to be able to take an image and find out what is the average colour. meaning if the image is half black half white, I would get something in between... some shade of gray. It could be the most frequent single colour or median. Any average will do.</p>
<p>How can I do this in android.</p>
|
java android
|
[1, 4]
|
1,823,827 | 1,823,828 |
How do I close the other modal dialog box?
|
<p>I have the following example <a href="http://jsfiddle.net/zidski/Mz9QU/1/" rel="nofollow">http://jsfiddle.net/zidski/Mz9QU/1/</a></p>
<p>If you click on Link2 and then Link1 I want Link2 box to close.</p>
<p>Can anyone help?</p>
|
javascript jquery
|
[3, 5]
|
4,864,607 | 4,864,608 |
Dropdownlist text change while hidden aspx
|
<p>I have a drop down list with autopostback enabled. When I change the value it updates a grideview on my webpage. However I want to get rid of the drop down and use a textbox sort of like a search function. I still want to keep my list though so I can compare my search string to the actual present values. However, if I make my dropdown list invisible I cant compare values to the items in it.</p>
<p>Or is there a better solution? A control that the user can't see but that I can put database values in it and compare those values with textbox text?</p>
<p>thanks for the help.</p>
<p>I am getting an error with this code:</p>
<pre><code> foreach (string s in DropDownList3.Items)
{
//foreach gives me the error below
if(s == idsearch.Text)
{
valid = true;
break;
}
}
if(valid == true)
{
GridView1.DataBind();
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
16,354 | 16,355 |
Post for from jQuery UI dialog
|
<p>I am trying to integrate new functionality using jQuery UI's dialog.</p>
<p>I have a page with a link. When a link is clicked a modal dialog with a form in it opens. That part works OK.</p>
<pre><code>$("#myForm").hide();
$("#myLink").click(function(){
$("#myForm").dialog({
modal: true,
draggable: false,
resizable: false,
width: 450,
buttons: {
"Submit": function() {
// ???
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
});
<a href="#" id="myLink">Open Dialog</a>
<div id="myForm">
<form>
<textarea id="myValues" rows="10"></textarea>
</form>
</div>
</code></pre>
<p>Now, I need to submit the form from within my dialog and POST results to the same page. I am getting all confused with how to implement the rest. I did look at the jQuery .post() example which made me even more confused. The page is in PHP, so when the results are submitted I need to get the post value and do some server-site action.</p>
<pre><code>if (isset($_POST["myValues"])) {
// do something
}
</code></pre>
<p>Stuck, need help.</p>
|
php jquery
|
[2, 5]
|
4,289,668 | 4,289,669 |
how to write the path in ckeditor?
|
<p>I have installed ckeditor, and I am using the KCFinder plugin as the upload image tool. <a href="http://kcfinder.sunhater.com/docs/integrate#session" rel="nofollow">http://kcfinder.sunhater.com/docs/integrate#session</a>.</p>
<p>Now I don't know how to make the path right. my ckeditor's path is <code>test/ckeditor....</code>
the kcfinder's path is <code>test/kcfinder...</code></p>
<p>How do I write this code?</p>
<pre><code>config.filebrowserBrowseUrl = '/kcfinder/browse.php?type=files';
</code></pre>
<p>Is the above path right? Thank you.</p>
|
php javascript
|
[2, 3]
|
1,296,654 | 1,296,655 |
Pad a TextBox with leading 0's in ASP.NET using JavaScript
|
<p>I have a TextBox on my ASP.NET webpage, where the user can enter a number. What I want to do is as soon as the user moves the focus off that TextBox, to call a piece of JS to pad that number with up to 10 leading zero's if necessary.</p>
<p>I've tried a few things but my JavaScript's a bit rusty. Any ideas? </p>
|
javascript asp.net
|
[3, 9]
|
3,038,723 | 3,038,724 |
cannot get results from an asp.net page to be used in the jquery token input drop-down
|
<p>please help me I'm stuck here for a long time with no solution, I'm trying to use the jQuery token input to display selection result from an asp.net page, the page is called correctly and it generates the right JSON form, but the result didn't appear in the drop-down list, here is the code of the input field in the HTML,</p>
<pre><code><div>
<input type="text" id="textBox2" name="blah2" runat="server"/>
<input type="button" value="Submit" />
<script type="text/javascript">
$(document).ready(function () {
$("#textBox2").tokenInput("Default.aspx", {
theme: "facebook"
});
});
</script>
</div>
</code></pre>
<p>and the code of the aspx page is something like this:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "application/json";
string searchParam = Request.QueryString["q"];
Country country = new Country();
country.name = searchParam;
country.id = searchParam;
List<Country> countryList = new List<Country>();
countryList.Add(country);
JavaScriptSerializer serializer = new JavaScriptSerializer();
string serialized = serializer.Serialize(countryList);
Response.Write(serialized);
}
</code></pre>
<p>is there any thing more i should do,
please help,
thanks in advance,</p>
|
jquery asp.net
|
[5, 9]
|
904,137 | 904,138 |
ListBox switch items asp.net jquery
|
<p>I've two ListBox (second one is empty on page load) and two buttons which switch items between those ListBox.However,im using Jquery two switch items,which means there are no Postbacks.Once,ive finished,i click another button to save the items from the second List,this time using PostBack.</p>
<p>When it runs on server,ASP.NET does not recognize any item on the list,showing listbox2.items.count = 0(zero),but im sure that list does have items.</p>
<p>I wonder if add items to the list without postbacks is the problem;</p>
<p>Any suggestions?</p>
<p>code trying to get list:</p>
<pre><code> try
{
estabelecimentos = new List<int>();
int x = lstSelect.Items.Count;//always 0,but list isnt empty
estabelecimentos = lstSelect.Items.Cast<ListItem>().Select(v => int.Parse(v.Value)).ToList();
}
catch(Exception ex)
{
divErro.Visible = true;
lblErro.Text = ex.Message;
return;
}
</code></pre>
|
asp.net jquery
|
[9, 5]
|
4,516,966 | 4,516,967 |
Unknown inflate error with android
|
<p>Hi i'm having a problem with my android app. The problem is when i try to set up new view.</p>
<pre><code> public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
try{
LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.list, null);
}
catch(Exception e){
String a=e.toString();
}
}
</code></pre>
<p>in line v = vi.inflate(R.layout.list, null); i get this error:</p>
<pre><code> android.view.InflateException: Binary XML file line #5: Error inflating class <unknown>
</code></pre>
<p>Here is also my list.xml file:</p>
<pre><code> <?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TableRow
android:layout_width="fill_parent"
android:layout_height="15dp"
android:background="@drawable/bg_seznam" >
<TextView
android:id="@+id/item_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="17dp"
android:textColor="#ffffff"
android:textSize="20dp"
android:textStyle="bold"
android:typeface="serif" >
</TextView>
</TableRow>
</TableLayout>
</code></pre>
<p>So any ideas?</p>
|
java android
|
[1, 4]
|
845,783 | 845,784 |
Prevent stacking of AJAX-requests
|
<p>I've got a problem which I can't seem to solve. </p>
<p>I'm currently implementing a an AJAX-function similar to the one Twitter uses - that fetch new posts on scrolling.</p>
<p>The jQuery looks something like this: </p>
<pre><code> $(window).scroll(function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$('div#ajaxloader').show();
$.ajax({
url: "loader.php?lastid=" + $(".container:last").attr("id"),
success: function(html){
if(html){
$("#main").append(html);
$('div#ajaxloader').hide();
}else{
$('div#ajaxloader').html('No more posts to show.');
}
}
});
}
});
</code></pre>
<p>Now the problem; if the user scrolls really fast and the database is doing it's work quickly - the jQuery doesn't seem to be able to send the correct id as a query fast enough - which results in double-posts. </p>
<p>Anyone have a good idea on how to prevent this?</p>
|
php javascript jquery
|
[2, 3, 5]
|
139,469 | 139,470 |
Generating CSV reports that have 1 million+ rows in ASP.NET
|
<p>I am seeking your advice with regards to generating CSV reports. </p>
<p>I have an ASP.NET application that is produces reports on billing data. Recently, I have noticed that when it tries to export a report file the web application is unresponsive and will throw in an OutOfMemory exception or Server timeout exception.</p>
<p>What I did to amend this was to:</p>
<ul>
<li>Place the necessary indexes in SQL server to get the records faster</li>
<li>Use SqlDataReader to fetch the data from SQL server</li>
<li>Specify the criteria needed to pull out necessary records instead of getting all information in one call.</li>
</ul>
<p>I have also thought of limiting the maximum number of records returned from the database but the system needs to produce all information regardless of how big the rowcount is returned because the information being downloaded will be critical for our client's financial records.</p>
<p>I am wondering, what methods/solutions that can be used to render CSV reports that have huge data in ASP.NET? </p>
<p>Looking forward for your response.</p>
<p>Cheers,
Ann</p>
|
c# asp.net
|
[0, 9]
|
234,525 | 234,526 |
how can I restart activity on back button pressed?
|
<p>I'm going from main activity to another activity and then when I press back button I want to go back to the main activity and restart it.
How can I do that?
Thanks in advance.</p>
|
java android
|
[1, 4]
|
3,308,288 | 3,308,289 |
debugger for javascript in classic eclipse for Android
|
<p>Is there any perfect tool to debug javascript in classic eclipse for Android</p>
|
javascript android
|
[3, 4]
|
3,028,214 | 3,028,215 |
how to track http packets on android in java
|
<p>I wish to track all http packets going out and comming in to the device
from a service is that possible ?</p>
<p>Thanks
Vishal</p>
|
java android
|
[1, 4]
|
4,468,500 | 4,468,501 |
jquery master page problem
|
<p>i am developing an asp.net project and i use jquery with it but when I use masterpage with content page. My jquery code does not working but if ı use in a normal page without master jquery work efficiently.</p>
<p><code><script type="text/javascript" language="javascript" src='<%= Page.ResolveClientUrl("~/js/Default.js") %>' ></ script></code></p>
<p>I use this in the master page for resolation. </p>
<p>In my code when click a button. a timer starts and button disabled until timer finishes Thats all but not working with master page</p>
|
asp.net jquery
|
[9, 5]
|
4,043,720 | 4,043,721 |
Accessing page controls from a seperate class
|
<p>I'm wondering how I can go about accessing page controls from a separate class I've made. I've tried a few things I found using google, but no luck :(</p>
<p>What I'm trying to do is keep a function that is used often, in a global class.</p>
<p>The function then accesses a page literal and calls ScriptManager.RegisterStartupScript. I was hoping this is possible, so then this function wouldn't have to be copied to all of the pages.</p>
<p>Any ideas would be greatly appreciated. </p>
|
c# asp.net
|
[0, 9]
|
536,611 | 536,612 |
Unable to Get Ip address of the http request : Asp.Net [C#]
|
<p>I have a page, on which a request from other website drops in. I want to track IP address where the request is coming.</p>
<p>I am using Asp.Net C# & used three methods</p>
<pre><code>1) httpRequest.UserHostAddress
</code></pre>
<p>Tried Http Server variables as </p>
<pre><code>2) httpRequest.ServerVariables ["HTTP_X_FORWARDED_FOR"];
3) httpRequest.ServerVariables ["REMOTE_ADDR"];
</code></pre>
<p>But these methods are returning me my server address. As browser is taking this request as it is origonated at my end. But i want to get ip address of the page (Site) where the request is coming from. Can anyone help me in this.</p>
|
c# asp.net
|
[0, 9]
|
2,510,871 | 2,510,872 |
the project was not build since the source file could not be read
|
<p>I am trying to build an open source android project, but just after build starts, I get this error: </p>
<p>The project was not built since the source file <code>/android/build/tools/droiddoc/test/generics/src/com/android/generics/TestComparable.java</code><br>
could not be read</p>
<p>I tried everything I found, <strong>Refresh > Clean > build / Restart > refresh > Clean > build</strong>.</p>
<p>I understand it could be an encoding problem since that file may come from a repository, and was stored on windows or something. </p>
<p>If you know a solution or a possible solution, please help, I am out of ideas. </p>
|
java android
|
[1, 4]
|
244,082 | 244,083 |
android compare 2 dates to find difference
|
<p>i have a booking form that requires a user to input their details alongside a date.
the user cannot submit a date that is within 24 hours.
a booking must be made after 24 hours.</p>
<p>how can i implement this?.
i have obtained the current date and time.</p>
<p>so if the current date and time is 19062012 1324 the booking cannot be made until 20062012 1324</p>
<p>what i tried to do is this:</p>
<pre><code>long mdates = (long) (Long.parseLong(date.getText().toString()));
long mprefered= (long) (Long.parseLong(date2.getText().toString()));
long sub = mprefered - mdates;
if (preferedDateEditText.getText().toString() != null
&& !preferedDateEditText.getText().toString()
.equalsIgnoreCase("") && sub>100000000) {
emailBody += "Prefered date & Time:"
+ preferedDateEditText.getText().toString().trim()
+ "\n sub="+sub;
} else {
errorMessage += "A booking cannot be made within 24 hours.";
}
</code></pre>
<p>this works however if the prefered date is 01072012 1324 then it wont accept as being 24 hours in advance
any help would be appreciated</p>
|
java android
|
[1, 4]
|
4,638,478 | 4,638,479 |
Javascript not firing when expected
|
<p>I've got a site that is using javascript to resize images to a max width/height. I'm using javascript and not CSS to do this so it is backwards compatible with older browsers. My issue is that in Chrome it seems to not resize the image all the time. Sometimes on the first visit to a page the image is not resized, on reload and subsequent visits it is resized.</p>
<p><a href="http://justinzaun.com/Tree/people/@[email protected]" rel="nofollow">http://justinzaun.com/Tree/people/@[email protected]</a> for an example page but really any of the people pages on the site can show the same issue. I'm trying to resize in $(window).load() and $(documnet).ready() this is taking place in the familytree.js file.</p>
<p>The username/password is admin/pwd</p>
|
javascript jquery
|
[3, 5]
|
2,969,263 | 2,969,264 |
How to save innerhtml to text file, html file on some folder using java script?
|
<p>I am using .aspx page, i want to save some data on button click, which i extracted using function</p>
<pre><code> function save() {
var t1 = document.getElementById('test').innerHTML;
alert(t1);
}
</code></pre>
<p>to .text file, .html file some folder on desktop.
the folder should appear, where i can save the file with any extension of .text or .html.</p>
|
javascript asp.net
|
[3, 9]
|
4,126,997 | 4,126,998 |
is onCreate() called in an Activity that implements Runnable?
|
<p>I am calling a runnable Activity with the code</p>
<pre><code>Mover simulationRuntime = new Mover();
</code></pre>
<p>The <code>onCreate()</code> does not run what gives?</p>
|
java android
|
[1, 4]
|
5,538,722 | 5,538,723 |
Jquery in 30 days inquiry
|
<p>I am currently watching a tutorial video "30 days to learn jQuery".
I have a question about why the tutor in the video <strong>returned a variable</strong> from a function.</p>
<p>Here's the code:</p>
<p>This is in the HTML file which just binds an event handler to buttons, calls functions, etc.</p>
<pre><code>(function() {
slider.nav.find('button').on('click', function() {
slider.setCurrent( $(this).data('dir') );
slider.transition();
});
})();
</code></pre>
<p>and this is the one function I'm interested in (in the js file):</p>
<pre><code>Slider.prototype.setCurrent = function( dir ) {
var pos = this.current;
pos += ( ~~( dir === 'next' ) || -1 );
this.current = ( pos < 0 ) ? this.imgsLen - 1 : pos % this.imgsLen;
return pos; // <== HERE
};
</code></pre>
<p>The only thing I want to figure out is why <code>return pos</code>? I tried removing it and the code still worked.</p>
<p>Was it a mistake or is there sound logic to this?</p>
<p>In a nutshell, <code>setCurrent</code> function is called and <code>setCurrent</code> returns a value. But why?</p>
|
javascript jquery
|
[3, 5]
|
5,391,720 | 5,391,721 |
Pass Javascript var into PHP var
|
<pre><code>var javascript_variable = $("#ctl00").text();
<?php $php_variable = ?> document.write(javascript_variable); <? ; ?>
</code></pre>
<p>I want to pass the above <code>javascript_variable</code> into <code>php_variable</code>. This code is giving me an error. Any ideas on how?</p>
|
php javascript
|
[2, 3]
|
3,203,452 | 3,203,453 |
Div display based on radio selection
|
<p>Currently I have a piece of code that works fine as long as there are no other divs in the page. If I add other divs, they will close upon any radio selection. I just need a simple modification to the code to open and close without closing all other divs. The working example can be seen here. </p>
<p><a href="http://jsfiddle.net/L5qfn/38/" rel="nofollow">http://jsfiddle.net/L5qfn/38/</a></p>
<p>I added the "wrapper" to the entire contents of the body to demonstrate how everything closes. Take out the wrapper...and things work like I want it to. Any suggestions?</p>
|
javascript jquery
|
[3, 5]
|
3,866,231 | 3,866,232 |
How to prevent Android application from loading multiple times?
|
<p>This must be an easy one but I'm not having much luck searching for an answer.
Apologies if this is a regular question.</p>
<p>If I navigate away from my app I cannot return to it. Starting the app again will load a second instance of it rather than returning to it. If I leave an audio loop running in my app, It's hard to get back in and turn it off.</p>
<p>On startup I'd like the app to destroy any previous instance of itself left running.</p>
<p>I'd also like to try having the app shut itself down when I navigate away (I know it's not the right way to do things but I'd like to try this for my own personal use of the app). Or have the "back" button destroy the app.</p>
<p>Thanks.</p>
|
java android
|
[1, 4]
|
3,744,954 | 3,744,955 |
Read public method values and assing to a textbox
|
<p>Am using the below code to get some values from other page and assign the name and value to the text box. But the below code, I can read the name and value to new_ and new_1 string. But i can't assign the two value to textbox. It returns the error message <code>"Object reference not set to an instance of an object."</code></p>
<p>My partial code is here..</p>
<pre><code>public void load_directions(string name, string value)
{
try
{
txt_name.Text = name.ToString();
txt_value.Text = value.ToString();
}
catch(Exception e1)
{
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,219,284 | 1,219,285 |
Create javascript function in codeigniter
|
<p>Hi I am trying to create a javascript function that I already have the php methods for. Once I can send the url/path data it performs the function.</p>
<p>I am trying to send post_id to the php function (which I can do via myurl.com/dashboard/post_id) but I want to do it via javascript.</p>
<p>Here's what I have so far (it's not a lot):</p>
<pre><code><script type="text/javascript">
function vote(type,post_id)
{
}
</script>
</code></pre>
<p>and then:</p>
<p>onclick="vote('up','');"</p>
<p>I want to send post_id (using variable TYPE: )</p>
<p>myurl.com/dashboard/vote/$post_id</p>
|
php javascript
|
[2, 3]
|
5,377,255 | 5,377,256 |
conditional if for many values, better way
|
<p>Is there a better way to deal with checking multiple values. It starts to get really busy when I have more than 3 choices. </p>
<pre><code>if (myval=='something' || myval=='other' || myval=='third') {
}
</code></pre>
<p>PHP has a function called <code>in_array()</code> that's used like this: </p>
<pre><code>in_array($myval, array('something', 'other', 'third'))
</code></pre>
<p>Is there something like it in js or jquery?</p>
|
javascript jquery
|
[3, 5]
|
2,915,435 | 2,915,436 |
How to convert from String to Date?
|
<p>I am getting the date (which is varchar in database) from database. I want to use this String as a date. the String format is "yyyy-mm-dd". How will it be converted to actual date type?</p>
|
java android
|
[1, 4]
|
237,150 | 237,151 |
ASP.NET Server.Mappath problem from inner folders
|
<p>I have an ASP.NET application where in my APP_Code folder i have a class.In that i have the following code to read the content of an XML file which is in my root folder</p>
<pre><code>XmlDocument xmlSiteConfig = new XmlDocument();
xmlSiteConfig.Load(System.Web.HttpContext.Current.Server.MapPath("../myConfig.xml"));
</code></pre>
<p>My Root folder is having several folders with nested inner folders for some.From the first level of folders when i call the piece of code in the Appcode class,I am able to load the XML file correctly since the path is correct.Now if i call the same piece of code from an innner folder,I am getting an error .If i change the code to the below it will work fine</p>
<pre><code>xmlSiteConfig.Load(System.Web.HttpContext.Current.Server.MapPath("../../myConfig.xml"));
</code></pre>
<p>How can i solve this.I dont want to change the file path for various calls to this code.With what piece of code I can solve the issue so that the program will load the XML file irrespective of the calling position . Any advice ?</p>
<p>Thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
3,487,009 | 3,487,010 |
Check values of all fields of a certain class
|
<p>In jQuery, how do I check the values of all option tags inside of a certain div.class to make sure they are set? </p>
|
javascript jquery
|
[3, 5]
|
1,150,625 | 1,150,626 |
Making navigation links highlight when relevant element passes underneath it, using JavaScript/JQuery?
|
<p>I have a single page website with the navigation menu <code>position:fixed</code> at the top of the page. </p>
<p>When I click a link from the navigation menu the page scrolls to the appropriate section using this JQuery:</p>
<pre><code>$('a[href^="#"]').live('click',function(event){
event.preventDefault();
var target_offset = $(this.hash).offset() ? $(this.hash).offset().top : 0;
$('html, body').animate({scrollTop:target_offset}, 1200, 'easeOutExpo');
});
</code></pre>
<p>What I'd like to happen is when I manually scroll the page <code>$(window).scroll(function(){...});</code>, relevant to the section passing under the navigation menu <code>#navi-container</code>, the navigation link highlights using <code>.addClass('activeNav');</code> </p>
|
javascript jquery
|
[3, 5]
|
1,587,408 | 1,587,409 |
Javascript/Jquery bind Label value to the value of a textbox
|
<p>in an asp.net application,</p>
<p>I have a Label and a textbox.</p>
<p>I want the Label to always have the same value as the text box.</p>
<p>The text box value can be changed by the user or by other functions in the code, and I want the label to change with it.</p>
<p>thanks</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
3,638,796 | 3,638,797 |
Clean php output into javascript
|
<p>Due to the nature of my project. I am pulling data from my db and outputting to javascript. Things were working just fine till I got to the main content. It has strings like (;, :, - ''). How do I ensure that these are displayed without crushing my script coz as for now nothing seems to work.</p>
|
php javascript
|
[2, 3]
|
4,765,708 | 4,765,709 |
Ensuring unique Javascript identifiers in ASP.NET Web User Controls
|
<p>In my current project, I am creating a number of user controls, some of which include some custom Javascript for event handling on the client side. I am registering my event handlers using OnClientClick="function()" and the like.</p>
<p>Now, I'm wondering how to ensure that all Javascript function names are unique for each specific instance of the control, so I don't risk name conflicts between controls. I have thought about putting all functions inside a named object, like</p>
<pre><code>var <%=ClientID%>_Script {
method1: function() { ...}
}
</code></pre>
<p>and then subscribing to events using something like</p>
<pre><code>OnClientClick="<%=ClientID%>_Script.methodName()"
</code></pre>
<p>It just seems like I can't but <%= %>-expressions inside OnClient* attributes. I am therefore wondering; are there some "best practices" for doing this?</p>
|
asp.net javascript
|
[9, 3]
|
3,718,579 | 3,718,580 |
c#.asp.net,inser userids into arrray
|
<p>I have a website in c#asp.net, with each users have own id and password for authentication<br>
i want to store each user id into an array with fields username,time(log in time)when each users log in.How can i create such array. Please give me a solution</p>
|
c# asp.net
|
[0, 9]
|
4,316,401 | 4,316,402 |
How to change number values in PHP when radio button is check or click
|
<p>I have 4 rows in a table.</p>
<p>Each row has 4 radio buttons.</p>
<p>Each radio buttons has value number [1, 2, 3, 4]</p>
<p>When user selects one of the radio buttons, it automatically prints the value in each row. Then I take each value and total them at the bottom of the table.</p>
<p>I'm guessing it can be done with javascript? But how?</p>
<p>Here's a sample PHP code for the row:</p>
<pre><code><input type="radio" name="a" value="1" <?php if($row['a'] == '1'){echo "checked";} ?>/>
</code></pre>
<p>I want to print out the value at the end of each row. Then total the each row's value at the bottom of the table.</p>
<p>Also, here's my php code to total all rows.</p>
<blockquote>
<p>
<pre><code> $total = $a + $b + $c + $d;
echo $total;
?>
</code></pre>
</blockquote>
<p>Thanks! :)</p>
|
php javascript
|
[2, 3]
|
2,924 | 2,925 |
How to initialize textbox to hide for first display and still have jquery work
|
<p>So I now have the following jquery to hide or show a textbox based on specific values selected in a DropDownList. This works except that I need the first display of the popup to always be hidden. Since no index change was made in the drop down list, the following does not work for that. If I code it as visible="false", then it always stays hidden. How can I resolve this?</p>
<pre><code><script language="javascript" type="text/javascript">
var _CASE_RESERVE_ACTION = "317";
var _LEGAL_RESERVE_ACTION = "318";
function pageLoad() {
$(".statusActionDDLCssClass").change(function() {
var value = $(this).val();
if (value == _CASE_RESERVE_ACTION || value == _LEGAL_RESERVE_ACTION) {
$(".statusActionAmountCssClass").attr("disabled", false);
$(".statusActionAmountCssClass").show();
}
else {
$(".statusActionAmountCssClass").attr("disabled", true);
$(".statusActionAmountCssClass").hide();
}
});
}
</script>
</code></pre>
<p>Thank you,
Jim in Suwanee, GA</p>
|
c# asp.net jquery
|
[0, 9, 5]
|
2,861,838 | 2,861,839 |
Navigate Url in Hyperlink is not redirect my page?
|
<p>I have a <code>HyperLink</code> where I use <code>NavigateUrl</code> Attribute and give the URL properly but this link in not redirect the target page. Can you help but when I redirect the URL using code behind then its working properly. I have also mention the code which I use in Code behind, but I don't want to put my code on code behind. Can you help me what is wrong here. </p>
<pre><code> <asp:HyperLink ID="hlnkAddUser" runat="server" onclick="return GB_show('Add Hiring Manager', this.href, 500, 650)"
ImageUrl="~/Images/Resources/thumb/add.png" ToolTip="Add Hiring Manager" Text="Add Hiring Manager"></asp:HyperLink>
**<%--NavigateUrl='<%# "~/Recruiter/AddUser.aspx?UserId=0" + "&ProfileId=" + hdnClientId.Value + "&UserTypeId=8" %>'--%>**
string hlnkAddUserurl = string.Format("~/Recruiter/AddUser.aspx?UserId=0" + "ProfileId=" + hdnClientId.Value + "UserTypeId=8");
hlnkAddUser.NavigateUrl = hlnkAddUserurl;
</code></pre>
|
c# asp.net
|
[0, 9]
|
27,997 | 27,998 |
Nullpointerexception on runOnUiThread
|
<p>I'm getting error reports from users and I have no idea whats wrong with my code. The logcat is this:</p>
<pre><code>java.lang.NullPointerException
at com.laurenswuyts.find.it.MainActivity$LoadPlaces$1.run(MainActivity.java:299)
at android.app.Activity.runOnUiThread(Activity.java:4244)
at com.laurenswuyts.find.it.MainActivity$LoadPlaces.onPostExecute(MainActivity.java:293)
at com.laurenswuyts.find.it.MainActivity$LoadPlaces.onPostExecute(MainActivity.java:1)
at android.os.AsyncTask.finish(AsyncTask.java:602)
at android.os.AsyncTask.access$600(AsyncTask.java:156)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4697)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
at dalvik.system.NativeStart.main(Native Method)
</code></pre>
<p>And it's about this piece of code: </p>
<pre><code>protected void onPostExecute(String file_url) {
// dismiss the dialog after getting all products
pDialog.dismiss();
// updating UI from Background Thread
runOnUiThread(new Runnable() {
public void run() {
/**
* Updating parsed Places into LISTVIEW
* */
// Get json response status
String status = nearPlaces.status;
// Check for all possible status
if(status.equals("OK")){
// Successfully got places details
if (nearPlaces.results != null) {
// loop through each place
for (Place p : nearPlaces.results) {
</code></pre>
<p>Can anyone help me? I'm really stuck on this one ...</p>
|
java android
|
[1, 4]
|
2,869,585 | 2,869,586 |
LinkButton does not invoke on click()
|
<p>Why doesn't this work?</p>
<pre><code> <script src="Scripts/jquery-1.3.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.myButton').click();
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:LinkButton id="ttt" runat="server" PostBackUrl="~/Default.aspx" CssClass="myButton">Click</asp:LinkButton>
</div>
</form>
</code></pre>
|
asp.net jquery
|
[9, 5]
|
1,256,361 | 1,256,362 |
Dump facility in C++ like var_dump() in PHP?
|
<p>When I was in college i did some C/C++, but in near future i was working in PHP, and now I wish to put more time in learning C/C++.</p>
<p>In PHP i was using print_r() or var_dump() in order to display datas from structures or arrays. Do I have such a default functionality in C, in order to see what do i have in a struct or array?</p>
|
php c++
|
[2, 6]
|
5,773,956 | 5,773,957 |
How to use Android to upload file to server with a key?
|
<p>I have a server written by Django, and now I have a demand to upload
file to this server. I used to do it on iPhone using ASIHttpRequest,
the method is pretty straightforward:</p>
<p>[request setFile:self.latestFilePath forKey:@"IPHONEFILE"];</p>
<p>However, after I switched to Android, I tried to look for similar
method without any luck.</p>
<p>I am aware of two methods to send data to server, one is
BasicNameValuePair with key-value pair, which is not suitable for my
program since the file is huge. Another method is InputStreamEntity,
but I don't know how to add a key to it.</p>
<p>Any hint or suggestion would be appreciated!</p>
|
java android
|
[1, 4]
|
2,588,105 | 2,588,106 |
How to add a background theme and/or background wallpaper to my app?
|
<p>How to add a background theme and/or background wallpaper to my app? Right now my app background is plane.</p>
|
java android
|
[1, 4]
|
4,584,711 | 4,584,712 |
Uncaught SyntaxError: Unexpected identifier in chrome's console
|
<pre><code>var pattern = new RegExp(/^[a-zA-Z0-9_\.\-]+$/);
if(!pattern.test($(this).val()){
$('#rlog div.ttc').prop('class','tooltip ttc bad').html('Используйте символы A-Z, a-z и 0-9');
}
</code></pre>
<p>Uncaught SyntaxError: Unexpected identifier on the line in the if.
But there are no mistakes if I write something like this:</p>
<pre><code>var pattern = new RegExp(/^[a-zA-Z0-9_\.\-]+$/);
$('#rlog div.ttc').prop('class','tooltip ttc bad').html('Используйте символы A-Z, a-z и 0-9');
</code></pre>
<p>I have no idea what the problem is. Hope, you'll help me</p>
|
javascript jquery
|
[3, 5]
|
1,083,378 | 1,083,379 |
javascript jquery url part trimming
|
<p>I have a url like</p>
<pre><code>http://www.blah.com/something/maybesomethingelse/Webservices/something.asmx/blah
</code></pre>
<p>That is being passed through a jquery ajax request.</p>
<p>I want to remove everything after /Webservices/ so I can stick a new page in for error handling.</p>
<p>so ideally this would return</p>
<pre><code>http://www.blah.com/something/maybesomethingelse/Webservices/
</code></pre>
<p>Then i could just concat on the new page.</p>
<p>Thanks for your help :) </p>
|
javascript jquery
|
[3, 5]
|
123,734 | 123,735 |
calling same function after timeout malfunctioning
|
<pre><code>$(document).ready(function () {
tabSlideOut()
}
function tabSlideOut() {
$('.slide-out-div').tabSlideOut({
//----
});
</code></pre>
<p>Want call tabslideout hide after 3 second showing the success or error message so i call it after timeout , </p>
<pre><code>setTimeout(function () { tabSlideOut(); }, 3000)
</code></pre>
<p>but it malfunctioning it repeat hiding and showing again and again please any one can guide me to to do this </p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
718,849 | 718,850 |
Replicate paragraph text using jQuery
|
<p>I have a paragrah that I need to replicate dynamically. How do I do this in jQuery? Here is example code: </p>
<pre><code><p class="info">Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</code></pre>
<p>The paragraph needs to be copied to another part of the page that will look like this: </p>
<pre><code><p id=print-info> jQuery inserted paragraph text </p>
</code></pre>
<p>I have thought of using the <code>.attr()</code> method but not sure how to go about doing that for paragraph text.</p>
|
javascript jquery
|
[3, 5]
|
5,205,990 | 5,205,991 |
How can I insert a new row into a grid view control?
|
<h1>Duplicate:</h1>
<blockquote>
<p><a href="http://stackoverflow.com/questions/594088/how-to-insert-row-in-grid-view/">How can I insert a new row into a grid view control?</a></p>
<p><a href="http://stackoverflow.com/questions/181158/how-to-programmatically-insert-a-row-in-a-gridview">How to programmatically insert a row in a GridView?</a></p>
</blockquote>
<p>I want to insert a new row when I click a button control. </p>
<p>I want all the buttons to be located on the side of the grid control and when I click the <code>new</code> button to add a new empty record, it should fill the row with data after I click save and add it to a DB table.</p>
<p>I don't want to choose a data source to bind to the grid control.</p>
|
c# asp.net
|
[0, 9]
|
5,357,242 | 5,357,243 |
How does jQuery.get() work?
|
<p>I'm trying to use this: <a href="http://api.jquery.com/jQuery.get/" rel="nofollow">http://api.jquery.com/jQuery.get/</a> and I don't understand why the examples look like this:</p>
<pre><code> $.get("test.php");
</code></pre>
<p>I've never seen the syntax $.get ? Why wouldn't I do something like </p>
<pre><code>$jQuery = new JQuery();
$jQuery.get(...);
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,565,398 | 4,565,399 |
Any difference between parse and convert?
|
<p>Is there any difference between</p>
<pre><code>Convert.ToDateTime
</code></pre>
<p>and</p>
<pre><code>DateTime.Parse
</code></pre>
<p>Which one is faster or which is more secure to use?</p>
|
c# asp.net
|
[0, 9]
|
1,317,247 | 1,317,248 |
android error unknown method 'getTitle'
|
<p>Hello i'm testing the following code it's suppose to list all apps installed on an android powered machine.
To edit an compile it i use <a href="https://play.google.com/store/apps/details?id=com.aide.ui&feature=search_result" rel="nofollow">AIDE</a>
an android java editor the problem is that AIDE always showing me an error: " unknown method 'getTitle'".
Someone can help me please?</p>
<pre><code>public class AppListAdapter extends BaseAdapter {
private LayoutInflater mInflater;
private List<App> mApps;
public AppListAdapter(Context context) {
// cache the LayoutInflater to avoid asking for a new one each time
mInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return mApps.size();
}
@Override
public Object getItem(int position) {
return mApps.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int pos, View convertView, ViewGroup parent) {
AppViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.row, null);
// creates a ViewHolder and stores a reference to the child view
holder = new AppViewHolder();
holder.mTitle = (TextView) convertView.findViewById(R.id.apptitle);
convertView.setTag(holder);
} else {
// reuse/overwrite the view passed assuming(!) that it is castable!
holder = (AppViewHolder) convertView.getTag();
}
holder.setTitle(mApps.get(pos).getTitle());
return convertView;
}
public void setListItems(List<App> list) {
mApps = list;
}
/**
* A view holder which is used to reuse views inside a list.
*/
public class AppViewHolder {
private TextView mTitle;
/**
* Sets the text to be shown as the app's title
*
* @param title the text to be shown inside the list row
*/
public void setTitle(String title) {
mTitle.setText(title);
}
}
}
</code></pre>
|
java android
|
[1, 4]
|
5,505,366 | 5,505,367 |
Implementing a slide down for table rows
|
<p>I am trying to implement a slide down for table rows using the previous post <a href="http://stackoverflow.com/questions/467336/jquery-how-to-use-slidedown-or-show-function-on-a-table-row">here</a></p>
<p>I have a <code>newrole</code> table where I click on add icon and it gets added to <code>rolecart</code> table with 3 rows for each item. First row is copied as it is from the role table the next 2 rows are added using jQuery, below is the code.</p>
<pre><code>$("#table_newrole img.move-row").live("click", function() {
var tr = $(this).closest("tr").remove().clone();
tr.find("img.move-row")
.attr("src", "/gra/images/icons/fugue/cross-circle.png")
.attr("alt", "Remove");
// first row copied from the source table as it is
$("#table_rolecart tbody").append(tr);
// next two rows added like this
var $inputtr = $('<tr><td colspan="3">Business Justification: &nbsp;<input type="text" id="ar_businessjust"></td></tr><tr><td colspan="2">Start Date: <input type="text" id="ar_startdate"></td> <td colspan="1">End Date: <input type="text" id="ar_enddate"></td></tr>');
$("#table_rolecart tbody").append($inputtr);
});
</code></pre>
<p>When I add next item to the cart I want the previous item's last 2 rows to slide up (I will later provide and icon to slide down to show these rows)</p>
<p>Need to know how to implement this. more specifically I need to know how do I select previous cart items last 2 rows and then apply the slideup to the divs.</p>
|
javascript jquery
|
[3, 5]
|
1,123,583 | 1,123,584 |
Store the text entered by the user as it is in the database C#
|
<p>How to store the text entered by the user as it is in the database. Suppose if the user entered the text in proper case then the data should be stored in proper case in the database. If the user entered the text in upper case then the data should be stored in upper case and likewise. I am changing the textbox style property according to the user setting in the database. If the user setting is in proper case then using style i am setting the textbox property to title case and proper case likewise. But when storing the data the text is entered in lower case irrespective of the case in which the user entered.</p>
<pre><code>CompanyMasterClass cm = new CompanyMasterClass();
cm.strcompany_code = Request.Cookies["userinfo"]["companycode"];
ResultClass objress = cm.fn_GetNameNumberStyle();
if (objress.bStatus)
{
eslist<CompanyMasterClass> OBJLISTS = objress.objData as eslist<CompanyMasterClass>;
if (OBJLISTS.Count > 0)
{
ViewState["namestyle"] = OBJLISTS[0].strname_style.ToString();
if (OBJLISTS[0].strname_style.ToString() == "PC")
{
//txtGroupName.Text = "";
//txtGroupSname.Text = "";
}
if (OBJLISTS[0].strname_style.ToString() == "UC")
{
txtGroupName.Style.Add("text-transform", "uppercase");
txtGroupSname.Style.Add("text-transform", "uppercase");
lblGroupName.Style.Add("text-transform", "uppercase");
}
if (OBJLISTS[0].strname_style.ToString() == "UG")
{
// txtGroupName.Text = "";
//txtGroupName.Text = "";
}
}
}
</code></pre>
<p>Here I am setting the textbox style according to the property set in the database by the user. </p>
<p>How to store the text entered by the user with the case in the database?</p>
<p>Thanks,</p>
|
c# asp.net
|
[0, 9]
|
350,279 | 350,280 |
moving asp.net membership specific settings to a separate config file
|
<p>Is it possible to move the asp.net membership/role settings to a separate config file. This is helpful for custom membership providers.</p>
<pre><code><authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="144600" slidingExpiration="true">
</authentication>
<membership defaultProvider="TestMembership">
<providers>
<add name="TestMembership" type="Test.Membership.TestMembership">
</providers>
</membership>
<roleManager enabled="true" defaultProvider="TestRole"
cacheRolesInCookie="true" cookieName=".Test" cookieTimeout="1440"
cookiePath="/">
<providers>
<add name="TestRole" type="Test.Membership.TestRole" />
</providers>
</roleManager>
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,525,106 | 5,525,107 |
jQuery .not() method not working correctly
|
<p>I'm trying to make all textareas remove default text on focus, <strong>except</strong> those of class "pre-fill".
But the problem is the textareas of class "pre-fill" are still being selected and included.</p>
<p>Suggestions on how to fix this?
Thanks.</p>
<pre><code>jQuery(document).ready(function inputHide(){
$('textarea, input:text, input:password').not($('.pre-fill')).focus(function() {
if ($(this).val() === $(this).attr('defaultValue')) {
$(this).val('');
}
}).blur(function() {
if ($(this).val()==='') {
$(this).val($(this).attr('defaultValue'))
}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,936,515 | 3,936,516 |
Use PersistJS to save server-side data to display data to client?
|
<p>I'm new to programming in javacript so I don't know if what I want to accomplish is possible.. </p>
<p>I'm doing a project for my digital art class: mypage.iu.edu/~hplagema/project4/index.html (please click all the hotspots you can to navigate to the end page, which is frog.html) </p>
<p>I am looking for something simple I can use to display information of artifacts the user has found. When my project is finished, you should be able to navigate back to search more areas and find more artifacts like the frog. This might be too much for a cookie (?) since the list will be about 10 items. </p>
<p>I found PersistJS but the example they give is too complex for me to diassemble. What I want to do is edit the data directly from the server side using an Array. Is this possible? If not, what is the easiest way to do this? </p>
|
php javascript
|
[2, 3]
|
2,927,450 | 2,927,451 |
Do controls need to be defined in a web app or will .NET do it for you
|
<p>I always thought that when you dropped a control onto an .aspx page that a declaration of that control ended up being generated for you (either in a designer file, or within your code behind). All of the apps I have worked on have worked this way.<br>
A coworker of mine was installing resharper and it was showing that all her code behind pages would not build. Turned out that resharper could not find a definition for any control that she has dropped onto her markup. She has no designer files, and no declarations in markup. Do they get automatically built when putting together the partial classes? Is there an option at that page/project level to instruct .NET to do this for you? Is this a difference between web app and web site? </p>
<p>This is a a .NET 3.5 site, C#, and it is running in a production environment.</p>
<p>Thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
4,382,570 | 4,382,571 |
Extracting the id in all these cases
|
<p>How can I always extract the number 11 in all these cases. </p>
<pre><code>id="section-11"
id="test-11"
id="something-11"
</code></pre>
<p>I do <code>$(this).attr('id');</code> then what do I do next?</p>
|
javascript jquery
|
[3, 5]
|
5,140,138 | 5,140,139 |
Any way to pass an object from c# code behind to javascript?
|
<p>I want to pass an object from my c# code behind to my javascript. I know that I can use </p>
<pre><code>var myVar = '<%# myVar %>'
</code></pre>
<p>to pass variables. However, that method seems to pass everything as a string. I want an object. </p>
<p>Is there any way to accomplish that?</p>
|
c# javascript
|
[0, 3]
|
4,703,498 | 4,703,499 |
scroll to animate selected anchor in jquery
|
<p>I have simple JS function that's animate page scroll to selected anchor by id </p>
<p>all anchor in my page have different offset value and position
tip: I user masonry effect
but does not work correctly </p>
<pre><code>function scrollToAnchor(aid) {
var aTag = $("a[id='" + aid + "']");
$('html,body').animate({ scrollTop: aTag.position().top }, 'slow');
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,907,831 | 2,907,832 |
How to write the code for self expiring download link for asp.net website?
|
<p>I am planning to sell digital goods on my website (Asp.net). After successful payment the customer will be redirected to the download page of my website, which will display the link to download the digital content stored in my server. </p>
<p>I want to secure the location of the file, by creating a disposable link to the file. Every time a customer visits this page a new download link will be generated for the same file. Also this link should expire after it is downloaded for the first time. </p>
<p>Is it possible to do it in asp.net ( C# preferably )? if yes how can i do it? </p>
|
c# asp.net
|
[0, 9]
|
3,939,959 | 3,939,960 |
Select all textboxes using jQuery
|
<p>I have code which displayed a person's info in a table(fields:name, surname, address, etc.) and one of the inputs is a checkbox. The code is as follows:</p>
<pre><code> $("#table").append('<tr class="trow'+j+'">'+
'<td class="ids" id="z'+i+'">'+totrecs+'</td>'+
'<td>'+member[i].jdate+'</td>'+
'<td class="users"
'<td id="contact'+i+'">'+member[i].fname+' '+member[i].lname+'</td>'+
'<td id="myaddress'+i+'">'+member[i].address1+' '+member[i].town+'</td>'+
'<td><input type="checkbox" name="whome" id="showMe'+i+'"'+
'class="boxes" onclick="getMe('+i+')" /></td></tr>');
totrecs++;
j++;
}
</code></pre>
<p>What I am tryin to do is program a function that when clicking a certain button all of the checkboxes will be selected/checked.</p>
<p>I would appreciate any help. Thank You.</p>
|
javascript jquery
|
[3, 5]
|
1,373,250 | 1,373,251 |
VariableDeclaratorId and misplace
|
<p>I'm new to JAva and Android, and I'm working on my first test app.</p>
<p>I have this code (This is the whole code):</p>
<pre><code>package test.test;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
int num_seeds = 15 ;
int num_coins = 100 ;
int seed_buy_price = 10 ;
int seed_sell_price = 8 ;
String S_num_seeds = Integer.toString(num_seeds) ;
TextView textView_seeds_current_display = (TextView) findViewById(R.id.textView_seeds_current_display) ;
textView_seeds_current_display.setText(S_num_seeds) ;
}
</code></pre>
<p>But Eclipse shows me an error on last line:
Multiple markers at this line
- Syntax error on token "S_num_seeds", VariableDeclaratorId expected after this
token
- Syntax error on token(s), misplaced construct(s)</p>
<p>I'm new to Java and I still can not understand this quite well. Could somebody please point me what am I doing wrong? I think I'm following the advice from here:</p>
<p><a href="http://stackoverflow.com/questions/5821051/how-to-display-the-value-of-a-variable-on-the-screen">How to display the value of a variable on the screen</a></p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
2,986,020 | 2,986,021 |
How to find a particular string in a paragraph in android?
|
<p>In my project the data is stored in html format along with image tag. For example the following data is stored in html format and it contains 2 to 3 images.</p>
<p>Mother Teresa as she is commonly known, was born Agnes Gonxha Bojaxhiu. Although born on the 26 August 1910, she considered 27 August, the day she was baptized, to be her "true birthday". “By blood, I am Albanian. By citizenship, an Indian. By faith, I am a Catholic nun. As to my calling, I belong to the world. As to my heart, I belong entirely to the Heart of Jesus." <strong>img ----- src="image1.png" ----></strong> Mother Teresa founded the Missionaries of Charity, a Roman Catholic religious congregation, which in 2012 consisted of over 4,500 sisters and is active in 133 countries.<strong>img ----- src="image2.png" ----></strong>. She was the recipient of numerous honours including the 1979 Nobel Peace Prize. She refused the conventional ceremonial banquet given to laureates, and asked that the $192,000 funds be given to the poor in India.
<strong>img ----- src="image3.png" ----></strong></p>
<p><strong>Now from the above data I need to find how many images the paragraph has and need to get all the image names along with the extensions and should display them in android. Tried with splitting but did not work. Please help me regarding this.</strong></p>
<p>Thanks in advance </p>
|
java android
|
[1, 4]
|
112,934 | 112,935 |
only show menu item after it's been hovered on for a period of time
|
<p>I have a list item that when hovered upon slides down another inner list. Problem I'm having is if you quickly hover over it accidentally it slides down and some times even ends up in a weird loop where it bounces between closed and open. My solution is to set a slight delay before showing it.</p>
<pre><code> $('#overlayNav li').hover(
function() {
var that = this;
setTimeout(function(){test(that)},1000);
function test(param) {
if(param.id) {
$(param).find('ul').slideDown({easing: "easeOutBounce", duration: 900});
}
},
</code></pre>
<p>Problem is all this code does it delay the slide. The hover is still detected even if you hover for a fraction of a second as before...the only difference is that there's now a delay before it shows...what I need to say is after the timeout if the mouse is still over that element then show it. How do i do this?</p>
|
javascript jquery
|
[3, 5]
|
6,147 | 6,148 |
jquery: Get full css property set as string from an element
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/754607/can-jquery-get-all-css-styles-associated-with-an-element">Can jQuery get all CSS styles associated with an element?</a> </p>
</blockquote>
<p>How to get the full css property set as string from an element with jQuery or JavaScript?</p>
<pre><code>var x = $('myelement').css().toString();
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,417,059 | 1,417,060 |
Go Back to Previous Page
|
<p>I am using a form to "Rate" a page. This form "posts" data to a php script elsewhere. I simply want to display a link after the form is processed which will bring the user back to previous page. Can I do this using javascript in my php script?</p>
<p>GF</p>
|
php javascript
|
[2, 3]
|
1,132,158 | 1,132,159 |
Running continuous events after each other
|
<p>I've been trying to make this for 2 days, I apologize I'm new to Javascript/Jquery and I'm in the learning process.</p>
<p>I'm trying to create a javascript when the page is loaded will have an image fade in and fade out and after the first image fades in and out then a second, third, etc. however many I need. </p>
<p>I know this is a newby question but I'm clearly not sure what to look for at this point. And I have been doing research and learning along the way, I just would like to have it sooner than I may be able to accomplish.</p>
<p>Any help is appreciated.</p>
<p>This is what I came up with which to me looks completely invalid, but seems to work:</p>
<pre><code> <div class="splashbg1" style="display: none;"></div>
<div class="splashbg2" style="display: none;"></div>
<div class="splashbg3" style="display: none;"></div>
<div class="splashbg4" style="display: none;"></div>
<div class="splashbg5" style="display: none;"></div>
<script>
$(document).ready(function() {
$('.splashbg1').fadeIn(1300, function() {
$('.splashbg1').fadeOut(1300, function() {
$('.splashbg2').fadeIn(1300, function() {
$('.splashbg2').fadeOut(1300, function() {
$('.splashbg3').fadeIn(1300, function() {
$('.splashbg3').fadeOut(1300, function() {
$('.splashbg4').fadeIn(1300, function() {
$('.splashbg4').fadeOut(1300, function() {
$('.splashbg5').fadeIn(1300, function() {
});
});
});
});
});
});
});
});
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,402,882 | 2,402,883 |
Database reading in load event
|
<p>I made a website (asp.net, c#) width database reading and writind in the load event. The problem is: when the loading page's aspx.cs in runed down, the process is jumping to the master page's aspx.cs (session validation), then jumping back to my "loading" page's aspx.cs. This do it by 4 times, so at the end I have got 4 new records in my database table, but I need only one.
I think my database code is goog, because is it is a button click event is works fine.
<br><br>
Where should i put database (mssql) reading in my asp.net websit source code?<br>
Is it good in load event?<br>
<br></p>
|
c# asp.net
|
[0, 9]
|
1,344,342 | 1,344,343 |
Alerting the user of a TO-DO task whos alert date and time is stored in the db
|
<p>I am very new to android and I am developing this app which allows users to have a TO-DO list where they can add a task and associate a date and time as to when the task has to be carried out.I need to store the date, time and the task on SQLlite DB and need to cause an alarm when the time is due for the alarm.But I am not able to figure out a proper approach for this.
Help appriciated.</p>
|
java android
|
[1, 4]
|
5,814,127 | 5,814,128 |
Javascript: Detect an image's loading status, and only swap out the old image when the new one is 'loaded'?
|
<p>i call on a PHP script that generates graph images for me, however, it takes a few seconds. Is there a way to detect when it has finished loading, on the user side, and only swap it with the old image when the php script has finished and the image is ready?</p>
<p>here is the Javascript function i use to call the PHP script:</p>
<p>EDIT (CODE UPDATED)</p>
<pre><code>function loadGraph(self,graph,varID) {
var img = new Image();
img.onload = function() {
$(self).parents().parents().siblings(".graph_container").empty().append(img);
};
img.src = 'drawGraph.php?type=journey_report&amp;graph=' + graph +
(varID != null ? '&amp;varID=' + varID : '') + '&amp;companyID=<?php echo $_SESSION['companyID'] ?>';
}
</code></pre>
<p>and here is the graph container and the link that uses that function:</p>
<pre><code><div class="graph_container">
<img src="drawGraph.php?type=journey_report&graph=outOfDate_vs_upToDate&companyID=<?php
echo $_SESSION['companyID'] ?>" />
</div>
<div class="reportItemWrapper">
<div class="reportItem"><a href="#" onclick="loadGraph(this,'outOfDate_vs_upToDate'); return false"><b>Total</b></a></div>
</code></pre>
<p>thanks!</p>
|
javascript jquery
|
[3, 5]
|
1,954,674 | 1,954,675 |
What should i learn after getting good knowledge of XHTML, CSS, Web Standards, Accessibility? Javascript or PHP?
|
<p>What should i learn after getting good knowledge of XHTML, CSS, Web Standards, Accessibility,Usability, Information Architecture and Adobe Photoshop?</p>
<h2>Javascript/jquery</h2>
<p>or </p>
<h2>PHP</h2>
<p>First I want to learn and be focus to learn anyone of these two? Which language would be good to learn first?</p>
|
php javascript
|
[2, 3]
|
3,508,178 | 3,508,179 |
How to Change the URL without doing any Server Trip
|
<p>I want to change the URL (QueryString Data) after the Page gets Displayed.
How can i do it ?</p>
|
asp.net javascript
|
[9, 3]
|
4,830,251 | 4,830,252 |
Arrays in php & javascript syntax issues
|
<p>I have got my self confused on how to construct arrays correctly in PHP prior to my json encode to check them in javascript.</p>
<p>I'm trying to store an array of objects with their grid reference (x,y)</p>
<p>So i do this in php:</p>
<pre><code> $get = mysql_query("SELECT x,y,sid FROM $table WHERE uid='1'") or die(mysql_error());
while($row = mysql_fetch_assoc($get)) {
$data[$row['x'].$row['y']] = $row['sid'];
}
//print_r($data);
$data = json_encode($data);
</code></pre>
<p>In javascript i then try to check if a object exists on a given co-ordinate so i try this:</p>
<pre><code> for (i=0;i<tilesw;i++){ //horizontal
for (j=0;j<tilesh;j++){ // vertical
if(sdata[i.j]){
alert(sdata[i.j][sid]);
}
}
}
</code></pre>
<p>sdata is my array after json encode.</p>
<p>My json encode looks like this:</p>
<pre><code> {"44":"0","21":"0"}
</code></pre>
<p>Problem is i get :
Uncaught SyntaxError: Unexpected token ] on the alert line.</p>
<p>Also is my approach correct or is there a better way to construct my array?</p>
|
php javascript
|
[2, 3]
|
687,965 | 687,966 |
automatic scroll down on search
|
<p>I have a jsp page in which there are some contents which are hidden.</p>
<p><code>onclick</code> of the search button I have displays much content.</p>
<p>But I want an automatic scroll down so that user doen't have to take the burden to scroll down.</p>
<p>I hope I was</p>
|
javascript jquery
|
[3, 5]
|
4,866,344 | 4,866,345 |
Find the time after 15 minutes of given time in javascript
|
<p>Find the time after 15 minutes of given time in javascript
Example : given time is 2012-01-10 5:50 and I need to get like 2012-01-10 6:05</p>
|
javascript jquery
|
[3, 5]
|
3,621,029 | 3,621,030 |
Detecting if a listener has be registered
|
<p>how can i detect if a new listener has been registered for any widget in my android app. Is there a place where i can intercept the listener when its being registered ?</p>
|
java android
|
[1, 4]
|
3,436,184 | 3,436,185 |
Local js function to other site that will write a cookie
|
<p>im the owner of domain <code>A.com</code> and <code>B.com</code></p>
<p>in <code>B.com</code> i have handler (ashx) which writes a cookie.</p>
<p>now , im on A.com.</p>
<p>i want to call this handler from site <code>A.com</code> via <code>Js</code>(/jquery) that will activate the <code>B.com's</code> handler - and will write the cookie of B.com in My browser.</p>
<p>does jsonP will help me here ?</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
1,435,587 | 1,435,588 |
How can I "click" all divs in the firebug console?
|
<p>How can I perform a "click" action on all the rows that start with "user_" in the following html:</p>
<pre><code><div id="rows">
<div id="user_1"></div>
<div id="user_2"></div>
<div id="user_3"></div>
<div id="user_4"></div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,207,476 | 1,207,477 |
asp.net c# ÅÄÖ UTF-8
|
<p>I have problem with special chars like ÅÄÖ they prints out like "Ã¥ ä ö Ã… Ä Ö"</p>
<p>FB.ui({method: 'apprequests',
title: 'We LOVE U!',
message: 'å ä ö Å Ä Ö',
filters: ['app_non_users'],
}, requestCallback);</p>
|
c# asp.net
|
[0, 9]
|
4,815,314 | 4,815,315 |
Repeater Paging
|
<p>I am using the following code for paging inside a repeater. I have the paging size set to 3. If there are exactly 3 speech bubbles - the next button is displayed and when I selected I'm redirected to an empty page. However, if there are 4 sepeech bubbles, everything is fine. Is there a way to make sure that if the page size is 3 - no buttons are displayed? Thanks!</p>
<pre><code> PagedDataSource pagedData = new PagedDataSource();
pagedData.DataSource = ds.Tables[0].DefaultView;
pagedData.AllowPaging = true;
pagedData.PageSize = 3;
pagedData.CurrentPageIndex = pageNum;
Repeater1.DataSource = pagedData;
Repeater1.DataBind();
cmd.Connection.Close();
cmd.Connection.Dispose();
if (pageNum == 0)
{
btnPrev.Visible = false;
}
if (pageNum >= Math.Floor((decimal)ds.Tables[0].Rows.Count / 3))
{
btnNext.Visible = false;
}
}
protected void btnNext_Click(object sender, EventArgs e)
{
// Redirects to next page
Response.Redirect("negativestorydetail.aspx?guid=" + id + "&name=" + name + "&role=" + company_role + "&member=" + mem_id + "&company=" + co_id + "&project=" + proj_name + "&proj_id=" + proj_id + "&tag=" + tag + "&page=" + Convert.ToString(pageNum + 1));
}
protected void btnPrev_Click(object sender, EventArgs e)
{
// Redirects to previous page
Response.Redirect("negativestorydetail.aspx?guid=" + id + "&name=" + name + "&role=" + company_role + "&member=" + mem_id + "&company=" + co_id + "&project=" + proj_name + "&proj_id=" + proj_id + "&tag=" + tag + "&page=" + Convert.ToString(pageNum - 1));
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
342,269 | 342,270 |
Adding an Object to StringBuilder
|
<p>I'm pretty new to Android development, and what I'm trying to do is display the contents of an <code>ArrayList</code> in a <code>TextView</code>.</p>
<p>I've been attempting to convert the <code>ArrayList</code> into an <code>Array</code>, and then append each item to a <code>StringBuilder</code>. However, the <code>StringBuilder</code> doesn't appear to allow me to append an <code>Object</code> from the <code>Array</code>. Can anyone tell me why, or in fact provide a better solution?</p>
<pre class="lang-java prettyprint-override"><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
ArrayList<String> temp = new ArrayList<String>();
temp = data.getStringArrayListExtra("intentReturn");
Object obj[] = temp.toArray();
for(int i = 0; i < obj.length; i++){
sBuilder.append((String)obj[i]); //This is the line which crashes the app
if(i < obj.length - 1){
sBuilder.append(", ");
}
}
tvResult.setText(sBuilder.toString());
}
</code></pre>
<p>Many thanks in advance.</p>
|
java android
|
[1, 4]
|
2,154,963 | 2,154,964 |
jQuery.clone() causes browser to hang
|
<p>Why does the following jQuery code cause my browser to hang?</p>
<h3>Caution: do not run this unless you are prepared to force quit your browser</h3>
<pre><code><!DOCTYPE HTML>
<title>Simple clone</title>
<script type="text/javascript" src="jquery.js"></script>
<div>
<script>$('div').clone().appendTo('body');</script>
</div>
</code></pre>
<h3>Edit</h3>
<p>For those in the "infinite loop" camp, that should not be an issue. A perfectly safe (non-jQuery) version is:</p>
<pre><code> <div>div
<script>
var el = document.getElementsByTagName('div')[0];
document.body.appendChild(el.cloneNode(true));
</script>
</div>
</code></pre>
<p>So the issue is specifically related to how jQuery does clones.</p>
<h3>Edit 2</h3>
<p>It seems that jQuery causes script elements in clones to be executed. That isn't standard behaviour and is something about how jQuery does clones that is quite unexpected.</p>
|
javascript jquery
|
[3, 5]
|
2,509,323 | 2,509,324 |
Can someone figure out what this JavaScript code is doing?
|
<p>I'm trying to figure out how a website works, and I've come to some packed JavaScript that won't seem to unpack with JSBeautifier.org. Can someone understand what it's doing?</p>
<pre><code>eval(function (p, a, c, k, e, r) { e = String; if (!''.replace(/^/, String)) { while (c--) r[c] = k[c] || c; k = [function (e) { return r[e] } ]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('$(\'#0\').1(\'\');', 2, 2, 'timestamp|val'.split('|'), 0, {}))
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,882,029 | 2,882,030 |
Javascript initial data strategy
|
<p>In order to keep my page clean i have created a few javascript files that are combined at production mode into fewer files.<br>
I am using a data- attribute in body to determine which script to run.The problem is that when i need some initial data.In this case i use a script tag and put there a json array with my data.
These data may change so i am wondering whether it is better to make a json request for the data and not put them in my page directly ?</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.