Unnamed: 0 int64 65 6.03M | Id int64 66 6.03M | Title stringlengths 10 191 | input stringlengths 23 4.18k | output stringclasses 10 values | Tag_Number stringclasses 10 values |
|---|---|---|---|---|---|
774,952 | 774,953 | i have made a download manager . how can i add feature BHO(Browser Help Object)? | <p>i have made a download manager . how can i add feature BHO(Browser Help Object) ?</p>
| java | [1] |
990,464 | 990,465 | Select Keyword as a Spinner's Item in android | <p>I have question that I have two spinners in which data comes after JSON Parsing, I want to show the first selected element in spinner is "Select" and When we click on that Spinner it shows me all the data after parsing in a list. I don't know How it will achieved?</p>
<p>Please suggest me the right result.</p>
<p>Thanks in advance.</p>
| android | [4] |
1,097,193 | 1,097,194 | SharedPreferences, PreferenceActivity problem | <p>I have in my settings.xml two CheckBoxes.
Each checkboxes has same keys "ShowContactPhotosCheckBoxPref":</p>
<pre><code><PreferenceScreen
android:title="Appearence"
android:key="AppearencePref" >
......
<PreferenceCategory
android:title="Show Contact Photos">
<CheckBoxPreference
android:title="Show Contact Photos"
android:summary="@string/show_contact_photos_preference"
android:defaultValue="true"
android:key="ShowContactPhotosCheckBoxPref" />
</PreferenceCategory>
........
</PreferenceScreen>
.......
<PreferenceScreen
android:title="Contact Options"
android:key="ContactOtionsPref">
<PreferenceCategory
android:title="Show Contact Photos">
<CheckBoxPreference
android:title="Show Contact Photos"
android:defaultValue="true"
android:key="ShowContactPhotosCheckBoxPref" />
</PreferenceCategory>
......
</PreferenceScreen>
</code></pre>
<p>After start app state of chekbox №1 = chekbox №2 = true.
When I click on chekbox №1(state unchecked) and then go to checkbox №2 - state checked, but in my SharedPreferences file state of ShowContactPhotosCheckBoxPref is false.
It is possible to synchronize these chekboxes?</p>
| android | [4] |
3,480,896 | 3,480,897 | How to stop Jquery load function | <p>The Jquery load function don't stop if there is multiple click on the links in the menu.</p>
<p>The jquery code looks like:</p>
<pre><code>$(document).ready(function(){
$(".menu_rfr").unbind("click").click(function() {
$("#main").html('<img src="img/spin.gif" class="spin">');
location.replace($(this).attr('rel'));
});
function handleClick() {
$(this).unbind("click");
$("#main").html('<img src="img/spin.gif" class="spin">');
$("#main").load($(this).attr('rel'), function() {
// reactivate it after some loading has completed
$(this).click(handleClick);
});
}
$(".menu_clickable").click(handleClick);
});
</code></pre>
<p>You can see the sample page at <a href="http://www.supersexmarket.com/test.php" rel="nofollow">link text</a></p>
<p>How can I prevent users clicks if the DIV content is not loaded completely and never ending DIV loading? </p>
| jquery | [5] |
571,301 | 571,302 | jQuery .click function not working | <p>I have a snippet of HTML that when a link is clicked, the div content becomes the linked div content. The first function works fine. It is the second click on #hidelink that jQuery doesn't seem to respond. What am I missing here?</p>
<pre><code><div id="right">
<div id='titletext'><p>||||||||||||||</p></div>
<div id='presentation'></div>
<div class='hidethisdiv'>
<div id ="years">
<h4><a id='resourceslink' href='#resources'>2010 Presentations</a></h4>
</div>
<div id='resources'>
<h4><a id='resourceslink' href='#resources'>2010 Presentations</a></h4>
<p><a id='hidelink' href='#years'>&laquo;--back</a></p>
</div>
</div>
</div>
<script type="text/javascript">// <![CDATA[
$('#mainmenu').fadeIn(2000, function() {
// Animation complete.
});
$('#presentation').html($('#years').html());
$( function() {
$("#resourceslink").click(
function () {
$('#presentation').html($('#resources').html());
}
);
$("#hidelink").click(
function (){
$('#presentation').html($('#years').html());
}
);
//just add more divs like resources and a hidelink for new conferences
});
</script>
</code></pre>
| jquery | [5] |
206,782 | 206,783 | Proper way to know whether an Activity has been destroyed | <p>May I know what is the proper way to know whether an Activity has been destroyed? Currently, I am using the following way.</p>
<pre><code>private volatile boolean isOnDestroyCalled = false;
@Override
protected void onDestroy() {
super.onDestroy();
isOnDestroyCalled = true;
}
public boolean isOnDestroyCalled() {
return this.isOnDestroyCalled;
}
</code></pre>
<p>Is there any other way better than the above?</p>
| android | [4] |
1,283,965 | 1,283,966 | PHP sort mutlidim array usort not working | <p>Hi I need to sort an array by date:</p>
<p>This is my array $get:</p>
<pre><code>Array (
[0] => Array (
[Date] => 02.06.2012
[Theme] => test
)
[1] => Array (
[Date] => 03.07.2012
[Theme] => lol
)
[2] => Array (
[Date] => 09.06.2012
[Theme] => hm
)
)
</code></pre>
<p>I tried following code:</p>
<pre><code>function date_sort($a, $b) {
return strcmp($a['Date'], $b['Date']);
}
usort($get, 'date_sort');
</code></pre>
<p>But all I get is unordered dates. My date is set dd.mm.yyyy!</p>
| php | [2] |
2,159,440 | 2,159,441 | convert ds.Tables[1].Rows[0].ToString() to int | <p>I can't convert <code>ds.Tables[1].Rows[0].ToString()</code> to an int.</p>
<pre><code>ds.Tables[1].Rows[0] = 100;
</code></pre>
<p>Gives an error can't convert.</p>
| c# | [0] |
5,785,059 | 5,785,060 | How to convert an ipa file to a deb file | <p>How do I convert a .ipa file to a .deb file?</p>
| iphone | [8] |
4,713,432 | 4,713,433 | Adding a function to a JavaScript object | <p>In my JavaScript I have an object instance called "View". I want to add a function to this object. The function looks something like </p>
<pre><code>function csiSelectValueRestriction (columnName) {
//... <a rather long and involved function>
}
</code></pre>
<p>Ultimately I want to be able to use the function in the following way:</p>
<pre><code>var result = View.csiSelectValueRestriction ("bldgs");
</code></pre>
<p>What is the simplest way to accomplish this?</p>
| javascript | [3] |
1,666 | 1,667 | Is there any differents between $GLOBALS["test"] and global $test? | <p>can any one please let me know the basic differences between </p>
<pre><code>$GLOBALS["test"] and global $test
</code></pre>
<p>and, will it make sense that, if i use <code>$GLOBALS["test"]</code> instead of <code>$_SESSION['test']</code>?</p>
| php | [2] |
5,292,487 | 5,292,488 | str_replace or which other function to detect a word and delete everything after it? | <p>What function should I use to search for a string in a paragraph and then delete everything including and after that string?</p>
<p>So if I had a paragraph
"Marry had a little lamb and the wolf ate them all. Then marry went to Walmart for more lambs."</p>
<p>And I used a function to search "lamb" everything including lamb and stuff after it should be deleted. So the resulting text should be "Marry had a little"</p>
| php | [2] |
5,887,634 | 5,887,635 | jquery - how to select for this, get a count, and get the current position within the selected group | <p>I have a set of img boxes that are marked up like this</p>
<p>I want to get a count and have this:</p>
<pre><code><div data-location-id="6" class="img-box-set">my img</div>
</code></pre>
<p>I have:</p>
<pre><code>var location_id = $(this).data('location-id');
// fixed per comment #1 below
var count_of=$('.img-box-set[data-location-id='+location_id+']').length;
alert("here is count_of" + count_of);
</code></pre>
<p>but the length always returns 0. Am I doing something wrong with selector or with length property?</p>
<p>Also, assuming I have 4, how would I determine which position I'm in (either 0-based or 1-based)?</p>
<p>thx</p>
<p><strong>edit #1</strong>
So I'd think this works but it isn't (per @jack ) and index docs. (update - this does work; had syntax error)</p>
<pre><code>var index_box=$('.img-box-set[data-location-id='+location_id+']').index(this);
alert("here is the index" + index_box);
</code></pre>
| jquery | [5] |
2,242,278 | 2,242,279 | Jquery check if input .val() contains certain characters | <p>I need to check if an input field on my page contains characters.</p>
<p>This is for very basic email address validation so I only want to check if the text is not empty, and contains <code>@</code> and <code>.</code> characters.</p>
<p>I've been trying this way:</p>
<pre><code>if (($("." + parentname.attr("class") + " #email").val().contains("@")) && ($("." + parentname.attr("class") + " #email").val().contains(".")))
{
email = 1;
}
</code></pre>
<p>Assuming a value of <code>me@this.com</code>, this code will throw the following error:</p>
<blockquote>
<p>Object me@this.com has no method 'contains'</p>
</blockquote>
<p>So I did some research and found that .contains is for DOM objects, not strings with a suggestion to try this:</p>
<pre><code>if (($("." + parentname.attr("class") + " #email").val().IndexOf("@") != -1) && ($("." + parentname.attr("class") + " #email").val().IndexOf(".") != -1))
{
email = 1;
}
</code></pre>
<p>Which results in a similar error:</p>
<blockquote>
<p>Object me@this.com has no method 'IndexOf'</p>
</blockquote>
<p>I'm basically out of ideas here especially considering that the following code works as I want it to in another site I've made:</p>
<pre><code>if ($("#contact-email").val().contains("yahoo.com")) {
$(".errmsg").text("Domain yahoo.com has been banned due to excessive spam, please use another domain.");
}
</code></pre>
<p>Can anyone suggest any other things I could try or, better yet, how to do this properly?</p>
| jquery | [5] |
3,850,037 | 3,850,038 | Using visibility to layer screens - is there any potential impact on triggering event on the visible elements | <p>I have a general question - no code this time. I accept that if visibility is set to hidden on say a form, no events can be fired on that form until it is set visible. </p>
<p>I have used this approach to set up a series of screens and menus using jQuery to make them visible or hidden as appropriate in response to various events.</p>
<p>I have set these up using position: absolute; and the z-index so that they are effectively layered.</p>
<p>I note that some tutorials favour setting any sub menus/screens up, that are not immediately required, off the visible page - say - </p>
<p>margin-left: -500px; </p>
<p>And when required pull them in to the visible area.</p>
<p>I would like to know whether there is any potential difficulty that I am currently unaware of when layering the screens and controlling them using visibility and whether this is the reason for placing elements you might need later off to one side.</p>
| jquery | [5] |
2,002,340 | 2,002,341 | Python 3.2.3 ValueError: could not convert string to float | <pre><code>import math
pi = 3.1415
r = float(input("Enter the radius: "))
angle = float(input("Enter the angle: "))
x = r * math.cos(angle)
y = r * math.sin(angle)
print ('x =', x, 'y =', y)
</code></pre>
<p>When I enter pi, or anything with pi, as answer for angle prompt, I get this error:</p>
<pre><code>ValueError: could not convert string to float: 'pi'
</code></pre>
<p>Any suggestions what to do?</p>
| python | [7] |
3,430,466 | 3,430,467 | Failed adding to JNI local ref table (has 512 entries) | <p>I am working in an android application and I am getting an error "dalvikvm(11625): Failed adding to JNI local ref table (has 512 entries)" when I try to run my application on certain devices. Please help me to rectify the error. </p>
<p>Thanks in advance</p>
| android | [4] |
394,380 | 394,381 | is there any way by which we can edit a html file in the iphone at the runtime? | <p>HI all,</p>
<p>Is there any way by which we can edit a html file that is in our resource directory and we want to edit some tags in that html first and want to show that html in web view.</p>
<p>Is it possible ??</p>
<p>Thanks ...</p>
| iphone | [8] |
1,322,896 | 1,322,897 | Are iPhone 'standard' sounds (e.g. shutter, email sent) available for use? | <p>I was hoping to make use of the sounds that Apple has created for its applications, like the sound that is played when the camera's shutter is fired.</p>
<p>It appears that these sounds aren't available for usage from within the SDK. Is this accurate?</p>
<p>Thanks.</p>
| iphone | [8] |
5,480,437 | 5,480,438 | How would I loop my program 5 seconds after the answer is given | <pre><code>import java.io.*;
public class Printer {
public static void main (String[] args) throws Exception {
while(true){
System.out.println("Enter a number:");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = br.readLine();
double number = Double.valueOf(input).doubleValue();
System.out.println("Enter second number:");
input = br.readLine();
double number1= Double.valueOf(input).doubleValue();
System.out.println("Enter operator(+, -, *, /): ");
input = br.readLine(); //"+" "-" "*" "/"
if (input.compareTo ("+") == 0)
{
System.out.println("Answer is: " + (number + number1));
break;
}
else if (input.compareTo ("-") == 0)
{
System.out.println("Answer is: " + (number - number1));
break;
}
else if (input.compareTo ("*") == 0)
{
System.out.println("Answer is: " + (number * number1));
break;
}
else if (input.compareTo ("/") == 0)
{
System.out.println("Answer is: " + (number / number1));
break;
}
}
}
}
</code></pre>
| java | [1] |
5,724,544 | 5,724,545 | Get List of weeks by giving year and month as parameter C# | <p>I need list of weeks with starting and ending dates by giving int year and int month,</p>
<p>Example Result,</p>
<p>Week1 = 7/1/2012 to 7/1/2012</p>
<p>Week2 = 7/2/2012 to 7/8/2012</p>
<p>Week3 = 7/9/2012 to 7/15/2012</p>
<p>Week4 = 7/16/2012 to 7/22/2012</p>
<p>Week5 = 7/23/2012 to 7/29/2012</p>
<p>Week6 = 7/30/2012 to 7/31/2012</p>
| c# | [0] |
2,346,839 | 2,346,840 | Android Key Hash | <p>Hi friends i wanna to generate Key hash to incorporate FaceBook Application in my Apps.. I am having Open SSL Zip. pl guide me how to generate key.. </p>
| android | [4] |
1,068,380 | 1,068,381 | Touch coordinates in iPhone landscape mode app | <p>I am trying to make this <strong>landscape only</strong> iphone app.</p>
<p>I only use this code for this purpose:</p>
<pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); }
</code></pre>
<p>However when I click clip subviews checkbox from interface builder, the view is clipped from the middle.</p>
<p>I also don't receive any touch events from outside of view bounds obviously.</p>
<pre><code>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
CGPoint fingerPos = [[touches anyObject] locationInView:self.view];
NSLog(@"%f %f",fingerPos.x,fingerPos.y); }
</code></pre>
<p>only prints for coordinates between 20 and 320 for X. But Y works fine.</p>
<p>When i try to modify bounds by hand, everything works fine; View is positioned and shown correctly, printed coordinates are correct, I receive touch from all of the screen except between 0 and 20 for X. So Left side of the screen is unresponsive to touch events for only 20 pixels. Code I use to modify bounds:</p>
<pre><code>self.view.bounds = CGRectMake(-180.0f, 0.0f, 680.0f, 480.0f);
</code></pre>
<p>What might be causing this? Weird!</p>
| iphone | [8] |
2,264,787 | 2,264,788 | What's the meaning of this syntax ?> <?php | <pre><code><?php
for($i=0;$i<=100;$i++)
{
?> // why this
<tr>
<td> <?php echo $i; ?></td>
<td><?php echo "tên sách $i"; ?></td>
<td><?php echo "noi dung sach $i";?></td>
</tr>
<?php
}
?>
</code></pre>
<p>So that is the scenario I'm looking to understand. Thanks</p>
| php | [2] |
754,084 | 754,085 | Android: How to get image files from directory into view.setBackgroundDrawable() | <p>I'm trying to make an app that can take images from a directory on the android phone and display them in a layout. I seem to be working my way towards a solution in a backwards manner. I know to use <code>view.setBackgroundDrawable(Drawable.createFromPath(String pathName));</code> to display the image, but I don't know how to get the image's path from the directory.</p>
<p>I have a vague idea of what to do, but would appreciate clarification on this matter. I think the next step is to use: </p>
<pre><code>String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state) || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
File file[] = Environment.getExternalStorageDirectory().listFiles();
}
</code></pre>
<p>But how do I filter the files so that only image files get stored in my <code>file[]</code>? Such as .png or .jpg/.jpeg files? And after that, should I use <code>files[].getPath</code> or <code>files[].getAbsolutePath</code>? I would store the result in a <code>String[]</code>.</p>
<p>What I am mainly asking for is verification that the above code should work. And also, how I might filter to store only image files such as <code>.png</code>, <code>.jpg</code> and <code>.jpeg</code>.</p>
<p>Thank you for your time.</p>
| android | [4] |
4,381,940 | 4,381,941 | 'list::list' names the constructor, not the type | <p>I get this error while compiling my class linked list with constructors. I wanted to do a copy assignment operator, but i get this error 'list::list' names the constructor, not the type.
the line is:</p>
<pre><code>list::list& operator= (const list &l)
</code></pre>
<p>list is my the name of my class</p>
| c++ | [6] |
1,754,539 | 1,754,540 | Smart way to end a subroutine if file doesnt exist in cwd | <p>I am trying to open file "data.txt" in the cwd and readthe lines,is there a oneliner(or close ) to exit the subroutine if the file doesnt exist..i know there are ways like using os.path.exists and try/except IO error but am interested in one-liner or the smartest way</p>
<pre><code>def readfile ():
f = open('data.txt')
lines = f.readlines()
f.close()
</code></pre>
| python | [7] |
5,673,045 | 5,673,046 | Trying to override onbeforeunload in first step of form wizard | <p>This pertains to a form wizard with 5 steps, I don't want the user to hit back and lose form data in any step 2-4. I have added a flag for the submit function and need to add this one for the first step. If they get there by accident and try and leave I dont want the cofirm dialog popping up.</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
var action_is_post = false;
$("form").submit(function () {
action_is_post = true;
});
//this is the trouble spot. on the first step the "navigation" of the form has a class
//of current (on step one = current)
$(this).ready(function () {
if ($("#stepDesc0").is(".current")) {
action_is_post = true;
}
);
window.onbeforeunload = confirmExit;
function confirmExit()
{
if (!action_is_post)
return 'Using the browsers back, refresh or close button will cause you to lose all
form data. Please use the Next and Back buttons on the form.';
}
});
</script>
</code></pre>
| jquery | [5] |
3,210,529 | 3,210,530 | Android, running an app in the background | <p>I have an app which consists of a simple GUI and a few Broadcast receivers.
I found somewhere on here how to start an app on boot of the device but cant seem to locate it atm.
However i need more i need it to start in the background and just listen using the broadcast receivers and then return to this state after the Gui(the visible part of the app) has been used.
Is there a way of doing this?
Thanks.</p>
| android | [4] |
2,495,396 | 2,495,397 | Get values from arraylist inside object inside arraylist in Java? | <p>This is complicated, but I will do my best to explain my question. Object customer from the Customer class has a arraylist inside the object that store different account numbers. And all of the customer objects are stored in a arraylist. So my problem and question is how to get the account numbers from the arraylist, customerAccountsList, inside the object customer that is inside the arraylist customerList!?</p>
<p>With some help from previous questions here I have learned how to get values from objects inside an arraylist like this:</p>
<pre><code>customerList.get(index).getAccountOwnername();
</code></pre>
<p>But now I'm looking for something like this:</p>
<pre><code>customerList.get(index).getAccountNumbers(????);
</code></pre>
<p>Help is preciated! Thanks!</p>
<p>EDIT: </p>
<pre><code>customerList.get(index).getAccountNumbers(arraylist that holds all account numbers)
</code></pre>
<p>I want to either get a single account number or all account numbers that are inside the arraylist. I don't want to do it to complicated since I rather new in java programming</p>
<p>EDIT 2:</p>
<p>Inside the Customer class I have this code:</p>
<pre><code>ArrayList<String> customerAccountsList = new ArrayList<String>();
</code></pre>
<p>Inside the main class I have this code:</p>
<pre><code>// create an arraylist to store customer objects
ArrayList<Customer> customerList = new ArrayList<Customer>();
</code></pre>
| java | [1] |
577,722 | 577,723 | sending email to users contact list? | <p>i have an application to retrieve an users contact list in a gridview...how do i send email to all the users from the users contact list??</p>
<p>Steps:-</p>
<p>1.User enters hi/her email id and password.
2.Clicks on send invites.
3.The button click event should send invitation email to all the contacts in users contact list.[ how to do the 3rd step??] </p>
| asp.net | [9] |
2,551,903 | 2,551,904 | How can i stop a thread in oncheckedchanged? | <p>Well i can start the thread when i press togglebutton to ON and it works fine, that thread is to start audiorecord and audiotrack.
But i cannot stop the thread when i put togglebutton OFF... cuz cannot do thread.stop... What i want to do is just stop audiorecord and audiotrack... If there is any way to start/stop them w/o making thread will be also fine.
Also, as i cannot stop thread, when i do togglebutton ON - OFF - ON, it makes an error cuz cant start a thread 2 times. </p>
| android | [4] |
3,889,837 | 3,889,838 | Is it possible to change the type of an array in Java? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/11437203/byte-array-to-int-array">byte array to Int Array</a> </p>
</blockquote>
<p>I have a large array of bytes, can I somehow interpret it as an array of ints, such that each entry is just four of the original bytes?</p>
<p>I mean something like this:</p>
<pre><code>for (int i = 0; i < byteArray.length; i += 4) {
intArray[i / 4] = byteArray[i] << 24 + byteArray[i+1] << 16 + byteArray[i+2] << 8 + byteArray[i+3];
}
</code></pre>
<p>but rather than copying the whole array byte by byte which takes forever because the array is huge, just read ints off the array that already exists.</p>
| java | [1] |
2,717,291 | 2,717,292 | How can I clear the buffer so this works? | <p>It works in the IF statement, but in the ELSE statement, I have to type 4 responses before it prints out. Any ideas? I know I need to clear the buffer somehow I think.</p>
<pre><code>System.out.println("Would you like to play a game? (Y/N)");
if(scanInput.next().equalsIgnoreCase("y")||scanInput.next().equalsIgnoreCase("Y")) {
System.out.println("let's play");
}
else if (scanInput.next().equalsIgnoreCase("n") || scanInput.next().equalsIgnoreCase("N")){
System.out.println("Goodbye");
}
</code></pre>
| java | [1] |
2,972,320 | 2,972,321 | How do I trigger a form submission on page load using Jquery | <p>This doesn't seem like it should be too difficult to accomplish, but I'm in a rush and I have been looking for a simple answer. I need to submit a form on page load. This is my AJAX submit function which works fine. I just need to figure out how to trigger it on page load.</p>
<p>Any help is much appreciated!</p>
<pre><code>$("form#seller-agreement-form").submit(function() {
// we want to store the values from the form input box, then send via ajax below
$.ajax({
type: "POST",
url: "http://www2.myurl.com/formhandler",
data: "email="+ email + "&status=" + status,
success: function(){
$('form#seller-agreement-form').hide(function(){$('div#output').fadeIn();});
}
});
return false;
});
</code></pre>
| jquery | [5] |
3,823,777 | 3,823,778 | Deleting files in folder with python | <p>I have one folder with one geodatabase and two other files (txt). I used zip and zipped them. So now in this folder i have gdb, txt,txt, and new zip file. Now I need to delete those files that were zipped, so that will be only zip file in the folder.
I wrote the following code:</p>
<pre><code>def remove_files():
for l in os.listdir(DestPath):
if l.find('zipped.zip') > -1:
pass
else:
print ('Deleting ' + l)
os.remove(l)
</code></pre>
<p>But got:</p>
<pre><code>Error Info:
[Error 2] The system cannot find the file specified: 'geogeo.gdb'
</code></pre>
<p>Can anyone help me?
Thank you in advance.</p>
| python | [7] |
5,791,710 | 5,791,711 | Disable Back Button (showing cached version) without JavaScript | <p>I want to disable the broswer back button without using javascript. So far i have used this coding:</p>
<pre><code>Response.CacheControl = "no-cache"
Response.CacheControl = "private"
Response.CacheControl = "public"
</code></pre>
<p>It's working fine in the internet explorer 8 but in case of mozilla fire fox it is not working.pls say same the solution to work in all browsers.</p>
<p>Thanks in advance</p>
<p>With Regards
V.karthik</p>
| asp.net | [9] |
246,783 | 246,784 | android apk file size gets doubled on market | <p>I have recently uploaded an application on the android market, and i have noticed that the application size is appearing 2X on the market.</p>
<p>Could someone please help in figuring out the reason and solution to bring it back to original size .</p>
<p>will appreciate the help.</p>
| android | [4] |
6,005,657 | 6,005,658 | How to add an android project as a JAR file in another android project | <p>I have an android project containing only login module. I want to integrate this into another android project. I searched and got the answer that make JAR file of login module project or make that as a library project. At login button click i have to call activity of other project. How can i do this? Please provide best solution to do this integration.</p>
<p>Thanks in advance.
Please Help.</p>
| android | [4] |
3,481,329 | 3,481,330 | How to use extract and merge together in python | <p>Currently, I have two tools, Merge and Extract. Is there a way that I can extract what I want, and have it do the merge prior to my command? It would be great if I can find some sort of routine that will handle the defaulting for merge. How can I do this?</p>
<p>Any help will be much appreciated!</p>
<p>Thanks!</p>
| python | [7] |
709,667 | 709,668 | c# and IIS programming | <p>I created a small c# console application in which my app.config file will look like below.</p>
<pre><code><appSettings>
<add key="WebRoot" value="webroot" />
<add key="TempDir" value="temp" />
<add key="ServerPort" value="8086" />
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</code></pre>
<p>And from the browser i use the URL http:\localhost:8086\user\login
To process this i used Tiny HTTP server (freesource), now instead of this i want to write the url process using IIS.
Please give me some simple examples or some google url's where i can refer.
But it will be good if i get a simple program.
Thanks in advance
Ramya</p>
| c# | [0] |
4,067,839 | 4,067,840 | C++ reading from a file | <p>I have a file that is organized into columns, with data that needs to be stored in a vector of a type of class to store each of the data columns, I would suppose.</p>
<p>The data looks like:</p>
<pre><code>ATOM 1 N PRO 1 -38.396 -1.525 2.011 -0.18 14.01
ATOM 2 CA PRO 1 -36.931 -1.372 2.090 0.08 13.02
ATOM 3 C PRO 1 -36.353 -0.411 1.059 0.35 12.01
ATOM 4 O PRO 1 -36.988 -0.061 0.086 -0.37 16.00
ATOM 5 CB PRO 1 -36.368 -2.749 1.735 0.03 14.03
ATOM 6 CG PRO 1 -37.417 -3.202 0.763 0.01 14.03
ATOM 7 CD PRO 1 -38.692 -2.893 1.489 0.08 14.03
</code></pre>
<p>There are also some redundant columns in the beginning that I do not want, how can I select data as needed.
Can someone direct me in the correct direction?</p>
| c++ | [6] |
2,021,789 | 2,021,790 | Learning Android Programming Tips (Not asking for books or other common reposts) | <p>I am not asking for book suggestions, but rather a plan of attack for learning Android. I have three books on Android, and even the beginners version is a little confusing. The good part however, is when the book explains the code, I can see the logic in the code, and understand why they are writing what they do; but I would not be able to edit the code to do something slightly different. For example, if the code is to create a button that says "Hello", I cannot write code to make the button Say Hello then open a picture, followed by a website.</p>
<p>I have also tried YouTube, and they have great resources, but again, after the lesson is over, that is it.</p>
<p>The three books that I purchased -"Hello, Android" , "Android Apps for Absolute Beginners" , "Beginning Android Games" - are highly rated on amazon.com, but one thing that they lack is a study plan per se. What do you recommend that I do?</p>
| android | [4] |
297,275 | 297,276 | How do I get TimeSpan in minutes given two Dates? | <p>To get TimeSpan in minutes from given two Dates I am doing the following</p>
<pre><code>int totalMinutes = 0;
TimeSpan outresult = end.Subtract(start);
totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes);
return totalMinutes;
</code></pre>
<p>Is there a better way?</p>
| c# | [0] |
5,547,863 | 5,547,864 | expand the hit area of a view | <p>I have a small button on a view that I cannot make larger (movers and shakers don't want it larger). It's very hard to click on the button because of other views around it. At androiddevcon III Dave someone or another gave a talk on expanding the hit area of a view but he didn't include the code in his example. Now I'm trying to figure out how to actually implement this. </p>
<p>What i'm trying to do is fire a Button.onClick event if a click occurs within a larger rect. The following code seems to work in the 2.3.4 emulator(hard to tell because the emulator doesn't have the functionality i'm trying to test) but doesn't at all on a Motorolla phone running android 2.3.4.</p>
<pre><code> View view=findViewById(R.id.Header);
view.setOnTouchListener(new OnTouchListener(){
public boolean onTouch(View v, MotionEvent event) {
Rect rect=new Rect();
Button btn=(Button)findViewById(R.id.btn1);
btn.getHitRect(rect);
util.scaleRect(rect);
if (rect.contains((int)event.getX(), (int)event.getY())){
event.setLocation(rect.exactCenterX(), rect.exactCenterY());
btn.dispatchTouchEvent(event);
return true;
}
else{
return false;
}
}
});
</code></pre>
| android | [4] |
1,948,912 | 1,948,913 | Converting from byte to int in java | <p>I have generated a secure random number and put its value into a byte. Here is my code.<br></p>
<pre><code>SecureRandom ranGen = new SecureRandom();
byte[] rno = new byte[4];
ranGen.nextBytes(rno);
int i=rno[0].intValue();
</code></pre>
<p>But I am getting an error :</p>
<pre><code> byte cannot be dereferenced
</code></pre>
| java | [1] |
2,609,032 | 2,609,033 | Supporting Android 1.5, features from Android 2.1 and no Reflection? | <p>I currently have an app on the market that supports Android 1.5 (SDK level 3) and up. It also takes advantage of several features that are only present in Android 2.0 (SDK level 5) and up. I do this using Reflection.</p>
<p>I read a post on the Android Developer Blog that talks about how to support these new features while using <strong>no</strong> Reflection, which would be amazing.
<a href="http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html" rel="nofollow">http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html</a></p>
<pre><code><uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
</code></pre>
<p>I have tested this out and while it works there is one huge downfall. Currently if I try to add a SDK level 5 class, but I don't know that it's a SDK level 5 class, there is no worries. Eclipse isnt going to find the class and I'm not going to be able to add it.</p>
<p>Using Google's recommended method does allow me to add the classes and gives me no notification that this code is targeted just to SDK level 5 users. This opens up too big of a possibility of adding in code that would break some users without knowing.</p>
<p>Does anyone know of any plugins, options, etc that would warn me at the places I have targeted SDK level 5 to keep this from happening?</p>
| android | [4] |
2,267,415 | 2,267,416 | In Java void method calling | <p>In java is there a way to call a void method from a constructor.I try something like this but get an error message that the compiler can not find symbol method printThis(java.lang.String):</p>
<pre><code>public class Date{
public Date(String inString){
String s = inString;
String b;
b.printThis(s);
}
public void printThis(getString)
{
System.out.printf(System.out.printf( new SimpleDateFormat("MM/dd").format(new SimpleDateFormat("MM/dd").parse(getString) ) );
}
</code></pre>
| java | [1] |
2,897,742 | 2,897,743 | Pop Out Menu with <table> tag | <p>We can create a pop out menu by using ul & li tags, but can we achieve the same with the table tag in conjunction with some JS code?</p>
<pre><code><table>
<tr>
<td>Menu1</td>
<td>Submenu 1</td>
</tr>
</table>
<!-- here is some Javascript that does the magic -->
</code></pre>
| javascript | [3] |
4,052,617 | 4,052,618 | C# Getting value from delegate methods inside a class --- ref with lambda operator? | <p>I want to encapsulate delegate methods, which will be invoked later on. This delegate method, when invoked, will calculate some arguments at that instance of time and assign/return the value to a variable outside of the class.</p>
<p>For example, I have a class Tool</p>
<p>This tool should generate, let's say Point, when the delegate method is called...</p>
<pre><code>public delegate void Action();
class Tool
{
public Action Select;
public Action Cancel;
public Point position;
public Tool(ref Point outPoint) //Cannot use ref with lambda...
{
Select = () => outPoint = position;
}
public void Update(Point newPosition)
{
position = newPosition
}
public void UpdateKey(Keys k, bool IsPress)
{
//Invoke Select/Cancel when press some keys
}
}
</code></pre>
<p>What I am trying to accomplish here is a simple function that should receive my input and fill it with correct argument after Select is invoked. If this was a single method, then it is easily done using ref. However, I have to keep track of many arguments, so I have to turn it into a class. Another thing is, this invocation happens inside the class, so I cannot return the calculated value from within the class. Even though I could change the design so that the update method is updated from outside of the class, what I desire is to have the class manages its own update routines. I know that there should be a better way, so if there is any, please tell me.</p>
| c# | [0] |
2,527,874 | 2,527,875 | Alternative to using relationship with SQLite | <p>I'm creating an app which is going to have some data that is stored in an SQLite database. I want the user to be able to create "folders" which can be assigned to each data item.</p>
<p>I was going to do this using a one to many relationship e.g. one "folder" can have many data objects under it but having looked at relationships with SQLite and Android it seems that this would only work in 2.2+ so I'm just wondering what the alternative is?</p>
<p>Any information is much appreciated.</p>
| android | [4] |
4,916,406 | 4,916,407 | Php restricting the data insertion in mysql | <p>I have a list box with two times i.e 12:00 to 2:00 and 2:00 to 4:00.I want to do that when someone submit the form (example a meeting reservation form) the timing inserted into the databse should be booked only for three times.when someone tries to insert the same time for the fourth time,it should give us message like (already booked).
help me to do this in php, mysql.
thanks</p>
| php | [2] |
1,987,555 | 1,987,556 | How can I declare a constant in a public static class? | <p>I have this class:</p>
<pre><code>public static class LinkExtensions
{
</code></pre>
<p>Within this class I have a lot of methods that use a constant. Can someone explain to me is it possible for me to declare a constant at the class level that I can use in all these methods?</p>
| c# | [0] |
3,772,047 | 3,772,048 | Wait function in Java | <p>So I am writing a Java code to represent a heap sort and to represent the operation I need to have a waiting function which will wait between different operation but I am not sure if there is a function in Java that does that or do I need to write the function by myself and how would i do that.</p>
<p>Representing heap sport is a homework but writing the waiting function isn't so I appreciate your help</p>
| java | [1] |
430,363 | 430,364 | Is there any jquery quiz plugin? | <p>I'm looking for quiz application. where teacher can create quiz. Is there any jquery plugin? I want to use this plugin in cakephp. thanks</p>
| jquery | [5] |
4,246,833 | 4,246,834 | jQuery display value when dropdown menu is used | <p>I used to have a text input in place of the dropdown, where you would type in a number. However, I wanted something a little more logical, so I converted it to a dropdown. My jQuery code only works if I use a text-input, unfortunately.</p>
<p>How would I make it work in this situation?</p>
<p>Here's my code: <a href="http://slexy.org/view/s2rNXE3OcO" rel="nofollow">http://slexy.org/view/s2rNXE3OcO</a></p>
<p>One last thing - how would I fix the height of the dropdown menu to around 8 values and have a scrollbar for the rest of them?</p>
| jquery | [5] |
2,731,879 | 2,731,880 | Figuring out what Javascript object is this? | <p>I have some script that has the following code:</p>
<pre><code>var result = {
id: 'test',
name: 'test',
home: 'test',
ex_info: [{date: new Date('12-31-2010'), quantity: 976}],
status: ''
}
</code></pre>
<p>I am trying to insert information in the ex_info property. But I can't add anything. I try to hard to code the following:</p>
<pre><code>var result = {
id: 'test',
name: 'test',
home: 'test',
ex_info: [{date: new Date('03-31-2010'), quantity: 976}, {date: new Date('02-31-2010'), quantity: 543}],
status: ''
}
</code></pre>
<p>But it results in an error:</p>
<p><em>Update:</em></p>
<p>Error: Expected [ { date : Date(Fri Mar 31 2010 00:00:00 GMT-0500 (EST)), quantity : 976 }, { date : Date(Thu Mar 03 2011 00:00:00 GMT-0500 (EST)), quantity : 543 } ] to equal [ { date : Date(Fri Mar 31 2010 00:00:00 GMT-0500 (EST), quantity : 976 } ]</p>
| javascript | [3] |
5,744,332 | 5,744,333 | Arranging corresponding values in descending manner | <p>I have two sets of columns right now but I am not sure how do I program it and what set of class for me to use it. Both are in separate arrays. One for letters and the other for the numbers.</p>
<pre><code> a 12
b 9
c 156
</code></pre>
<p>So a corresponds to 12 and b corresponds to 9 etc etc. The list is actually a frequency of letters in a text file so I have 26 of them.
Both are not in the same array. As I have separate arrays for both of them. I want to try and arrange
and make them be in a descending manner.
So that the output would be:</p>
<pre><code> c 156
a 12
b 9
</code></pre>
<p>I'm still unsure about various capabilities of ArrayList or HashMap or Tree Map. So any help with this?</p>
| java | [1] |
4,662,306 | 4,662,307 | interface of the list in c++ | <p>I found some interface for the list:
and there I found this constructor</p>
<pre><code>template<typenameT>
...
list(size_tnum, constT& val = T());
...
</code></pre>
<p>can somebody explain what is this: <code>constT& val = T()</code></p>
<p>thanks in advance</p>
| c++ | [6] |
2,388,287 | 2,388,288 | Video not playing in Android Device | <p>I have used videoview for playing the video from the url.. while trying it out in emulator i got the error msg as "Sorry this video cannot be played". i though that the error occurs because i am trying to run in emulator.. but even after installing into Android device, am getting the same error msg...
Plz help me out with a solution to this problem...</p>
<p>My code is as follow</p>
<pre><code> VideoView vv;
vv = (VideoView) this.findViewById(R.id.VideoView);
MediaController mc = new MediaController(this);
mc.setAnchorView(vv);
Uri videoUri = Uri
.parse(d_playurl); //"http://people.sc.fsu.edu/~jburkardt/data/mp4/cavity_flow_movie.mp4"
vv.setMediaController(mc);
vv.setVideoURI(videoUri);
vv.requestFocus();
vv.start();
</code></pre>
<p>i could play the mp4 video even in the emulator, but wondering why not any other url could not be played even in device.</p>
<p>note: playurl is the url which i retrieve from a json feed and passing that url..</p>
| android | [4] |
5,793,518 | 5,793,519 | How can i set the position of text? | <p>i have a problem that i want to set the position of text as to from particular location. for example:
i have this text in my textview:
"abcd
efgh
ijkl
mnop
qrstu
vwxyz"
Now i want this text to show from location "efgh" rather than "abcd"
How can i perform this operation in textview. I want to change position of text and not the position of textview.
Thanks</p>
| android | [4] |
5,561,553 | 5,561,554 | When to use a Constructor and when to use getInstance() method (static factory methods)? | <ol>
<li><p>When and how should we use a Constructor </p>
<p>Foo bar = new Foo();</p></li>
<li><p>And When and how should we use getInstance() (static factory methods)</p>
<p>Foo bar = Foo.getInstance();</p></li>
</ol>
<p>What is the difference between these two, I always use the 1st way but when to use the 2nd way??</p>
<p><strong>UPDATE 1</strong></p>
<p>Say, I need to implement the class too and use .getInstance() from a different class.</p>
<p><strong>UPDATE 2</strong></p>
<p>What do you guys mean by overusing singleton?</p>
| java | [1] |
3,747,765 | 3,747,766 | taking data from a csv file, and putting it into an array | <pre><code>public class Earthquake
{
public double Magnitude { get; set; }
public string Location { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
public double depth { get; set; }
public DateTime date { get; set; }
public string EventID { get; set; }
public string URL { get; set; }
public Earthquake()
: this(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty)
{ }
public Earthquake(string magna, string locate, string lat, string longi, string dept, string dat, string Event, string website)
{
Magnitude = Convert.ToDouble(magna);
Location = locate;
Latitude = Convert.ToDouble(lat);
Longitude = Convert.ToDouble(longi);
depth = Convert.ToDouble(dept);
date = Convert.ToDateTime(dat);
EventID = Event;
URL = website;
}
}
public void GetData()
{
string[] text = File.ReadAllLines(@"Earthquakes.csv");
Earthquake[] data = new Earthquake[1];
foreach (string line in text)
{
string[] myColumns = line.Split(',');
Earthquake[] earth = new Earthquake[myColumns[0], myColumns[1], myColumns[2], myColumns[3], myColumns[4], myColumns[5], myColumns[6], myColumns[7]];
data[i] = earth[i];
i++;
}
}
</code></pre>
<p>Ignore commented parts I have those under control. The problem I am having is getting the data from the csv file into the Earthquake Array. I am getting syntax errors, and I know why, it's because the data type isn't correct, but I honestly cannot figure out how to fix it.
Also if you notice I am trying to use bubble sort and since there is no definition for "compare" for double, what do I use instead?</p>
| c# | [0] |
1,779,538 | 1,779,539 | Error While Debugging | <p>I have one web application. while i debug the solution the rendering makes too slow and if i close the browser page i got one error like this</p>
<p>WebDev.WebServer.exe has encountered a problem and needs to close. We are sorry for the inconvenience.</p>
<p>I got one information from attched proess is that this .exe file related to asp.net development server- port(port number).</p>
<p>How it can be resolved? please help me..</p>
| asp.net | [9] |
4,005,939 | 4,005,940 | What does this jQuery code with square brackets and a caret mean? | <p>What does this jQuery code mean?</p>
<pre><code>$('tr[id^="message"]')
</code></pre>
| jquery | [5] |
2,066,314 | 2,066,315 | How to work with libraries that don't support unicode characters | <p>In my case, I recently picked up the <a href="http://www.ambiera.com/irrklang/" rel="nofollow">irrKlang</a> library which allows me to work with audio files without doing too much work. Then I ran into the issue where unicode characters in filepaths were not supported by the library. It either reads it incorrectly (I would've thought even if it was read wrong, it could still find the file), or simply ignores it, leaving me with invalid file paths.</p>
<p>Searched their support forums for a solution to this, but all I got out of it was "unicode? uhhh why not just use ascii?" kind of attitude towards unicode, which I suppose is not uncommon.</p>
<p>What are some techniques that I could use to reliably pass unicode strings to libraries that don't have unicode support?</p>
| c# | [0] |
358,290 | 358,291 | Android ListView sorted by checked items | <p>I use a ListView with android.R.layout.simple_list_item_multiple_choice as list items. I want to sort the list (and maybe group the list) that checked items are on top of the list. I looked at the Comparator but it only lets me sort the list by the entries name of the list.
How could that be done in a nice way? </p>
| android | [4] |
1,883,097 | 1,883,098 | Python: What is the Formal Difference Between Print and Return? | <p>Lets say i define a simple function which will display an integer passed to it:</p>
<pre><code>def funct1(param1):
print(param1)
return(param1)
</code></pre>
<p>the output will be the same but and i know that when a return statement is used in a function the output can be used again. Otherwise the value of a print statement cannot be used. But I know this is not the formal definition can anyone provide me with a good defintion. thanks</p>
| python | [7] |
365,775 | 365,776 | Generating a Static Map Efficiently | <p>I'm writing a simple parser in C++ that works using a map of string 'triggers' to 'handler' function pointers, my question is what would be the most 'static' and efficient method of implementing generation and access to the map?</p>
<p>I first considered a method, e.g. <code>Parser::add_handler</code>, that would add the trigger/handler to the parser's map, but, as far as I know, this would need to be executed every time the program was ran whilst the data is known at compile time. (Although on the plus side, they would only need executed once, and not for each instantiated Parser.)</p>
<p>I then thought of using a virtual method, e.g. <code>Parser::get_handlers</code> in Parser that would be implemented in derived classes to return the handler map for that parser. This seems like a more nicely encapsulated solution although it would require a virtual function call for every created instance of the parser, with at least one call to the parser's map-generating function.</p>
<p>Using the latter approach seems preferable at the moment, but it still leaves the map to be generated dynamically on each execution, is there away to avoid this?</p>
| c++ | [6] |
924,743 | 924,744 | How to access my object inside onClick(View v) function? | <p>I have defined a model class:</p>
<pre><code>public class MyObject {
...
}
</code></pre>
<p>In my activity, I get this object from SERVICE layer. Everything works fine at this point, my only question is, in Activity, if I set <strong><em>setOnClickListener</em></strong> to a <strong><em>TextView</em></strong>, how can I access <strong>myObject</strong>? What I mean is showing in the following code:</p>
<pre><code>//my custom object
MyObject obj = SERVICE.getObject();
TextView tx = new TextView(this);
tx.setText("Click me");
tx.setOnClickListener(
new OnClickListener(){
@Override
public void onClick(View v){
//how to access obj here?
}
}
);
</code></pre>
<p>In the above code, I <strong>can not</strong> access <code>obj</code> inside <code>onClick(View v)</code> function, how to get rid of it to access <code>obj</code> inside <code>onClick(View v)</code> ?</p>
| android | [4] |
4,642,492 | 4,642,493 | KeyPress Event for textbox which is in gridview | <p>i have a gridview in that
'>
<%-- onkeypress="searchKeyPress(event);" --%>
</p>
<p>
</p>
<p>if i press enter key in this focus must go to second row same column's textbox.... </p>
<p>Hope u understand my question </p>
<p>Thank you </p>
| asp.net | [9] |
1,631,542 | 1,631,543 | jQuery live method: can't stop event from bubbling the DOM | <p>I'm not sure, but it seems like a bug.</p>
<p>Here are samples:</p>
<p><a href="http://jsfiddle.net/QNrZu/" rel="nofollow">http://jsfiddle.net/QNrZu/</a></p>
<p>Maybe i'm doing something wrong?
Any solution for this?</p>
<p>Thanks ;)</p>
| jquery | [5] |
4,844,097 | 4,844,098 | disk image can not be mounted | <p>i am using SDK 3.0 and iPhone 3.0 (upgraded from 2.2.1). when i try to install on my iPhone device, i got an error like "disk image can not be mounted " and also i am getting same error on organizer window of xcode.</p>
<p>i am not able to deploy my app developed using SDK 3.0 on iPhone</p>
| iphone | [8] |
983,826 | 983,827 | Generate controls at runtime | <p>How to generate controls at runtime and set there properties like height, width, Content..</p>
<p>and also their events, like Clicked event</p>
| c# | [0] |
2,981,611 | 2,981,612 | Why is my JavaScript if statement not working? | <p>The first <code>if</code> statement is not working although I passed the value of the block parameter as <code>physicalActivityBlock</code>:</p>
<pre><code>function obj(select,block,idName) {
var a=document.getElementById(select).value;
var b=document.getElementById(block);
var i=0;
b.innerHTML = '';
if(block=='physicalActivityBlock'){
b.appendChild('<p>hello</p>');
}
}
</code></pre>
| javascript | [3] |
3,275,157 | 3,275,158 | ; in cookie value trims cookie in asp.net | <p>I am saving a cookie using a value from a database and then accessing that cookie on another page. i noticed that if the cookie has a ; in it's value, it is cut off at that ;. How do I fix this other than changing the data so it does not include ;?</p>
| asp.net | [9] |
3,959,771 | 3,959,772 | c# opensource project to draw graphs or should I write that myself? | <p>In my trading software I need to draw graphics. I have huge array (about 20 000 000 items) of [x,y] (where x is time and y is price) and I need to display it on the graphic. I need ability to zoom interesting parts. Also I need ability to add custom labels to display trades and orders (or I can implement this myself). I'm looking for something simple and open. What can you recomend?</p>
<p>If I should write that from scratch then what techniques should I use?</p>
<p>If you can suggest brilliant library on another language (c++, java or whatever) that would be also fine.</p>
| c# | [0] |
5,520,568 | 5,520,569 | Write CSS from jQuery within a for loop | <p>My script needs to dynamically create a stylesheet in the section of the page (rather than put inline styles on each element, because I need to override these styles with media queries later on).</p>
<p><strong>The Code</strong></p>
<pre><code>for (var i=0; i<theElements.length; i++){
$(theElements[i]).not('.responsive-wrap').each(function(i, elem){
var theWidth = $(this).width();
var parentWidth = $(this).parent().width();
$(this).addClass('element' + [i]);
$("#dynamicStylesheet").text('.element' + [i] + ' {max-width: ' + theWidth + 'px;}');
});
}
</code></pre>
<p><strong>The main question is:</strong> </p>
<p>This completely overrides the text in the <code>#dynamicStylesheet</code> each run of the loop (so when I load the page there is only one rule for <code>.element22</code>). How can I make it ADD the text without overwriting?</p>
<p><strong>Sub-questions for bonus points:</strong> </p>
<ul>
<li><p>This works for the most-part, but ONLY when <code>[i]</code> is in square
brackets. Why is this?</p>
<p>Do I need the <code>for loop</code> here, or is <code>.each(function(){})</code> essentially
creating a <code>for loop</code> anyway? There's another <code>each</code> function below this one inside the <code>for loop</code> that I haven't posted to keep it succinct.</p></li>
</ul>
| jquery | [5] |
4,050,106 | 4,050,107 | Why Java programs? | <p>I've had little exp. with java and since now i've worked with c++. what makes this one more special and preferred?</p>
<p>Moreover I would like to know about the use of System.in classes and parseInt classes.</p>
| java | [1] |
5,619,876 | 5,619,877 | Recursive function looping through obj props not working | <p>why does this only alert 1 ?</p>
<pre><code>function test() {
var myobj = {
a : '1st level prop',
b : 'findme',
c : {
aa : '2nd level prop',
bb : 'findme',
cc : {
aaa : '3rd level prop',
bbb : 'findme'
}
}
}
function countem(needle,haystack) {
var count = count || 0;
for(var i in haystack) {
if (typeof(haystack[i]) == 'object') {
countem(needle,haystack[i]);
} else {
if (needle == haystack[i]) {
count++;
}
}
}
return count;
}
alert(countem('findme',myobj));
}
</code></pre>
| javascript | [3] |
1,160,694 | 1,160,695 | simple PHP integer conversion | <p>convert this: $300
to this : 300</p>
<ul>
<li>can't do it with intval() or (int)
typecasting</li>
<li>if the non-numerical character is
suffixed (300$), both works and
returns 300</li>
<li>if it is prefixed it returns 0</li>
<li>the non-numerical character can be anything other than the "$"(i.e. "askldjflksdjflsd")</li>
</ul>
<p>Please help</p>
<p><strong>EDIT</strong> : list items are not requirements, they are a list of activities and observations I have made. Sorry:(</p>
| php | [2] |
5,093,728 | 5,093,729 | can subclass of another subclass inherit method from base class in c# | <p>Say Class A is the base class and then you have class B subclass of A (class B : A). Then you have class C : B. </p>
<p>Question is if you have a method in class A, can class C use that method?</p>
| c# | [0] |
4,039,950 | 4,039,951 | ASP.NET Profile Properties and Complex Types | <p>I require to store Users checkbox selection so the checkboxes are disabled/enabled when User logs back in. Please note that number of checkboxes displayed is dynamic.</p>
<p>Following is what I used in my web.config.</p>
<pre><code><add name ="checkBoxListTest" type="System.Collections.Specialized.StringDictionary" serializeAs="Xml" />
</code></pre>
<p>However when I used </p>
<pre><code>public StringDictionary TestCheckBoxValues
{
get { return Profile.GetPropertyValue("checkBoxListTest") as StringDictionary; }
}
if (TestCheckBoxValues != null)
var x = TestCheckBoxValues;
</code></pre>
<p>I get the following error</p>
<p><strong>To be XML serializable, types which inherit from IEnumerable must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy. System.Collections.Specialized.StringDictionary does not implement Add(System.Object).</strong></p>
<p>Can anyone explain whats going on?</p>
<p>Also I decided to use a List
where UserDefinedClass would be serializable key/value pair. However how do I get that in the web.config, for example</p>
<pre><code><add name="checkBoxListTest2" type ="List<UserDefinedClass>"/>
</code></pre>
<p>would htmlencoding the '<' and '>' characters work?</p>
<p>Another solution would be to create a subclass that would inherit from List to hide the '<' and '>' characters.</p>
<p>Would this be the best solution?</p>
<p>Thanks for you help.</p>
| c# | [0] |
5,360,367 | 5,360,368 | Netbeans IDE Project Deployment | <p>I am unable to deploy an existing project into Netbeans IDE. Could someone guide me?
Thanks in advance</p>
| java | [1] |
5,004,151 | 5,004,152 | How to send AT command in android? | <p>I want to send At command throug my application to modem. Can some one please let me know how to send AT command thr my application?</p>
<p>Do we need Phone object to send AT command?</p>
<p>The <code>ATResponseParser</code> class parses part of the AT command syntax used to communicate with the mobile radio hardware in a mobile handset. This is, in fact, a command syntax very much like the AT command syntax used by modems, a standard described in the 3GPP document number TS 27.007 and related specifications.</p>
<p>I want to send below AT command to Mode.
6.5 <code>Hangup call +CHUP</code></p>
<p>Table 13a: +CHUP action command syntax</p>
<p>Command</p>
<p>Possible response(s)</p>
<pre><code>+CHUP
+CHUP=?
</code></pre>
<p>Please help me.</p>
| android | [4] |
5,978,607 | 5,978,608 | anonymous types and generics | <p>I cannot find a way to pass an anonymous type to a generic class as a type parameter.</p>
<p>// this is the class I want to instantiate</p>
<pre><code>public class ExtArrayStore<T> : IViewComponent
{
public IQueryable<T> Data { get; set; }
</code></pre>
<p>...
// the creator class</p>
<pre><code>public static class ArrayStoreGenerator
{
public static ExtArrayStore<T> CreateInstance<T>(IQueryable<T> query)
{
return new ExtArrayStore<T>();
}
}
</code></pre>
<p>// trying to use this</p>
<pre><code>IQueryable usersQuery= ((from k in bo.usersselect new { userid = k.userid, k.username}).AsQueryable());
var x = ArrayStoreGenerator.CreateInstance(usersQuery);
</code></pre>
<p>I am getting;</p>
<p>The type arguments for method <em>ArrayStoreGenerator.CreateInstance(System.Linq.IQueryable)' cannot be inferred from the usage. Try specifying the type arguments explicitly</em></p>
<p>Is there a way to achieve this? ( I am thinking of Interfaces and returning an interface, but not sure if it would work) can any one help with passing anon types to generics.</p>
| c# | [0] |
4,222,956 | 4,222,957 | Java - implementation instances inside an interface | <p>In my project I need to create objects for each kind of Java Math Operator like "Add", "Substraction", "Multiplication", etc. And these operators should be singletons. </p>
<p>So here is what I am going to do. I define the Math Operator as an interface and I put those implementations inside it as I don't want to define singleton classes for each operator.</p>
<pre><code>public interface MathOperator {
double operate(double a, double b);
MathOperator ADD = new MathOperator(){
@Override
public double operate(double a, double b) {
return a + b;
}
};
MathOperator SUBSTRACT = new MathOperator(){
@Override
public double operate(double a, double b) {
return a - b;
}
};
}
</code></pre>
<p>I don't see much of such usage when I Google this. So I wonder if this is a good practice and if there are better and more graceful approaches?</p>
| java | [1] |
1,621,113 | 1,621,114 | how to use JS to dynamically update innerHTML | <p>I have a drop down box, each option in it has 2 values. I want to dynamically update value in my HTML based on the selection. The value that has to be shown is derived from drop down box values. Here is my code, but nothing seems to be happening here. </p>
<pre><code><html>
<head><title></title>
<script type="text/javascript">
var a = new Array();
a[1] = "kgs";
a[2] = "gms";
a[3] = "ltrs";
a[4] = "ml";
a[5] = "nos";
window.onload = function() {
function updateunit(){
var b = document.getElementById("itemname");
var b1 = b.options[b.selectedIndex].value;
var c = b1.split(',');
var d = c[1];
var e = a[d];
alert(document.write(a[1]));
document.getElementById('pane2').innerHTML = b1 ;
}
updateunit()
document.getElementById('itemname').onchange = updateunit ;
}
</script></head>
<body>
<form action='production.php' method="POST">
Item Name <select name ="itemname" id = "itemname">
<option value = '1,5' > A </option>
<option value = '2,5' > B </option>
<option value = '3,5' > C </option>
<option value = '4,5' > D </option>
</select> <br>
Amount <input type="text" name="amount"> <span id = "pane2"></span> <br>
</form>
</body>
</html>
</code></pre>
| javascript | [3] |
890,629 | 890,630 | Swapping the contents od div (with more than 3 div) | <p>I have an RSS reader application in j query, with 8 div section and 8 categories.On selecting a particular category inside a div,the div with that category should automatically get replaced by the contents in the first div.</p>
<p>I need a demo for swapping the contents on div (with more than 3 div).</p>
| jquery | [5] |
2,116,502 | 2,116,503 | Getting a reference to data collected by a Service from an Activity for visualization purposes | <p>Hello fellow developers,</p>
<p>I am trying to achieve something in Android and I would like some advise on the best practice.</p>
<p>I have created an Activity which can start and stop a Service which collects data.</p>
<p>Instead of simply starting and stopping the Service, the Activity should also display the data collected by the Service.</p>
<p>Here in lies the problem. The data could be quite large so I would like to avoid Serializing and sending it via an Intent. Is it possible to simply get a reference to the data stored in the Service from the Activity?</p>
<p><strong>Simple Example</strong></p>
<p>1) Activity starts</p>
<p>2) Activity starts Service to collect data</p>
<p>3) Activity exists</p>
<p>4) 24 hours pass</p>
<p>5) Activity starts</p>
<p>6) Activity wants to display data collected by Service, but data is quite large.</p>
<p>My question again is simply this. Can the Activity get a reference to the data stored in Service or does the data have to be Serialized and sent from the Service to the Activity using an Intent?</p>
<p>Kind regards,
Cathal</p>
| android | [4] |
1,022,347 | 1,022,348 | ASP.NET: Why does it take forever to load a page after compiling? | <p>Why does it take forever for ASP.NET to process a request the first time you try to access the site after compiling?</p>
<p>Maybe it's just me but the first time I visit a page after I've compiled my project, it takes about 20 seconds before I receive a response. Why is this?</p>
| asp.net | [9] |
1,255,835 | 1,255,836 | event when sim is changed | <p>how to access event when sim is changed in mobile.</p>
| android | [4] |
2,896,880 | 2,896,881 | Android - how to add two text fields to dialog | <p>I am trying to add to text fields to dialog, but it doesn't seem to be working... Here is my code. Can anybody fix my code or give me some guidance ao the about how to add two text fields to the dialog?</p>
<p>Thanks.</p>
<pre><code> final EditText input1 = new EditText(this);
input1.setText("note");
input1.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
input1.setText("");
}
});
final EditText input2 = new EditText(this);
input2.setMinLines(1);
input2.setText("0.0");
input2.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
input2.setText("");
}
});
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(1);
layout.addView(input1);
layout.addView(input2);
return new AlertDialog.Builder(this).
// code for showing Ok and Cancel button
.setView(layout).create();
</code></pre>
| android | [4] |
1,155,374 | 1,155,375 | TypeError: 'undefined' is not an object (evaluating '$.browser.msie') | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/14505301/jquery-latest-browser">jQuery latest $.browser</a> </p>
</blockquote>
<p>There was an error with jQuery 1.9 and $.browser; It returns 'undefined' for any $.browser; function. What i did wrong?</p>
<blockquote>
<p>TypeError: 'undefined' is not an object (evaluating '$.browser.msie')</p>
</blockquote>
<p>I use following code:</p>
<pre><code>setTimeout(function(){if($.browser.msie){$('.ovy').animate({top:"0"},ct);
</code></pre>
<p>Thank's for any help!</p>
| jquery | [5] |
5,704,426 | 5,704,427 | JMagick compression like MS-Paint | <p>I'm using JMagick to scale images to a smaller dimension like (400x400). But the resultant image size is around 200 KB which is big while loading images on the web as it takes time to load the page. So, I would like to reduce the size of the scaled images by setting some compression. I have tried setting compressionType by </p>
<pre><code>MagickImage scaledImage = image.scaleImage(400, 400);
image.setCompression(CompressionType.JPEGCompression);
</code></pre>
<p>Where image is an object of MagickImage of the source image. </p>
<p>But it doesn't seem to reduce the size of the scaled image. I have tried setting the quality using <code>imageInfo.setQuality(75)</code> but no luck.</p>
<p>Ideally, I would like to have it like MS-Paint does. MS-Paint seemed to reduce the size if you re-save it to around 30 KB. Can any one please help me if it is possible scale image using jmagick with compression like MS-Paint.</p>
| java | [1] |
4,283,439 | 4,283,440 | Process with() statement after if() condition in one line | <p>This line doesn't make much sense, but I wonder why it raises a syntax error:</p>
<p><code>x = 1; if x: with open("x.txt") as f: f.write(x)</code></p>
<p>How can I execute <code>with</code> block after <code>if</code> statement in one line?</p>
| python | [7] |
1,820,960 | 1,820,961 | How to define jQuery scroll settings? | <p>My problem is extremely simple: I have to modify a jQuery <code>scrollTo</code> call on existing code in order to execute a callback function after the scroll has completed (some hundreds of milliseconds).</p>
<p>I found <a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html" rel="nofollow">this article</a> that explains the scrollTo method. But I don't know how to pass settings too!
I already have a function to call, so how do I call it after scroll has completed?</p>
| jquery | [5] |
109,868 | 109,869 | php - why won't my data show up in firefox | <p>I'm using the following code in an index.php page to display content from one page on another domain. However, it works fine in IE, but when I load the page in Firefox, its missing php data.</p>
<p>Am I doing something wrong or does firefox not allow this? Any help appreciated.</p>
<pre><code>$domain = $_SERVER['HTTP_HOST'];
$crawl = "http://www.mysite.co.uk/page.php?domain=$domain";
$fd = fopen($crawl, "r");
while($buf = fgets($fd,1024))
{
echo $buf;
}
fclose($fd);
</code></pre>
<p>PLEASE NOTE: if I load the target url directly it works just fine</p>
| php | [2] |
5,352,986 | 5,352,987 | How to read the mp3 files in a given folder? | <p>how to read the mp3 files and display those file names using c++ can anyone provide me code for this in C++?</p>
| c++ | [6] |
2,692,355 | 2,692,356 | Hardware acceleration for sdk 11, benefits earlier versions? | <p>I know there's hardware acceleration support in android sdk 11 for Canvas. If we build against 11, but target earlier sdk versions, will we get any of that support?:</p>
<pre><code><uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="11" />
</code></pre>
<p>I watched the google io presentation on this subject, but am not really sure how our Canvas calls are being accelerated. For example, if we're drawing a bunch of lines and circles on a Canvas, are we going to see any performance improvement?:</p>
<pre><code>canvas.drawLine(..);
canvas.drawLine(..);
canvas.drawCircle(..);
canvas.drawCircle(..);
...
</code></pre>
<p>Thanks</p>
| android | [4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.