Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
5,095,929
5,095,930
Passing a Int value to another class
<p>I have four groups in a listview each with four url's I want to load in a webView. When the user select a url to goto I set a value like so;</p> <pre><code> if (position == 0) webb = webb +2; { Intent intent = new Intent(this, official.class); startActivity(intent); } </code></pre> <p>I then carryout the intent to move to the webView class where I have given each url a value like so;</p> <pre><code>if (webb == 2) mWebView.loadUrl("http://yahoo.com"); if (webb == 3) mWebView.loadUrl("http://www.bbc.co.uk"); </code></pre> <p>But the screen stays blank, if I state the value inside the official.class it works.</p> <p>How can I get this value to pass to another class based on the selection the user makes from the listview. Sorry if this is hard to understand.</p>
java android
[1, 4]
5,455,084
5,455,085
Reading Numbers From Text
<p>Ok so I have the following code:</p> <pre><code>string numbers = File.ReadAllText("numbers.txt"); StringSplitOptions.RemoveEmptyEntries); List&lt;string&gt; List = new List&lt;string&gt;(); List.AddRange(allNumbers); return List; </code></pre> <p>Currently the numbers.txt file is in a directory on my machine, but I want the text file to be integrated into my solution in a file such as numbers/numbers.txt. How do I read from <em>that</em> file instead of reading it from the default file VS2010 likes to read from? I already have a file in my solution called numbers with the respective file in it. </p>
c# asp.net
[0, 9]
1,731,141
1,731,142
Javascript - how to set child drop down menu based on parent dropdown menu selection
<p>For example take a look at <a href="http://katz.cd/submit.php" rel="nofollow">http://katz.cd/submit.php</a>. Notice when you select a type, that type is carried through to all the other type dropdown menus.</p> <p>How do I do this?</p>
javascript jquery
[3, 5]
4,503,183
4,503,184
open a file before uploding through file uploder in asp.net
<p>I want to upload an exe to web server from client system through file up-loader and want to run/open that exe before uploading .how can i run/open that exe before uploading it.</p>
c# asp.net
[0, 9]
1,062,672
1,062,673
Difference between Javascript and PHP
<p>What is the difference between PHP and Javascript? </p> <p>I know one is server side scripting and the other is browser side. but what I'm asking is that using Javascript, can I display alert messages,which i can simply do with PHP also,without using any function, or using some if-else combination. </p> <p>So are PHP and Javascript are exclusive, like if i use one then the other one should not be used, or?</p>
php javascript
[2, 3]
4,864,917
4,864,918
How to pass the value of a textbox in a datagrid to javascript
<p>I have a textbox inside my datagrid whose id need to be passed to javascript.The id of my datagrid is Datagrid1 and that of textbox is txtItem.All these are inside a contentplaceholder.Now i have passed the id of textbox as ct100_ContentPlaceholder1_Datagrid1_txtItem.It shows an error in my javascript as "Object reference not set to an instance of an object".How can i pass the id of this textbox which is inside a datagrid to javascript.</p>
asp.net javascript
[9, 3]
5,589,834
5,589,835
jquery function inside a long process
<p>I have jquery script:</p> <pre><code>$("#theid").fadeTo(1000,0.01).getxmo().fadeTo(1000,1); function getxmo(){ $('#output').append('okay!'); } </code></pre> <p>It is not running the function part...</p> <p>What's the correct syntax to run a function in this way please!</p>
javascript jquery
[3, 5]
2,786,138
2,786,139
How do I synchronize the scroll position of two divs?
<p>I want to have 2 divs sized to a particular width (i.e. 500px). One above the other aligned horizontally.</p> <p>The top box should hide its scroll bar, the bottom should show a scroll bar and when the user scrolls I'd like the offset of the top box to change to the value of the bottom box. So that when the bottom DIV scrolls horizontally it appears that the top DIV is also scrolling in unison.</p> <p>I'm happy to do this in Jquery if it makes the process easier.</p>
javascript jquery
[3, 5]
385,991
385,992
get data from page that a url points to
<p>Given a Url, I'd like to be able to capture the Title of the page this url points to, as well as other info - eg a snippet of text from the first paragraph on a page? - maybe even an image from the page.</p> <p>Digg.com does this nicely when you submit a url.</p> <p>How could something like this be done in .Net c#?</p>
c# asp.net
[0, 9]
295,705
295,706
C# and ASP - Setting a command argument, then command argument disappearing
<p>I'm trying to use a gridviewcommand to delete an entry in the gridview (as well as from the datacontext), but I want to ask the user to confirm or not first. I have a seperate linkbutton to execute the delete code using the ID of the item in the row that the user clicked the delete button in. </p> <p>When the user clicks delete, my codebehind sets the CommandArgument property of the other linkbutton to basically be the same command argument that it passed. But when the user goes to confirm the deletion, all of a sudden the commandargument of the confirmation link is an empty string? Is the property being flushed after the first postback?</p> <p>Here is my code:</p> <p>ASPX</p> <pre><code>&lt;asp:LinkButton ID="lbDelete" runat="server" Text="Delete" CommandName="delete" CommandArgument='&lt;%# Eval("TheId") %&gt;' /&gt; //Delete LinkButton &lt;asp:LinkButton ID="confirmDelete" runat="server" OnClick="confirmDelete_Click" Text="Delete" /&gt; //Confirmation Button </code></pre> <p>C#</p> <pre><code>rowCommandFunction(object sender, GridViewCommandEventArgs e) { // blah blah blah ... confirmDelete.CommandArgument = e.CommandArgument.ToString(); ...// I've put a breakpoint here, and it is setting the value properly... } confirmDelete_Click(object sender, EventArgs e) { //...but when this line tries to run, comfirmDelete.CommandArgument is set to an empty string? int selectedId = int.Parse(confirmDelete.CommandArgument); ... } </code></pre>
c# asp.net
[0, 9]
923,212
923,213
jquery - Remove class from parent in list
<p>I need a Javascript <code>IF</code> statement that detects if: </p> <pre><code>$('.ms-quickLaunch .menu ul.static li a .menu-item-text') == "Manage" </code></pre> <p>And if it does equal "Manage" then set the list to <code>.show().</code></p> <pre><code>&lt;ul class="root static"&gt; &lt;li class="static linksBelow"&gt; &lt;a href="#" class="static menu-item"&gt; &lt;span class="additional-background"&gt; &lt;span class="menu-item-text"&gt;Manage&lt;/span&gt; &lt;/span&gt; &lt;/a&gt; &lt;ul class="static" style="display: none;"&gt; &lt;li&gt; &lt;a href="javascript:open();" class="static menu-item"&gt; &lt;span class="additional-background"&gt; &lt;span class="menu-item-text"&gt;Manage List&lt;/span&gt; &lt;/span&gt; &lt;/a&gt; &lt;a href="#" class="static menu-item"&gt; &lt;span class="additional-background"&gt; &lt;span class="menu-item-text"&gt;Manage Documents&lt;/span&gt; &lt;/span&gt; &lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>*</p>
javascript jquery
[3, 5]
4,535,155
4,535,156
reset user password
<p>I have a server which has machines...</p> <p>I have an administrator and multiple users... these are all windows users and not present in the databse.</p> <p>How do i reset the user password.... i log in using the administrator and provide the username that needs to be reset..</p> <p>I tried </p> <pre><code> string newPassword; u = Membership.GetUser(UsernameTextBox.Text, false); </code></pre> <p>but this does not work...</p> <p>any suggestions... thanks</p> <p>Code to add users:</p> <pre><code> DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer"); DirectoryEntry NewUser = AD.Children.Add(username, "user"); NewUser.Invoke("SetPassword", new object[] { password }); NewUser.Invoke("Put", new object[] { "Description", description }); NewUser.CommitChanges(); </code></pre>
c# asp.net
[0, 9]
2,070,851
2,070,852
Violation of PRIMARY KEY constraint in Sql Server
<p>I have created a database with columns as first name lastname ,Id , date if arrival and todays date. and all are data type of nchar(); I have ID as a primary key now in the web page i have entered vales and clicked on submit but is getting a error as </p> <p>Violation of PRIMARY KEY constraint : Cannot insert duplicate key in object 'dbo.Accomdation'. The statement has been terminated.</p> <p>Code is given as </p> <pre><code> SqlConnection con = new SqlConnection(@"Data Source=.\sqlexpress;Initial Catalog=Accomdation;Integrated Security=True"); con.Open(); string f = TextBox1.Text; string g = TextBox5.Text; string d = DropDownList1.Text; string s = TextBox1.Text; string a = TextBox2.Text; string h = TextBox7.Text; string k = TextBox6.Text; string u = TextBox8.Text; string sql=("INSERT INTO Accomdation ([First Name], [LAst Name], Gender, [UHCL ID], [Date OF arrival], [FLight No], Email)VALUES ('tya', 'tya', 'tya', 'tya', 'tya', 'tya', 'tya')"); SqlCommand sw = new SqlCommand(sql,con); </code></pre>
c# asp.net
[0, 9]
1,543,986
1,543,987
better way for mapping classes to views using Adapters
<p>I have a set of classes in my android application, all of them are deserialized from <code>JSON</code> (gson or jackson are not used). All these classes are mapped to some views.</p> <p>For example I have a list of items and some of fields of class are should be present in this list item.</p> <p>As soon as I have more than one such list, I do not want to write a <code>ListAdapter</code> for each class. So I'm looking for a better way to map fields of class to views in list.</p> <p>Some time ago I've written simple adapter for mapping <code>String[]</code> on number of <code>views</code>.</p> <p>Here it is <a href="https://github.com/marwinxxii/ccardstats/blob/master/src/com/github/marwinxxii/ccardstats/gui/TextMappingAdapter.java" rel="nofollow">https://github.com/marwinxxii/ccardstats/blob/master/src/com/github/marwinxxii/ccardstats/gui/TextMappingAdapter.java</a></p> <p>Now I have an idea to make all of my classes implement <code>interface Map</code>, so I could easily access their fields using methods <strong>get</strong> and <strong>put</strong>. In case of <code>TextMappingAdapter</code> I won't need to create <code>List&lt;String[]&gt;</code> each time and just pass <code>List&amp;lt;Map&amp;gt;</code>, also it would be easier to <code>deserialize</code> from <code>JSON</code>.</p> <p>Is it a good solution or there is a better way to do this? I thought about reflection, but it must be slower than implementing a map interface (isn't it?).</p>
java android
[1, 4]
2,395,006
2,395,007
How can I tell if iPhone is returning from background in javascript?
<p>I know that the iPhone stops javascript from running when an app is sent to the background (ie pressing the home button while the app is running), but I would like to be able to detect if this has happened when the javascript starts up again when the app is reactivated.</p> <p>One solution I've been trying is to have an iterator constantly running to "check in" and then running a check against that to tell if the app has gone to background.</p> <pre><code>var lastCheckinTime = new Date().getTime(); function checkin(){ lastCheckinTime = new Date().getTime(); } setIterator( checkin, 1000 ); // Later, some code that needs to know if iphone went to background var now = new Date().getTime(); if( (now - lastCheckinTime) &gt; 1100 ) { // run sent to background code </code></pre> <p>Is there a better way to do this? The problem I've found with this method is that it doesn't work if the user quickly closes and reopens the app, but I haven't figured out a better way of detecting this yet.</p>
javascript iphone
[3, 8]
2,521,722
2,521,723
Jquery Validation?
<p>Hi there i am looping some fields with php. </p> <pre><code>$number = 5; for ($i = 1; $i &lt;= $number ; $i++) { name : &lt;input name="name[]" type="text" class="required" title="Name Surname Please"/&gt; } </code></pre> <p>Am using jquery validation to control the fields,</p> <pre><code>$("#form").validate({ errorLabelContainer: $("#form div.error") }); </code></pre> <p>but it is only validating the first field of the loop. only after clicking on the other fields the plugin works.</p> <p>Can someone help or explain that</p> <p>the script:</p> <pre><code>&lt;form action="" method="post" id="form" name="form"&gt; &lt;table width="100%" border="0" cellspacing="5" cellpadding="0"&gt; &lt;?php for ($i = 1; $i &lt;= 5; $i++) {?&gt; &lt;tr&gt; &lt;td&gt;name : &lt;input name="name[]" type="text" class="required" title="Name Surname Please"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php }?&gt; &lt;/table&gt; &lt;input name="submit-form" type="submit" value="submit"/&gt; &lt;/form&gt; &lt;script src="/jquery.validate.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $().ready(function() { $("#form").validate({ errorLabelContainer: $("#form div.error") }); }); &lt;/script&gt; </code></pre>
php jquery
[2, 5]
4,152,054
4,152,055
Jquery Cropping image
<p>I am trying to use this <a href="http://odyniec.net/projects/imgareaselect/examples.html" rel="nofollow">http://odyniec.net/projects/imgareaselect/examples.html</a> Jquery Cropping example to get the dimension from jquery and send it to my java, so the java file does the cropping for me or i just do it here on the client side, but it doesnt work for me here is a code that i wrote <a href="http://jsfiddle.net/UydpR/" rel="nofollow">http://jsfiddle.net/UydpR/</a> to be honest i have no idea what I am doing or how I am suppose to write this, I thought if I just say it will give me the rest of the options...any help or example of the code would be appriciated... I did follow their documentation but I am pretty new at this </p>
javascript jquery
[3, 5]
5,334,350
5,334,351
jQuery closing pop-up after successful form submit
<p>I have a pop up form that i wish to close on successfull submit of the form. Currently we are only validating on the server side which will create an unordered list of validation errors with the class .error_message.</p> <p>Once the form has been successfully submitted i want to close the window.</p> <p>Currently the jQuery i am using for this is as follows but does not work because the first time the form has been submitted the number of error messages will always be zero.</p> <pre><code>$(document).ready(function() { $('form#emailQuote').submit(function() { var $emailErrors = $('form#emailQuote ul.error_message').length; alert($emailErrors); if ($emailErrors == 0) { //window.close(); alert('no errors'); } else { //alert('errors'); alert('errors'); } }); </code></pre> <p>});</p>
javascript jquery
[3, 5]
3,586,766
3,586,767
ASP.net best way to change links
<p>Given:</p> <pre><code>&lt;div class="subMenu"&gt; &lt;a href="products.aspx" class="subLink"&gt;Products&lt;/a&gt; &lt;a href="productCats.aspx" class="subLink"&gt;Categories&lt;/a&gt; &lt;a href="example.aspx" class="subLink"&gt;Another&lt;/a&gt; &lt;/div&gt; </code></pre> <p>In my code behind, how would I programatically change the list of links in that div?</p> <p>In my code behind I would have something along the lines of:</p> <pre><code>if(menuID == 0) { // Display some links here }else if(menuID == 1) { // Display some links here }else if(menuID == 2) { // Display some links here } </code></pre> <p>Sorry for the simplicity, just trying to learn.</p>
c# asp.net
[0, 9]
3,141,519
3,141,520
how to upload live images without saving
<p>I have a live URL I want to download images without saving it. I also want to upload an image to another live URL. I want to code this using thread or socket programing. How do I save image file from one server to another server without saving it to local?</p>
c# asp.net
[0, 9]
1,897,862
1,897,863
I need help developing a form
<p>I'm trying to create a form that will create a table of pricing for t-shirts. </p> <p>There are 10 shirts to choose from and each one is a different price. The S through XL are the same price but the XXL is a different price. </p> <p>Next there is a selection for the color of the garment which also varys the price and there are 3 options White, Athletic, and Color.</p> <p>The 3rd selection is the number of colors in the print for the shirt. Which there are 5 options (1-2, 3-4, 5-6, 7-8, 9-10 which affects the price.</p> <p>Then I also have a few checkboxes which are add-ons that add to the price also.</p> <p>The final data I want to show is a 2 row table showing in each column the price for 48pc, 72pc, 96pc, 144pc, 288pc. The first row will be the price for S-XL and the 2nd row would be for the XXL price.</p> <p>I've created a super huge file that does the calculations and comes up with a cost but I know there is a easier way and a correct way that what I did. How would you guys do a file like this and can anyone help me out? I'm about to go crazy I been working on it for the past week and half straight.</p> <p>I didn't post it because it was to long. I uploaded it to gitHub though heres the link: <a href="https://gist.github.com/1708558" rel="nofollow">https://gist.github.com/1708558</a><a href="https://gist.github.com/1708558" rel="nofollow">GitHub</a></p>
php javascript
[2, 3]
5,167,404
5,167,405
Javascript cookie expiration/deletion on different browsing scenarios
<p>A client requested cookie functionality where if the browser is not closed, the cookie has a 30 minute expiration, but then it needs to be removed if/when a user closes the browser.</p> <p>Here's how I was going to do it: </p> <pre><code>delCookie = function() { document.cookie = 'cookieName=;expiration=Thu, 01-Jan-70 00:00:01 GMT;'; }; $(window).unload(function() { delCookie(); }) </code></pre> <p>I then realized that when user navigates to a different site, it also triggers .unload which will delete the cookie instead of keeping the cookie with expiration. </p> <p>Is there any way I can detect using javascript when browser is being closed or a user is navigating away from the site?</p>
javascript jquery
[3, 5]
2,847,348
2,847,349
JQuery sum all data in specific table row
<p>I have a table with inputs in each cell, except one (.total) which specifies the total of each table row. When one of the inputs are changed I would like the sum to change for that row. Below is far as I have been able to get. <strong>The HTML:</strong></p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;input value = "100"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input value = "100"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input value = "100"/&gt;&lt;/td&gt; &lt;td class="total"&gt;300&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input value = "200"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input value = "200"/&gt;&lt;/td&gt; &lt;td&gt;&lt;input value = "200"/&gt;&lt;/td&gt; &lt;td class="total"&gt;600&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p><strong>Now for the jQuery:</strong></p> <pre><code> //add keyup handler $(document).ready(function(){ $("input").each(function() { $(this).keyup(function(){ newSum(); }); }); }); function newSum() { var sum = 0; var thisRow = $(this).closest('tr'); //iterate through each input and add to sum $(thisRow).("td:not(.total) input:text").each(function() { sum += this.value; }); //change value of total $(thisRow).(".total").html(sum); } </code></pre> <p>Any help in finding out what I've done wrong will be greatly appreciated. Thanks!</p>
javascript jquery
[3, 5]
1,434,808
1,434,809
Prevent postback in update panel depending on JS confirm box
<p>I got an update panel which contains a gridview and inside each row images (delete icons) to delete that row. I'm trying to condition that given an answer on a regular JavaScript confirm pop up. </p> <pre><code>$(function(){ $("img.delete").on("click", function(evt){ return false; //Does not work /*or*/ evt.preventDefault();//Does not work either }); }); </code></pre> <p>Html rendered:</p> <pre><code> &lt;td&gt; &lt;img id="ctl00_ctl00_ctl00_ctl00_ctl00_ctl00_ContentPlaceHolderDefault_Content_Content_Content_Content_DashboardGrid_ctl02_DeleteControl140" class="delete" onclick="__doPostBack('ctl00$ctl00$ctl00$ctl00$ctl00$ctl00$ContentPlaceHolderDefault$Content$Content$Content$Content$DashboardGrid','Delete$0')" width="20" height="20" title="Remove item from your list." src="/images/delete_item.png" alt="Remove item from your list." style="border-width:0px;"&gt; &lt;/td&gt; </code></pre> <p>It doesn't work because a postback is always performed by the update panel which has its UpdateMode to its default in the sense that I'm not setting it in the markup.</p>
javascript jquery asp.net
[3, 5, 9]
3,122,902
3,122,903
Converting Image-Based PDF to Text-Based PDF
<p>how to convert Image-Based PDF to Text-Based PDF. There are lot of tools available for using. But iam looking for a C# code to make an application. I heard about Tessara but i not get code for C#. it is available only c/c++. </p> <p>I used MODI dll to convert Image to Text. The process is Converting Each page of PDF to Image(using Acrobat dll) and with that output Image(bmp/tif) we can use MODI to get text. is there any possibility available to change the MODI object to PDF?</p> <pre><code>MODI.Document doc = new MODI.Document(); doc.Create(ImagePath); doc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, false, false); doc.SaveAs("c://.../test.pdf", MODI.MiFILE_FORMAT.miFILE_FORMAT_DEFAULTVALUE, MODI.MiCOMP_LEVEL.miCOMP_LEVEL_HIGH); //But this line creating PDF but the PDF is not opened. Due to error. </code></pre> <p>if u have any other way to do this please let me know. </p> <p>Regards, R.Balajiprasad</p>
c# asp.net
[0, 9]
2,150,912
2,150,913
Frameless modal popup
<p>How to make a frameless modal popup using javascript</p>
javascript jquery
[3, 5]
643,524
643,525
jQuery image/window resize--max resize constraint
<p>I currently have a page where I have fixed-size divs that load pages as a user scrolls down (similar to Infinite Scroll) and am currently working on functionality to have the loaded images and containers dynamically resize along with the browser window. My current issue is that I'm currently using <code>$(window).width</code> and <code>$(window).height</code>, which naturally causes the images to resize to the window width.</p> <p>I was wondering what I can set <code>maxWidth</code> and <code>maxHeight</code> to so that the images don't get resized any greater than their original size? I've been using <code>$(window)</code> just to test the function, but I basically don't want the images to become any larger than their original size. I've tried <code>$(this)</code>, but it causes the ratio to be equal to 1, resulting in no resize.</p> <pre><code> $(window).resize(function () { imageResize(); }); function imageResize() { $(".added").each(function () { var maxWidth = $(window).width(); var maxHeight = $(window).height(); var ratio = 0; var width = $(this).width(); var height = $(this).height(); if (width &gt; maxWidth) { ratio = (maxWidth / width); $(this).width(maxWidth); $(this).height(height * ratio); $(this).parent().height(height * ratio); $(this).parent().width(maxWidth); } else { ratio = (maxWidth / width); $(this).width(maxWidth); $(this).height(height * ratio); $(this).parent().height(height * ratio); $(this).parent().width(maxWidth); } }); } </code></pre>
javascript jquery
[3, 5]
3,948,238
3,948,239
Not showing the images in live server which is showing in my local host
<p>I am working on the Mailbox Module in VS2010 with C#</p> <p>I have made a control with ascx page and in that page I have created Three different gridviews for Inbox,SentItems and Deleted Items.</p> <p>In all the three gridviews I have added two columns for the Images for Reply and Forward messages which is shown where the user reply or forward the message.</p> <p>The functionality works perfectly in my localhost.</p> <p>But today i have deployed it on live server.</p> <p>Where I found that I does not showing the images.</p> <p>When I inspected elements through firebug I found in the HTML source code that it shows me that the "Failed To Load The Given URL" while for other images it shows the images.</p> <p>Can Anyone tell me why is it happening and help me..?</p>
c# asp.net
[0, 9]
1,054,344
1,054,345
jQuery - remove function attached to div
<p>I'm <a href="http://stackoverflow.com/questions/3286736/jquery-cycle-plugin-pause-resume-weird-behavior">running into a problem with jQuery</a>, so I think I've figured out a workaround, but need help.</p> <p>I currently attach a cycle() slideshow to my div like this:</p> <pre><code>function startSlideshow() { $('#slideshow').cycle({ some parameters }); } </code></pre> <p>When I pause and restart this slideshow, it exhibits weird behavior, due to bugs in the cycle plugin. So my workaround idea is this: to destroy the existing cycle() and then just recreate it on the fly.</p> <p>I can easily recreate it by calling startSlideshow() again... but how do I kill the old cycle() that's attached to the div?</p> <p>I guess I'm looking for a way to "unset" or "unbind" it completely (and jQuery's unbind() method isn't it).</p> <p>Thanks-- Eric</p>
javascript jquery
[3, 5]
1,418,795
1,418,796
Object cannot be cast from DBNull to other types
<p>I am trying to save the gridview data into the database. To decide if it should be an Insert or update, i need to find out if the <code>Order_SelectionID</code> exists. Foreach Gridview row, i am trying to use the statement like the following in C# using Asp.Net.</p> <pre><code>foreach (GridViewRow row in grdFavoriteMerchant.Rows) { if (grdFavoriteMerchant.DataKeys[row.RowIndex]["Order_SelectionID"].ToString() != "") { </code></pre> <p>If <code>Order_SelectionID</code> exists and not a <code>NUll</code> or zero, i will have to "Insert", else an "Update". </p> <p>This statement gives me an exception</p> <blockquote> <p>"Object cannot be cast from DBNull to other types."</p> </blockquote> <p>everytime when i am supposed to use an Insert. How can i correct it?</p>
c# asp.net
[0, 9]
4,225,387
4,225,388
scheduling files for upload
<p>I want to schedule the files for upload. Files are residing in companies network(on intranet)</p> <p>I use "FileUpload" to browse the files on screen which are scheduled for upload. But the FileUpload does not give the full path of the file. So what is the way to workaround this limitation.</p> <p>Thanks, Harish</p>
c# asp.net
[0, 9]
3,879,863
3,879,864
Is there any way to keep information safe in an Android apk?
<p>AFAIK Android decompilation allows one to extract every bit of information from an apk. How can I store information like ftp passwords or other confidential strings in Java or any other XML file? Is there any way other than calling a service?</p> <p>EDIT Problem:</p> <pre><code>String uname = "mks"; String part1="pass"; String part2="my"; String part3="word"; </code></pre> <p>As per David answer i obfuscating a string but after dcompilation i able to see my password</p> <pre><code> String[] arrayOfString = new String[2]; arrayOfString[0] = "mks"; arrayOfString[1] = ("my" + "pass" + "word"); </code></pre>
java android
[1, 4]
837,106
837,107
Speed of Java vs. JS / HTML / CSS for web applications
<p>I am creating a web application. I have primarily used Javascript specifically jQuery. Because of some very specific functionality, I am running into practical limitations of Javascript--they're not hard limitations but stuff that I would find easy in Java, like making an equation editor where you can edit directly as opposed to entering TeX, is difficult in JS even using MathJax as a base. </p> <p>I'm going to have to build even more complex functionality that involves 3D and physics engines.</p> <p>For a large scale application like this--specifically one that involves 3D and physics engines--would Java be slower or faster than Javascript when one is run within a browser? (Assume that code is written well in both cases.) Or is it completely uncertain--i.e. dependent on far too many specific variables?</p> <p>Thanks.</p>
java javascript
[1, 3]
1,984
1,985
How to remove part of user entered values and append new values to an input box
<p>I have a search box and a suggestion box to show the suggestions.</p> <p>Once users type something in the search box, the suggestions will appear then user is able to select one of the suggestions to be added to the search input box. After that user will be able to type other terms to receive the suggestions and so on.</p> <p>I can show the suggestions and add the selected suggestion to the input box <strong>but</strong></p> <p>lets say user enters f then first is suggested and user choose it, then the input box will be f, first but it should be first only. if I reset the input I will lose the other search terms.</p> <p>In short: I want to keep all values before the last semicolon and remove all those after the semicolon.</p> <p><strong>code</strong></p> <pre><code>&lt;script type="text/javascript"&gt; function selectS(value){ alert("clicked:" + value); var curr = $('#term').val(); if(curr) curr += ";"; $('#term').val(curr + value); } .... &lt;s:form id="searchForm" method="POST" enctype="multipart/form-data"&gt; &lt;s:textfield id="term" name="term" label="Search" onkeyup="find(this.value)"/&gt; &lt;/s:form&gt; </code></pre>
javascript jquery
[3, 5]
2,002,105
2,002,106
Rotated Text via Canvas Rotation off angle
<p>I am creating a graph for which I need an axis title for the y axis.</p> <p>The problem is I need it at -90 degress to the horizontal.</p> <p>Here is how I rotate the text at the moment.</p> <pre><code> paint.setTypeface(Typeface.SANS_SERIF); canvas.save(); canvas.rotate(-90,15,viewHeight/2+20); canvas.drawText(yAxisTitle,15,viewHeight/2+20, paint); canvas.restore(); </code></pre> <p>The problem is once its rotated its not straight on the vertical. Its as if its going too far?</p> <p>Any help would be great.</p> <p>Cheers</p>
java android
[1, 4]
439,674
439,675
Why does a textbox lose its disabled attribute on postback but not its value attribute?
<p>This is my program</p> <pre><code>&lt;script src="Scripts/jquery-1.6.4.js" type="text/javascript" language="javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" language="javascript"&gt; function one() { $(document).ready(function () { $('#&lt;%= textbox.ClientID %&gt;').attr('disabled', 'disabled'); }); } function two() { $(document).ready(function () { $('#&lt;%= textbox.ClientID %&gt;').attr('value', 'hello stackoverflow.com!'); }); } &lt;/script&gt; &lt;input type="button" value="one" onclick="one();" /&gt; &lt;input type="button" value="two" onclick="two();" /&gt; &lt;asp:TextBox ID="textbox" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:Button ID="postbackButton" runat="server" Text="post back" /&gt; </code></pre> <ol> <li><p>When I click on 'button one', the textbox switches to disabled. Then I click on 'postback button' and the textbox switches to enabled (It loses what I set!).</p></li> <li><p>When I click on 'button two', the textbox changes its value. Then I click on 'postback button' and the textbox doesn't lose its value.</p></li> </ol> <p>How could I do to keep the disabled state of the button? If I could do this on client-side it would be better..</p> <p>Thanks a lot, Luciano.</p>
jquery asp.net
[5, 9]
765,020
765,021
asp changepassword control customization
<p>Is there a way to customize the textboxes in an ASP changepassword control?</p> <pre><code>&lt;asp:ChangePassword id="myChangePassword" newpasswordregularexpressionerrormessage="Error: Your password must be at least 5 characters long, and contain at least one number and one special character." runat="server" OnChangingPassword="ChangingPassword" OnChangedPassword="ChangedPassword" OnCancelButtonClick="CancelClick"&gt;&lt;/asp:ChangePassword&gt; </code></pre> <p>For example I would like the top field to say Current Password instead of just Password, is this possible?</p> <p>Thanks!</p>
c# asp.net
[0, 9]
608,177
608,178
Reorder parts of String separated by specified character to reverse order
<p>I am having a String <code>Australia@2@India@30@UK@4@USA@43</code> I need to reverse such as <code>USA@43@UK@4@India@30@Australia@2</code></p> <p>This is just a sample string, in reality the String is having atleast 20@ symbols.</p> <p>I have tried <code>new StringBuilder(newString).reverse().toString();</code> but the ouput I am getting is very weird.</p>
java android
[1, 4]
6,022,054
6,022,055
How do I delegate some javascript (rendering the page) to have higher importance then other javascript (fetching data)
<p>Right now my mobile web app on startup goes and talks to a few apis when it is lunched. These are intertwined with the javascript that renders the page.</p> <p>When they fire at the same time page rendering gets all choppy, possibly because the rendering is using hardware acceleration, or maybe it's just normal on mobile (iphone) when running too much JS at the same time.</p> <p>I want to architect the app in a way that if something like a user taking an actions to change the rendering of the page, or anything related to the UI is fired, it takes precedence over any other JS.</p> <p>I want the experience to be quick and snappy even if it makes some action (talking with apis) take longer then it should. </p> <p>Any idea how to achieve something like this?</p> <p>Thanks!!!</p>
javascript jquery
[3, 5]
1,742,750
1,742,751
Quick way to create array from another array's variables?
<p>Lets say I have 2 arrays:</p> <pre><code>var a = []; var b = []; a.push({id:1, name:"Joe"}); a.push({id:2, name:"Jeff"}); a.push({id:3, name:"John"}); </code></pre> <p>Is there a quick way to populate <code>b</code> with just <code>a</code>'s names in Javascript, or do I have to use a loop?</p> <p>E.g, something like:</p> <pre><code>b = a[].name; // b is now ["Joe","Jeff","John"] </code></pre>
javascript jquery
[3, 5]
3,983,375
3,983,376
accepting value from either of text boxes
<p>I have two asp.net textboxes and need to put a validate function in javascript or jquery to validate either one or the other should accept a value. Both can not be left blank. And it should make visible the error label if both text boxes are empty.</p>
javascript jquery asp.net
[3, 5, 9]
3,322,728
3,322,729
1 page javascript techniques, is it possible to create an iframe and dump data in it?
<p>When creating a single page type website that is purely ajax driven, do people create iframes, and then dump javascript objects that contain cached data?</p> <p>This way if you reload your main page, you can still access cached data?</p>
javascript jquery
[3, 5]
6,016,187
6,016,188
How to format Data grid View on ASP.NET?
<p>I am now working on Datagrid View on my sample n-tier. How can i control it that it will not show all records on my query that maximize if i run my webpage.Or Control it size so it will retain its position like on the design.</p> <p>Like on win forms that it will show scroll bars etch..</p> <p>Can you give me any tips what will use and how it works?</p>
c# asp.net
[0, 9]
4,028,720
4,028,721
how to test my web application on server
<p>i have to test what is happening in the code on the server:</p> <pre><code>if (impersonateValidUser(userName, domain, password)) { } else { } </code></pre> <p>like where is the code going after checking the condition</p> <p>Should i use a messagebox or some other return way???</p> <p>I am not sure how to do it </p> <p>any help... thanks</p>
c# asp.net
[0, 9]
2,424,613
2,424,614
How to load kml file into google map?
<p>I have a kml file. I need to load this kml file into my site, which is finally shown as a Google Map using C# or Javascript. And I have this .kml file in my project's root directory.</p>
c# asp.net
[0, 9]
4,104
4,105
Chained select boxes not working
<p>I have three select boxes state,city and locality with the id's same as name</p> <pre><code>$(document).ready(function() { $("#state").on('change',function(){ var state = $("#state").attr('value'); $("#city").load('http://localhost/trial/index.php/new/view_cities/'+state).change(); }).change(); $("#city").on('change',function(){ var city = $("#city").attr('value'); $("#locality").load('http://localhost/trial/index.php/new/view_localities/'+city); }).change(); }); </code></pre> <p>On page load state gets correctly shown because it's directly from database, and city options gets automatically updated, but localities do not. And when i change city the localities can change.</p>
javascript jquery
[3, 5]
2,855,404
2,855,405
Why DeviceId is require when checking for license
<p>I've read many pages of documentation of android licensing but I'm still confuse. Why does it need unique device id when it checks with primary account logged into the device ?</p> <p>and if it needs for something, what if that unique id changes somehow ? Will it still allow same user ? if yes, then whats the point of unique id and if no, then its bad, what if user had to factory reset and that changes its device id.</p>
java android
[1, 4]
4,714,256
4,714,257
How To Add Url To Google by code
<p>i want add a url via code in google that must be added at this <a href="http://www.google.com/addurl/?continue=/addurl" rel="nofollow">page</a>. any help?</p>
c# asp.net
[0, 9]
3,968,218
3,968,219
Randomize Next Page
<p>I have an application that has a question on each page. Currently I have a button where OnClick points to the function below, but I would like it to choose a random page. I have 10 .aspx pages. How can I do this?</p> <pre><code>protected void newWindow(object sender, EventArgs e) { Response.Redirect("Question2.aspx"); } </code></pre>
c# asp.net
[0, 9]
1,815,666
1,815,667
From UserControl to parent master page
<p>hi i have a weird scenario but this was how it was designed before me. Basically I have userControl, and there is a child.masterpage</p> <p>in the userControl in the ascx file it contains the following</p> <pre><code>&lt;div&gt;&lt;%=_template%&gt;&lt;/div&gt; </code></pre> <p>the child.masterpage inherits from a parent.masterpage, in the child.masterpage there is a call to the userControl</p> <pre><code>&lt;asp:Content&gt;&lt;ucc:UserControl&gt;&lt;/ucc&gt; </code></pre> <p>the parent.masterpage has other fields in it and it has a .cs file with a c# funtion</p> <pre><code>public void passVal(string s) </code></pre> <p>Now what I want to do is to pass a value from the user control directly to the parent.masterpage function so that I can put it in the parent.masterpage literal I have created.</p> <p>How can I achieve this (again, this is existing design and I cant turn things around) I am just adding a functionality.</p> <p>Thank you very much (i am a newbie in c# by the way) thanks</p> <pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" MasterPageFile="../common/main.master" %&gt; &lt;%@ Register Src="UserControl.ascx" TagName="Ord" TagPrefix="uc" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server"&gt; &lt;div class="in"&gt;&lt;uc:OrderReceipt ID="myord" runat="server" Visible="true"/&gt; &lt;div style="margin-bottom:30px;"&gt; &lt;a href="~/" id="HomeLink" runat="server" class="BackLink"&gt;Back to Home Page&lt;/a&gt; &lt;/div&gt; &lt;/asp:Content&gt; </code></pre>
c# asp.net
[0, 9]
808,353
808,354
Using google spreadsheet api :how to insert entry in a spreadsheet
<p>I am using google spreadsheet api to insert a entry (atom entry) in a spreadsheet.My approach as following : </p> <pre><code> function InsertRow() { var service = new google.gdata.client.GoogleService('drutas'); var entryObject = new google.gdata.atom.Entry(); var contentTextObject = new google.gdata.atom.Text(); var content = &lt;entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended"&gt; &lt;gsx:id&gt;1312&lt;/gsx:id&gt; &lt;gsx:name&gt;Elizabeth Bennet&lt;/gsx:name&gt; &lt;gsx:time&gt;02:00:00&lt;/gsx:time&gt; &lt;gsx:company&gt;paxcel&lt;/gsx:company&gt; &lt;gsx:date&gt;27/04/1990&lt;/gsx:date&gt; &lt;/entry&gt; contentTextObject.setText(content); entryObject.setContent(contentTextObject); service.insertEntry('https://spreadsheets.google.com/feeds/list/&lt;spreadsheetId&gt;/od6/private/full',entryObject,root,error); But i have got error as :Blank Rows cannot be inserted . Please use delete instead </code></pre>
javascript jquery
[3, 5]
4,973,004
4,973,005
'undefined' function when triggering a click of a link with jQuery
<p>For some reason this works in FF 11, Chrome, and even in IE but not in FF 3.6 or Safari 5.</p> <p>Basically I'm triggering the click of a link with:</p> <pre><code>var $currentItem = $('#' + currentId); var modalSeriesList = $('.js-modal-series'); var index = modalSeriesList.index($currentItem); var $nextItem = modalSeriesList[index + 1]; var nextClick = function() { $(document).off('keydown.general'); $nextItem.click(); } $(document).off('keydown.general'); if ($nextItem) { $nextButton.click(nextClick); }​ </code></pre> <p>But when I click on the link in FF 3.6 or Safari 5 I get the following error:</p> <p><code>TypeError: 'undefined' is not a function (evaluating '$nextItem.click()')</code></p> <p>Is there any particular "gotcha" that I don't know about here using the following method? </p>
javascript jquery
[3, 5]
703,580
703,581
help with converting javascript function to php
<p>My javascript isnt so great, but i found a brilliant looking function <a href="http://stackoverflow.com/questions/2270910/how-to-convert-sequence-of-numbers-in-an-array-to-range-of-numbers/2270987#2270987">here</a></p> <p>I'm not sure what to do with this bit:</p> <pre><code>var ranges = [], rstart, rend; </code></pre> <p>full function:</p> <pre><code>function getRanges(array) { var ranges = [], rstart, rend; for (var i = 0; i &lt; array.length; i++) { rstart = array[i]; rend = rstart; while (array[i + 1] - array[i] == 1) { rend = array[i + 1]; // increment the index if the numbers sequential i++; } ranges.push(rstart == rend ? rstart+'' : rstart + '-' + rend); } return ranges; } getRanges([2,3,4,5,10,18,19,20]); // returns ["2-5", "10", "18-20"] getRanges([1,2,3,5,7,9,10,11,12,14 ]); // returns ["1-3", "5", "7", "9-12", "14"] getRanges([1,2,3,4,5,6,7,8,9,10]) // returns ["1-10"] </code></pre>
php javascript
[2, 3]
1,520,538
1,520,539
Create a Calendar that displays one year from today(Asp.Net)
<p>I would like to create a calendar that displays a year from today(everyday) and allows the user to select the multiple dates.</p> <p>I tried to use the asp:calendar without any success</p> <p>I am developing in C# .NET</p> <p>any suggestion</p>
c# asp.net
[0, 9]
1,857,768
1,857,769
how to format [decimal?] when it's null?
<p>in my class partData the FW_Step attribute isfrom the type double?</p> <p>when i try to format it like that</p> <pre><code>partData.FW_Step.Value.ToString("F3") </code></pre> <p>it's fail when the value is null</p> <p>how can i use the format when the value is null?</p>
c# asp.net
[0, 9]
2,946,587
2,946,588
Extract specific js fragment from source
<p>I am using ajax to get page source (successfully). Inside that source, there is a specific script inside SCRIPT tags, and inside it there is a definition of some data I need to get (var vName = [{...}]). The data is an array, a rather big one, and the variable name is fixed.</p> <p>What would be the way to get this variable and make some kind of similar array based on data of that variable? </p>
javascript jquery
[3, 5]
5,429,355
5,429,356
add up widths of elements until a ceiling is meet
<p>I have a header text changes length. I also have a set of logos that have a static length.</p> <p><b>The problem:</b> When the header (text) gets too long or short the logos either do not use the space effectively or the logos end up going to another line.</p> <p><b>Solution in Simple Terms</b> I want a script that adds up the width of logos one-by-one and when a certain width is meet it stops showing the logos.</p> <h1>For Example:</h1> <p> - The logos are hidden.<br> - The header space is 400px<br> - The container is 800px<br> - remainder space is 400px<br> - the script would add up the logos one-by-one until the 400px was meet<br> - If the 4th logos was at 450px it would not show that logo or any other logo after. </p> <p><a href="http://jsfiddle.net/FDkRN/" rel="nofollow">http://jsfiddle.net/FDkRN/</a></p> <p>I tried what I know, but I am still new to js so any help would be great.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
5,627,975
5,627,976
Set up HTTPPOST android?
<p>I want to set up httppost to my server. For now I have address for emulator, but now I want to test app online. Here is the code:</p> <pre><code>HttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost("http://10.0.2.2/posloviPodaci/index.php"); </code></pre> <p>How to set up address for my server, which I have online?</p>
java android
[1, 4]
1,305,117
1,305,118
How to make this code compatible with IE7?
<p>This code works in all browsers except for older IE versions. It'll be accessed by users, some of whom are still using IE7. I'm not a coder and the author isn't available until next week so I'm at loss how to refactor it so that all browsers show only the options defined in <code>chk</code>.</p> <pre><code> for (var x=1;x&lt;5;x++){ var st='select[name="Score_'+x+'e"] option'; $(st).each(function(){ var chk=',0,1,2,3,4,5,,,,,,--,'; var sn=','+$.trim(this.innerHTML)+','; if (chk.indexOf(sn)==-1){$(this).hide();} }); st='#tableScoringInfoBox'+x+' strong'; $(st).html('1-10 Ratings explained'); } </code></pre>
javascript jquery
[3, 5]
3,809,360
3,809,361
how to determine how many jQuery objects are on a page?
<p>Can I determine the number of jQuery objects on a page? </p> <p>I want to use the number of elements as a sort of weak benchmark for page complexity. I'm thinking that if I can reduce the number of elements that jQuery knows about , the page might run more efficiently. </p> <p>Does this make sense? </p> <p>Is it as simple as doing a * select and counting the results?</p> <hr> <p>related:<br> <a href="http://stackoverflow.com/questions/2923987/">How can I clear content without getting the dreaded “stop running this script?” dialog?</a></p>
javascript jquery
[3, 5]
5,774,171
5,774,172
jquery to apply css style
<p>I have a table whose td values are displayed as</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;?=$something?&gt;&lt;/td&gt; &lt;td&gt;&lt;?=$something?&gt;&lt;/td&gt; &lt;td&gt;&lt;?=$something?&gt;&lt;/td&gt; &lt;td&gt;&lt;?=$something?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;?=$somethingelse?&gt;&lt;/td&gt; &lt;td&gt;&lt;?=$somethingelse?&gt;&lt;/td&gt; &lt;td&gt;&lt;?=$somethingelse?&gt;&lt;/td&gt; &lt;td&gt;&lt;?=$somethingelse?&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>I would like to apply jquery for all td in the second row after some condition is met, for example, the first somethingelse in the first td is smaller than zero.</p>
php jquery
[2, 5]
3,229,446
3,229,447
Why won't function output into this jQuery selector?
<p>I'm hoping this is something silly I've done. I got a function unigref near the bottom, which (I believe) outputs a string. However, when I call the function to build a jQuery selector, I can't get it to work properly. I know that everything else works because when I use a static string the radio button is selected.</p> <p>Here's my <a href="http://jsfiddle.net/9Edxx/" rel="nofollow">jsfiddle/9Edxx</a>. Please help.</p> <pre><code>var checkCount = 0; var maxChecks = 2; $(document).ready(function() { $("#test").click(function() { alert($(':checked').length); }); $(':checkbox[name=checkbox]').change(function() { checkCount = $(':checkbox:checked').length; if (checkCount &gt;= maxChecks) { $(':checkbox[name=checkbox]').not(':checked').attr('disabled', true); $(":radio[value="+uniqref()+"]").prop('checked', true); } else { $(':checkbox[name=checkbox]:disabled').attr('disabled', false); } if (this.checked) { $("td.label").append("&lt;label&gt;" + this.value + "&lt;/label&gt;"); } else { $("td.label").find(":contains('" + this.value + "')").remove(); } }); $('#button').click(function() { alert(uniqref()); }); function uniqref() { return $("td.label").text().split('').sort().join('').replace(/\s/g, ""); } });​ </code></pre> <p><strong>UPDATE: The typo has been correct, but the problem still exists.</strong></p> <p><a href="http://jsfiddle.net/9Edxx/" rel="nofollow">http://jsfiddle.net/9Edxx/</a></p>
javascript jquery
[3, 5]
5,404,304
5,404,305
How do I write 'if not clicked' or 'if clicked outside element', using Jquery?
<p>I'm kind of stuck on a problem of how to stop my menu from executing the fadeOut() function. When I click the main links on my menu to open the submenu it just fades out. Here is how the code looks at the moment:</p> <pre><code> $('a.main-menu-item').click(function(){ if($('.rtmenu:visible')){ $('.rtmenu').click(function(e) { e.stopPropagation(); }); $(document).click(function() { $('.rtmenu').fadeOut(200); }); } }) </code></pre> <p>Can anyone tell me how I can write 'if not clicked a.main-menu-item' where it says 'document'?</p> <p>Much Appreciated</p> <hr> <p><strong>SOLUTION FOUND!</strong></p> <pre><code>$('.rtmenu').click(function(e) { e.stopPropagation(); }); $('.rtmenu').mouseout(function(){ $(document).one('click',function() { $('.rtmenu').fadeOut(200); }); }) </code></pre>
javascript jquery
[3, 5]
3,817,911
3,817,912
How to reload document by resizing?
<p>Why this code doesn't work:</p> <pre><code>$(window).resize(function() { document.location.reload(); }); </code></pre>
javascript jquery
[3, 5]
3,621,971
3,621,972
access dropdown control from the master page to the content page using asp.net
<p>i have a master page and the content pages in the master page i have the textbox and dropdown the value in the dropdown may vary according to the content pages</p> <p>e.g for one content page the dropdown may contain</p> <p>branchname, city, address</p> <p>and let for other content page under same master page the dropdown may have values like</p> <p>Contactnumber, EmailID, ........... ......... etc.....</p> <p>so please help me to how can i bind that dropdown from my content page </p> <p>thanks.</p>
c# asp.net
[0, 9]
5,745,104
5,745,105
Problem in opening doc/docx/excel files in browser(Asp.net, C#)
<p>I am storing some files like PDF,Doc, Docx, xls etc. in the file system.</p> <p>Now I have to show those files on the browser for the users to view.</p> <p>So basically a link button is there in a datagrid, upon clicking on which the user will be able to view.</p> <p>So far my code goes like this</p> <pre><code> Response.Clear(); // Response.ContentType = "application/pdf"; //Response.ContentType = "application/x-msexcel"; //Response.ContentType = "application/msword"; string strFilePath = @"C:\test.pdf"; // string strFilePath = @"C:\test.doc"; Response.WriteFile(strFilePath); Response.End(); </code></pre> <p>This works fine for pdf files but fails for word or excel files. In the browser I am able to view the pdf but the other files are not opening in browser but are asking for the </p> <p>"Save" , "Open" dialog box option. If I click on "Open", it will open in a normal window instead of browser.</p> <p>How can I achieve my target? The browser is IE</p> <p>Thanks in advance</p>
c# asp.net
[0, 9]
1,802,576
1,802,577
load file depending on browser size
<p>Just a quik question about the right syntax. I want to load the jquery file only if the browser screen is &lt; 1100px. </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { if ($(window).width() &lt; 1100) { //load file } }); &lt;/script&gt; </code></pre> <p>I want to load src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js but can't find the syntax. </p> <p>Thanks!</p>
javascript jquery
[3, 5]
663,106
663,107
Android spinner "onclicklistener" question
<p>I am working with Spinner, cursors and adapters.</p> <p>I want to setup a click listener for the spinner so that once a user selects an item from the spinner it gets the current selected item and then carrys out some other tasks ( all this extra code is fine, its just 1 problem I am having).... It kind of works, however, once I declare the setOnItemSelectedListener callback, since the cursor has already been populated, the event is fired as soon as the app launches. </p> <p>I guess I need a way to define the cursor without selecting an initial item so that the event doesnt fire (since an item will not be selected). Or is there another better way to achieve this?</p> <p>Basically, as it stands, once the app loads the setOnItemSelectedListener function is firing because the cursor is being populated ( i think). Moreover, ignoreing the fact that the event is firing too soon, if I then select the -same- item in the spinner, it doesnt fire the event sincethe item didnt change. SHould I be using a different callback instead of setonitemslectedlistener? Here is the code I have so far. </p> <pre><code> c = db.getallrecents(); startManagingCursor(c); busnumspinner = (Spinner) findViewById(R.id.Spinner01); SimpleCursorAdapter spinneradapter = new SimpleCursorAdapter(this, R.layout.lvlayout, c, spincol, spinto); busnumspinner.setAdapter(spinneradapter); busnumspinner.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) { String spinnerString = null; Cursor cc = (Cursor)(busnumspinner.getSelectedItem()); if (cc != null) { spinnerString = cc.getString( cc.getColumnIndex("busnum")); text = spinnerString; } showDialog(DATE_DIALOG_ID); } @Override public void onNothingSelected(AdapterView&lt;?&gt; parentView) { // your code here } }); </code></pre>
java android
[1, 4]
581,076
581,077
PHP won't echo out or execute JavaScript
<p>I need PHP to open up a new window with a text from a variable.</p> <p>Here's what I tried.</p> <pre><code> echo "&lt;script&gt; $myWin=window.open('','$myWin','menubar,scrollbars,left=30px,top=40px,height=800px,width=800px'); $myWin.document.write(".$logtext."); &lt;/script&gt;"; </code></pre> <p>but it doesn't work. any better ideas or suggestions? Thanks! :)</p>
php javascript
[2, 3]
4,995,725
4,995,726
fill ListBox according to input control value in onKeyUp function
<p>I've a ListBox control </p> <pre><code> &lt;asp:ListBox ID="ListBox1" runat="server"&gt; &lt;asp:ListItem Value="1" Text="XYZ" /&gt; &lt;asp:ListItem Value="0" Text="XYZD" /&gt; &lt;asp:ListItem Value="-1" Text="D" /&gt; &lt;/asp:ListBox&gt; </code></pre> <p>a input :</p> <pre><code>&lt;input id="listBoxFilterTextBox" type="text" onkeyup="FilterListBox()" </code></pre> <p>js functions : </p> <pre><code> function FilterListBox() { var listBox = Get('ListBox1'); var textBox = Get('listBoxFilterTextBox'); for (i = 0; i &lt; listBox.options.length; i++) { if (listBox.options[i].text.toLowerCase().indexOf(textBox.value.toLowerCase()) != -1) { listBox.options[i].style.display = ""; } else { listBox.options[i].style.display = "none"; } } function Get(id) { return document.getElementById(id); } </code></pre> <p>When I enter 'X' to input control, it brings 'XYZ', 'XYZD'.. It works correctly Firefox and Chrome. But in IE, It doesn't work correctly. How to solve this IE problem?</p> <p>Thanks in advance...</p>
javascript jquery asp.net
[3, 5, 9]
5,667,339
5,667,340
Toggle Checkbox
<p>I have 4 checkboxes and I wish to toggle them (checked or unchecked) and they should all be the same what ever state they are in. I have this so far:</p> <pre><code>var toggle_click = false; function check_them(element){ if(toggle_click){ $('#'+element+'_1').attr('checked', true); $('#'+element+'_2').attr('checked', true); $('#'+element+'_3').attr('checked', true); $('#'+element+'_4').attr('checked', true); } if(!toggle_click){ $('#'+element+'_1').attr('checked', false); $('#'+element+'_2').attr('checked', false); $('#'+element+'_3').attr('checked', false); $('#'+element+'_4').attr('checked', false); } if(!toggle_click){ toggle_click = true; } if(toggle_click) { toggle_click = false; } } </code></pre> <p>On page load some of the checkboxes may be ticked or not ticked - but once I click a link and run this function, I want these checkboxes to go all to the same state.</p> <p>When I try the above, it just doesn't seem to tick the boxes and sometimes it ticks them all and running this function again does nothing. What is going on? I am coffee deprived and confused!</p> <p>Should be making use of a checkbox group or something?</p> <p>Thanks all for any help</p>
javascript jquery
[3, 5]
3,483,904
3,483,905
security digit program
<p>I need the code for this problem:</p> <p>All the non-zero digits in the number are multiplied by each other. All the non-zero digits of the resulting number are again multiplied by each other - and so on until a single digit is left. That is the security digit.</p> <p>Write a program that will provide the security digit for any number with up to 20 digits.</p>
java javascript
[1, 3]
289,635
289,636
Script becomes unresponsive crashing firefox
<p>Why does this script cause an error on submit in firefox? It is using jquery.</p> <pre><code>$(document).ready(function(e) { $('#errorMessage').hide(); $('#form').submit(function() { var firstname = $('#formFirstname').val(); if(firstname == '') { $('#errorMessage').html('Please enter your Name.'); $('#errorMessage').fadeIn(); } else { $('#errorMessage').html('Please wait a moment as the form Submits.'); $('#form').submit(); } return false; }) }); </code></pre>
javascript jquery
[3, 5]
1,970,492
1,970,493
Adding element at top of div
<p>I'd like to add an element to a container div before existing elements. I have attempted to this three different ways and couldn't</p> <p>Method 1</p> <p><code>$('.channel:first',$('#scroll_5')).before(print_nav);</code></p> <p>Method 2</p> <p><code>$('.channel:eq(0)',$('#scroll_5')).before(print_nav);</code></p> <p>Method 3</p> <pre><code>$('.channel',$('#scroll_5')).each(function () { $(this).before(print_nav); return false; }); </code></pre> <p>The container div is <code>scroll_5</code> and has elements with the class <code>channel</code>. I want to add a new channel at the top. What is the right way to do that?</p>
javascript jquery
[3, 5]
2,718,090
2,718,091
Having trouble scraping an ASP .NET web page
<p>I am trying to scrape an ASP.NET website but am having trouble getting the results from a post. I have the following python code and am using httplib2 and BeautifulSoup:</p> <pre><code>conn = Http() # do a get first to retrieve important values page = conn.request(u"http://somepage.com/Search.aspx", "GET") #event_validation and viewstate variables retrieved from GET here... body = {"__EVENTARGUMENT" : "", "__EVENTTARGET" : "" , "__EVENTVALIDATION": event_validation, "__VIEWSTATE" : viewstate, "ctl00_ContentPlaceHolder1_GovernmentCheckBox" : "On", "ctl00_ContentPlaceHolder1_NonGovernmentCheckBox" : "On", "ctl00_ContentPlaceHolder1_SchoolKeyValue" : "", "ctl00_ContentPlaceHolder1_SchoolNameTextBox" : "", "ctl00_ContentPlaceHolder1_ScriptManager1" : "ctl00_ContentPlaceHolder1_UpdatePanel1|cct100_ContentPlaceHolder1_SearchImageButton", "ct100_ContentPlaceHolder1_SearchImageButton.x" : "375", "ct100_ContentPlaceHolder1_SearchImageButton.y" : "11", "ctl00_ContentPlaceHolder1_SuburbTownTextBox" : "Adelaide,SA,5000", "hiddenInputToUpdateATBuffer_CommonToolkitScripts" : 1} headers = {"Content-type": "application/x-www-form-urlencoded"} resp, content = conn.request(url,"POST", headers=headers, body=urlencode(body)) </code></pre> <p>When I print <code>content</code> I still seem to be getting the same results as the "GET" or is there a fundamental concept I'm missing to retrieve the result values of an ASP .NET post?</p>
asp.net python
[9, 7]
4,746,969
4,746,970
jQuery - get first paragraph
<p>I have the following code</p> <pre><code>&lt;div class="side-box"&gt; &lt;h1&gt;Main Title&lt;/h1&gt; &lt;h2&gt;Secondary Title&lt;/h2&gt; &lt;p&gt; This is paragraph 1&lt;br&gt;&lt;br&gt; This is paragraph 1&lt;br&gt;&lt;br&gt; This is paragraph 3&lt;br&gt;&lt;br&gt; &lt;/div&gt; </code></pre> <p>I'm trying to write a jQuery function that will display anything up to the first paragraph and then display the rest when a 'read more' link is clicked.</p> <p>The content is generated by a WYSIWYG editor, otherwise i'm sure I would be able to create this function myself.</p>
javascript jquery
[3, 5]
4,712,364
4,712,365
How can I center a background image on a web page for different screen resolutions using JavaScript?
<p>I want to determine the screen resolution of the client machine and the set the background image in the center using JavaScript.</p> <p>I have come so far:</p> <pre><code>function centerBackGroundImage() { var browserWidth = document.documentElement.clientWidth; var browserHeight = document.documentElement.clientHeight; $("#background").css({ "z-index": "-10", "margin:left": (browserWidth / 2) - (browserHeight/ 2) }); } </code></pre> <p>I have already added the div tag named <code>background</code> and the <code>&lt;img&gt;</code> tag with the location of the image file.</p> <p>Any help would be appreciated.</p>
javascript jquery
[3, 5]
3,961,620
3,961,621
get cookie value in the textbox using jquery or javascript
<p>I want to see cookie value in the textbox.</p> <p>I have used this </p> <pre><code>document.getElementsByName('Custom_Field_Custom2')[0].Value=$.cookie('artname',{ path:'/'}); </code></pre> <p>but that cookies value is not displaying in the textbox.</p> <p>What I need to do?</p>
javascript jquery
[3, 5]
755,435
755,436
java from command line over and over
<p>i have a PHP application that invokes a command line to execute some specific operations.</p> <p>The command line calls a 'java -jar somefile.jar arg1 arg2'</p> <p>The problem is that this is slow, since it has to startup the jar every time it get's invoked.</p> <p>Is there any way keep the java machine code in cache or is there any way to optimize the whole process? </p> <p>Thanks, joel</p> <p>Update: The JAR was developed by our team.</p> <p>To use as a service, i'll have to install some java server (tomcat or alike), right?</p> <p>And how about a java php bridge? Can that be any faster?</p>
php java
[2, 1]
2,616,101
2,616,102
Loading local files via jQuery
<p>Spent 3 hours reading reference, but still no effect, so asking here.</p> <p>OS: Windows 7 (is it relevant?)<br> Browser: Opera 11.51<br> jQuery: 1.6.2</p> <hr> <p>Two files on a local machine, <strong>main.html</strong> and <strong>menu.html</strong> in the same folder.</p> <p>main.html:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="js/jquery-1.6.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ // append contents $('#menu').load('menu.html'); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table&gt; &lt;tr&gt; &lt;td id="menu"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>menu.html:</p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;body&gt; menu tree &lt;/body&gt; &lt;/html&gt; </code></pre> <p>As I guess, when I open main.html, there should be one table with one cell containing "menu tree" string. And it works, for example, in IE. But Opera doesn't show any result.</p> <p>I debugged the stuff with optional callback for load(), it shows that result status for load() is "error".</p> <p>What am I doing wrong?</p>
javascript jquery
[3, 5]
915,708
915,709
How to find all the id's associated with a particular class
<p>Using jquery how is it possible finding out all the id's associated with a given class?</p> <p>Any help??</p>
javascript jquery
[3, 5]
5,939,260
5,939,261
Adding multiple boxes in one page and saving the info from each box
<p>I have this task - to make a simple CMS where one of the abilities should be to create a page and add as many boxes as the admin would like and then to have the ability to edit each one of them using ckeditor, and ofcourse the page should be visible in the frontend.</p> <p>For now I'm just using CodeIgniter trying to keep things simple but for this task I can't think of pure PHP solution. I'm not much into JS and it's libraries/frameworks so what do you think is the solution with the smallest learning curve? I can't invest too much time in this, so I'm searching for an easy to implement solution (if there is such)?</p>
php javascript
[2, 3]
1,942,617
1,942,618
Alert when browser window closed accidentally
<p>I have a chat application, I want that whenever user accidentally or manually closes the browser ,he should get an alert so that various clean up operations could be carried out. I have more thing i itried to use on before event but I want that to be used for a particular web page as all other web pages are also called on before load. Please help</p>
javascript jquery
[3, 5]
3,291,519
3,291,520
list picker asp.net
<p>I have list picker asp.net one is assigned techs and unassigned techs my problem I need to remove the duplicate's name form unassigned I need a way to delete mike from list box b</p> <pre><code>list box A Mike list box B Mike Adam TOm </code></pre>
c# asp.net
[0, 9]
2,145,053
2,145,054
View for Team List
<p>I have a bit of a 'what is it' question.</p> <p>Currently, I am trying to create a page that will create teams, and allow the user to select the member for those teams.</p> <p>So far, dynamically render ListBoxes (amount based on teams selected) to the page, then the user selects a member, and adds them to the team.</p> <p>I want to allow for an <strong>x</strong> amount of teams added, but this will get messy with the amount of list boxers that could <em>possibly</em> be added.</p> <p>I would like to know if there is a view that could represent that in once clean environment. I would like do display the team name, in the header, and its member beneath - with editing options on them. I've looked up the GridView and ListView, but I cant see how they could do <em>exactly as i wanted.</em> I have provided a highly refined picture to help elaborate.</p> <p><img src="http://i.stack.imgur.com/M6K4E.png" alt="Very well crafted picture"></p> <p><strong>Edit:</strong> This is not a 'how do I do this - gimmie code question. I would just like to know IF it could be done, and if so, what control I could use. Mayb even a reference to a page with something similar to give me a quick tutorial ^^</p>
c# asp.net
[0, 9]
816,969
816,970
how to add a row to a table with asp.net controls dynamically using javascript
<p>Now, if i click a button Add Row, I want the entire row tr1 to get added to the table as it is...</p> <pre><code> &lt;table &gt; &lt;tr id="tr1" runat="server"&gt; &lt;td&gt; &lt;asp:TextBox ID="TextBox1" runat="server" Text="Name"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:TextBox ID="TextBox2" runat="server" Text="email"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Button ID="Button1" runat="server" Text="Submit" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Button ID="Button2" runat="server" Text="Add row" /&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p></p> <p>to make it more clear pls visit <a href="http://www.makemytrip.com" rel="nofollow">http://www.makemytrip.com</a> and click on Travel Multicity? In that popup panel, click Add another leg and see what happens....</p> <p>I need exactly that function in my application...please guide me how to achieve this.. Thanks</p>
javascript asp.net
[3, 9]
5,826,782
5,826,783
How to separately recognize the data sent over to php?
<p>I am sending two data to my php from my javascript: <a href="http://forum.research.bell-labs.com/zeeshan/publication/phpwithmysql11111.php?rowid=BL09.00001,0" rel="nofollow">http://forum.research.bell-labs.com/zeeshan/publication/phpwithmysql11111.php?rowid=BL09.00001,0</a></p> <p>1) BL09.00001 2) 0</p> <p>How do I recognize them separately in my php? I was trying to do:</p> <p>$job=$_GET[rowid]; echo($job);</p> <p>this gives me both the fields.</p>
php javascript
[2, 3]
3,986,245
3,986,246
append in word document using c#
<pre><code>//Text to word file StringBuilder strBuilder = newStringBuilder(); strBuilder.Append("&lt;h1 title='Header' align='Center'&gt;Writing To Word Using ASP.NET&lt;/h1&gt; ".ToString()); strBuilder.Append("&lt;br&gt;".ToString()); strBuilder.Append("&lt;table align='Center'&gt;".ToString()); strBuilder.Append("&lt;tr&gt;".ToString()); **strBuilder.Append("&lt;td style='width:100px;color:green'&gt;Date :&lt;asp:Label ID='lbl_dte' runat='server' Text=&gt;Labe2&lt;/asp:Label&gt;&lt;/td&gt;".ToString());** strBuilder.Append("&lt;td style='width:100px;color:red'&gt;India&lt;/td&gt;".ToString());' kstrBuilder.Append("&lt;/tr&gt;".ToString()); strBuilder.Append("&lt;/table&gt;".ToString()); // string strPath = Request.PhysicalApplicationPath + "\\document\\Test.doc"; string strPath = filename; //string strTextToWrite = TextBox1.Text; FileStream fStream = newFileStream (strPath,FileMode.Append); fStream.Close(); StreamWriter sWriter = newStreamWriter(strPath); sWriter.Write(strBuilder); sWriter.Close(); </code></pre> <p>I add a asp label <code>&lt;asp:Label ID='lbl_dte' runat='server' Text=&gt;Labe2&lt;/asp:Label&gt;</code></p> <p>Can I get the contol of label in code behind(c# asp.net)?</p>
c# asp.net
[0, 9]
4,737,245
4,737,246
Managing LinkButton with Javascript?
<p>I have a <code>LinkButton</code> called "Exit Chat" on the view.I embed <code>javascript</code> code into <code>OnClientClink=javascript:confirm('Are you sure you want to end the session?')</code>.However,I can't manage dialog box</p> <p>When user click the OK button,view should be terminated.How can I do this?</p> <pre><code>&lt;asp:LinkButton ID="LinkButton2" runat="server" Font- Bold="False" Font-Underline="False" OnClientClick="javascript:confirm('Are you sure you want to end the session?')" ViewStateMode="Enabled" OnClick="LinkButton2_Click1" Text="Exit Chat"&gt; &lt;/asp:LinkButton&gt; </code></pre> <p>I wrote this code part but didnt work :(</p> <pre><code>if (LinkButton2.CommandName=="OK") { MultiView1.ActiveViewIndex = -1; } else if(LinkButton2.CommandName=="Cancel") { MultiView1.ActiveViewIndex = 1; } </code></pre>
javascript asp.net
[3, 9]
1,683,447
1,683,448
How can I get the current username - USING MY CODE BELOW IN ASP.NET
<p>How can I get the current username of whoever made changes on a table? A button?</p> <pre><code>private string GetCurrentUserName() { return Utilities.CurrentUsername(); } </code></pre> <p>UTILITIES:</p> <pre><code> public static string CurrentUsername() { string[] data = HttpContext.Current.User.Identity.Name.ToString().Split(new char[] { '\\' }); string retVal = data[1]; return retVal; } </code></pre>
c# asp.net
[0, 9]
1,185,267
1,185,268
Binding a function to two events results in function executing twice
<p>I am binding an accordion tab to open on click and focus. But whenever I click, it executes the function twice. how do i stop this behavior? I only want it to execute a single event. either click or focus. </p> <pre><code>$("h2.radioBoxInActive").bind('click focus', function () { input = $(this).prev("span, input"); $(".selected", app.element).removeClass("selected").slideUp(); $(".radioBoxActive", app.element).removeClass("radioBoxActive"); $("#" + input.attr("data-panel")).slideDown().addClass("selected"); $(this).addClass("radioBoxActive"); }); </code></pre>
javascript jquery
[3, 5]
1,326,614
1,326,615
How do i trigger a lightbox when certain text is selected using jQuery?
<p>Ok so i have this </p> <pre><code>&lt;select class="something"&gt; &lt;option value=''&gt; Select a Project &lt;/option&gt; --- &lt;/option&gt; &lt;option value="/projects/2"&gt;test&lt;/option&gt; &lt;option value="/projects/3"&gt;test2&lt;/option&gt; &lt;option value="/projects/4"&gt;test7&lt;/option&gt; &lt;option value="/projects/5"&gt;test5&lt;/option&gt; </code></pre> <p>When someone clicks the Select a Project how would popup a lightbox just for that and not if they select the others....Popping up the lightbox is not too hard its distinquishing from the other options that i dont understand</p> <pre><code>$(".something").change </code></pre> <p>this will get all but i only want "Select a Project"</p>
javascript jquery
[3, 5]
352,768
352,769
JS plugin to detect user's browser, OS, language, geolocation...?
<p>I could have sworn that I saw this on Hacker News a few weeks ago: a simple JS plugin that gives you access to every common bit of information about your user - their OS, browser, language setting, etc.</p> <p>I'm pretty sure it was a commercial product that was then immediately copied and open-sourced by someone on HackerNews.</p> <p>But I now can't for the life of me remember what either the commercial product, or the open source plugin, were called. </p> <p>Can anyone suggest either? </p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,554,284
3,554,285
issue with insertBefore()
<p>I got a small object which has to append new rows to a table.. It works fine in most cases, but if there is a table inside some of the rows (in the "root" table) the object doesn't append to the proper table!?</p> <p>I have been doing a bit of debugging and found the line where it all goes wrong.. If DEBUG is set and the line with insertBefore() is omitted the object appends to the proper table</p> <pre><code>var List = new function(){ this.append_row = function(row, tbl, index){ if(DEBUG){ index = -1; } if(index == 0){ row.prependTo(tbl); } else if(index &gt; 0){ var elm = $('tr', tbl); if(elm.length &gt; index){ row.insertBefore(elm.eq(index)); // the issue is in this line } else{ row.appendTo(tbl); } } else{ row.appendTo(tbl); } }; } </code></pre>
javascript jquery
[3, 5]
3,894,245
3,894,246
Adding space BETWEEN cells in TableCell()
<p>My code is below. I want to add space between cells in tableCell() something the equivalent of </p> <pre><code>&lt;td&gt;&lt;/td&gt;&amp;nbsp;&amp;nbsp;&lt;td&gt;&lt;/td&gt; </code></pre> <p>I am NOT looking for cellpadding or cellspacing because they both add space between the left cell border and the left table border (wall); I want to add space between two CELLS, not the table and the cell; </p> <pre><code>protected void Page_Init(object sender, EventArgs e) { Table tb = new Table(); tb.ID = "tb1"; for (int i = 0; i &lt; iCounter; i++) { TableRow tr = new TableRow(); TextBox tbox = new TextBox(); tbox.ID = i.ToString(); TableCell tc = new TableCell(); tc.Controls.Add(tbox); tr.Cells.Add(tc); tb.Rows.Add(tr); } pnlScheduler.Controls.Add(tb); } </code></pre> <p>Any ideas?</p>
c# asp.net
[0, 9]
3,315,786
3,315,787
How to prevent an Android application from being installed more than three times?
<p>I have got a suggestion to restrict an Android application to be installed a limited number of times, let's suppose three times for a given user account. I have already inserted a form at the start of the application which checks for username and password from our database, and returns whether its valid or not. </p> <p>Next I have to apply a trick to prevent this application from being installed more than three times by each user. I hope it clears what I am trying to do. Any ideas what to do and how to proceed?</p>
java android
[1, 4]
2,526,696
2,526,697
Where to store password in runtime?
<p>My asp.net web application is reading and decrypting the password from a XML file in App_start event of Global.asax. But where should I store this password afterwards ? Would it be enough just store it in a static public variable or rather the application object ?</p> <p>EDIT: Its a Database password</p>
c# asp.net
[0, 9]
4,718,008
4,718,009
GridView x BaseAdapter and reload in onItemClick
<p>Following the <a href="http://developer.android.com/resources/tutorials/views/hello-gridview.html" rel="nofollow">example of GridView</a> how I could run a new query of images in the event onItemClick? I could make a casting of my BaseAdapter in that event ?</p>
java android
[1, 4]
2,696,264
2,696,265
how to keep goods'info in invoice form?
<p>I use three tables to save invoices:</p> <ol> <li>Invoice</li> <li>InvoiceDetail</li> <li>TempInvoiceDetail</li> </ol> <p>when user add goods i add goods in TempInvoiceDetail.</p> <p>then user select all goods and click on "Save Invoice".</p> <p>i add one row in Invoice then move all row from TempInvoiceDetail to InvoiceDetail ,then Delete TempInvoiceDetail.</p> <p>i save userid is it true? do u have any idea?</p>
c# asp.net
[0, 9]
3,053,994
3,053,995
How do I stretch a background image to fill the window and get it to animate?
<p>For a project I'm working on I need to stretch a background image to fill the browser window <em>and</em> be able to have them transition via sliding eg. Say you're on the home page, I'd want the user to be able to click on a navigation link for 'About', and then have the background image slide into a different image.</p> <p>Usually I'd use <a href="http://srobbin.com/jquery-plugins/backstretch/" rel="nofollow">backstretch</a> to stretch an image to fill the browser window, but I need to be able to slide to a new image.</p> <p>I can use backstretch to fill the window, and I can get the sliding working <em>IF</em> I'm using divs of fixed dimensions.. but is it possible to combine the two?</p> <p>Thanks</p>
javascript jquery
[3, 5]