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 |
|---|---|---|---|---|---|
4,121,310 | 4,121,311 | Android: redirect audio to file? | <p>My Android application relies on a closed-source Text-To-Speech API.
When I invoke .speak(String s) method it coverts supplied text to sound and plays it back.
However, I also want to be able to save that sound to an .mp3 file for later playback.</p>
<p>So, is it somehow possible to redirect an AudioStream to a file?</p>
| android | [4] |
5,358,136 | 5,358,137 | What's the android AccountManager used for? | <p>I need some help understanding what the account manager offers us. I have a web service which requires a token for use. For example, if a developer wants to use my api, they would use a url like:</p>
<pre><code>http://myservice.com/addfriend?name=john&token=abc
</code></pre>
<p>The token "abc" is retrieved by the developer using oauth. So now any developer that releases an app which uses my API will have to get their users to go through the oauth flow to get their own token for their app.</p>
<p>Does the android account manager solve any of this? Can developers query the account manager to see if the user has already auth'd in the past, and reuse whatever token is in that central location? I don't see how this would work, take Facebook as an example. They've created their own single-sign-on module. And they probably want to give each third party app that uses them a different token for tracking. And each third party app requests a different set of permissions. I don't know that the android account manager supports any of that.</p>
<p>So I'm curious why facebook would create their own sso support instead of using AccountManager to handle this. Also not sure if I have use cases for AccountManager correct here, maybe it has a totally different use case.</p>
<p>Thank you</p>
| android | [4] |
286,401 | 286,402 | How to generate unique ID in clustering | <p>Is there any clustering API that helps in generating the unique ID across many servers?</p>
| java | [1] |
2,457,510 | 2,457,511 | Change event function parameters with JQuery | <p>I have an image map that contains certain "Areas" that contain onmouseover events. Most of these events fire a function which passes in some coordinates.
I want to be able to manipulate the coords in the function SFX_ShowIconOver.</p>
<p>The Image Map is created by a third party app so I can only manipulate rendered content.</p>
<pre><code><AREA onmouseover="SFX_ShowIconOver('Chart2','29456',368,10,22,22,false,this)" title="Legend Box" onclick="SFX_SendCommand('29456',false)" shape=rect coords=368,10,390,32>
</code></pre>
| jquery | [5] |
458,436 | 458,437 | Can't hook form submit event | <p>I'm trying to use jQuery to submit a form so the page doesn't need to be reloaded I cant get it to hook onto the form though.</p>
<pre><code><form action="index.php" method="get" id="frmFilter">
</code></pre>
<p>and</p>
<pre><code>$("#frmFilter").submit( function () {
alert('t');
return false;
});
</code></pre>
<p>It just won't work though; when I use the submit button on the form it submits instead of showing an alert.</p>
<p>The form is actually loaded using jQuery's <code>.load</code> event and I have tried to put the above code on the page with the form as well as the page that loads the form and both wouldn't work.</p>
<p>Any idea what I'm doing wrong?</p>
<p>Tested using both IE8 and Chrome 3.</p>
| jquery | [5] |
4,472,220 | 4,472,221 | managing wimax in android | <p>You can manage wifi connectivity, and you can kind of manage 3G, but what about 4G, more specifically WiMAX? I saw an API on ClearWire's website, but I am not sure if Google is planning to include WiMAX as part of the SDK. Does anyone have an insight? I am looking for connect/disconnect functionality, failover connection settings, etc. Thanks!</p>
| android | [4] |
1,396,363 | 1,396,364 | Android: When to use Dialog vs. Activity | <p>When is it preferable to use a Dialog box as opposed to an Activity in Android? From my understanding, anything you can do with a Dialog box you can also accomplish with an Activity. Are there any tasks that can only be accomplished by an Activity or a Dialog?</p>
| android | [4] |
886,019 | 886,020 | How to draw mathematic pattern in php? | <p>I want to draw a pattern like this.</p>
<pre><code>1
2 3
3 5 8
5 8 13 21
8 13 21 34 55
</code></pre>
<p>Can somebody help me?
like in php code for this pattern is</p>
<pre><code>1
12
123
1234
12345
</code></pre>
<p>is</p>
<pre><code><?php
for($i=1;$i<=5;$i++) {
for($j=1;$j<=$i;$j++) {
echo $j;
}
echo "</br>";
}
?>
</code></pre>
| php | [2] |
4,717,821 | 4,717,822 | reload (update) a .py file in the interpreter | <p>I'm new to python (and to programming in general) and here I have a newbie question:</p>
<p>let's say I have this python script "script.py" and I load it in the interpreter by typing</p>
<pre><code>import script
</code></pre>
<p>and then I execute my function by typing:</p>
<pre><code>script.testFunction(testArgument)
</code></pre>
<p>OK so far so good, but when I change "script.py", if I try to import again the script doesn't update. I have to exit from the interpreter, restart the interpreter, and then import the new version of the script for it to work.</p>
<p>What should I do instead?</p>
<p>Thanks in advance.</p>
| python | [7] |
3,876,360 | 3,876,361 | Error; Variable Referenced Before Assignment | <p>I'm getting an <code>Error; Variable Referenced Before Assignment</code> for myhp.
At the starting of my .py file, I have "myhp = 20" though.</p>
<p>What do I do to get this working?</p>
<pre><code>def fightmode(name, hp, dmg, gold):
print '\n\n\nYou are in a fight with %s' %name
print '%s has %sHP' %(name, hp)
while myhp > 0 and hp > 0:
print '\n\t1. Attack \n\t2. Guard \n\t3. Run away.'
opt1= ''
allowed = ["1", "2", "3"]
while opt1 not in allowed:
opt1 = raw_input("\nWhat will you do? ")
if opt1 == "1":
hp = hp - mydmg
print "You have inflicted %d damage on %s. %s's HP is %s" %(mydmg, name, name, hp)
if opt1 == "2":
myhp = myhp+5
print "You are now guarding yourself. Your HP is now %d" %myhp
</code></pre>
| python | [7] |
3,585,283 | 3,585,284 | java chain exception | <p>hi all
i have question regarding chain exception</p>
<pre><code>try{ } catch(Exception e) { throw new SomeException(); }
</code></pre>
<p>if i do like this
my eclipse will prompt error at line throw new SomeException();
stating "unhandled exception"
and i must put something like </p>
<pre><code>try{ } catch(Exception e) {
try{ throw new SomeException(); } catch(Exception e){}
}
</code></pre>
<p>why must do like this
because tutorial that i read .example <a href="http://java.sys-con.com/node/36579" rel="nofollow">http://java.sys-con.com/node/36579</a> , does not have to do this</p>
| java | [1] |
4,145,183 | 4,145,184 | How can i redirect a clickable item in list view to some other activity? | <p>I want to link my items present in list view to some other activity, so that i can move to some other activity on clicking a list view item.</p>
| android | [4] |
1,743,792 | 1,743,793 | Show() not working in jQuery? | <pre><code><script type="text/javascript">
//Code added by Nitesh for RFE 670082 starts here
jQuery("input[name='hideLineItemColumns_quote']").click(function () {
alert(jQuery(this).attr('checked'));
if(jQuery(this).attr('checked')){
var columnName = $.trim($(this).val()).replace('\u00a0','');
$('thead.line-item-grid-header tr th').filter(function ()
{
if($.trim($('div', this).text()).replace(' ','') == columnName){
indexValue = $(this).index();
//Hiding body columns
jQuery('.line-item-grid-body').children('tr').each(function(){
jQuery(this).children('td:eq('+indexValue+')').hide();
});
//Hiding footer columns
jQuery('.line-item-grid-footer').children('tr').each(function(){
jQuery(this).children('th:eq('+indexValue+')').hide();
});
return true;
};
}).hide();
}
else{
var columnName = $.trim($(this).text()).replace('\u00a0','');
$('thead.line-item-grid-header tr th').filter(function ()
{
if($.trim($('div', this).text()).replace(' ','') == columnName){
indexValue = $(this).index();
//Showing body columns
jQuery('.line-item-grid-body').children('tr').each(function(){
jQuery(this).children('td:eq('+indexValue+')').show();
});
//Showing footer columns
jQuery('.line-item-grid-footer').children('tr').each(function(){
jQuery(this).children('th:eq('+indexValue+')').show();
});
return true;
};
}).show();
}
});
</code></pre>
| jquery | [5] |
1,899,873 | 1,899,874 | Using JSON data in a javascript function | <p>I am returing JSON data as a response in a web service I am writing.</p>
<p>I am wondering what is the best way to consume the data, returned to a Javascript function (passed as an argument).</p>
<p>Do I:</p>
<ol>
<li>use eval()</li>
<li>use Doug Crawfords jSon parser to parse the JSON data into a Javascript object </li>
<li>simply use the returned data as an object literal</li>
</ol>
<p>BTW, I am still learning Javascript, (just started reading the Definitive Guide 2 days ago) so if my question seems a bit naive or asinine - bear with me.</p>
| javascript | [3] |
555,418 | 555,419 | list union with duplicates | <p>I need to unite two lists in Python3,where duplicates can exist,and for one set of these the resulting list will contain as many as max in both lists.An example might clarify it:</p>
<pre><code>[1,2,2,5]( some operator)[2,5,5,5,9]=[1,2,2,5,5,5,9]
</code></pre>
<p>Ideas?</p>
| python | [7] |
3,267,129 | 3,267,130 | Facebook Error after xcode upgrade | <p>I have been using xcode 4.1 till yesterday and my facebook integration using FBConnect was also working fine . But when i update my xcode to xcode 4.2 , i am getting error on facebook after successful login like "This endpoint has been deprecated. To temporarily reenable it, you may disable the "august_2012" platform migration.</p>
<p>need to fix this issue. </p>
<p>Plz help</p>
<p>Thanks</p>
| iphone | [8] |
470,398 | 470,399 | How do I do implement 'time ago' using the ISO1806 datetime format? | <p>I have go about getting the 'time ago' using the a date time using javascript.</p>
| javascript | [3] |
2,031,211 | 2,031,212 | Converting .py extension to executable file | <p>Suppose i have a main.py for a calculator application. I used different .py files for different function like(add.py for adding, mul.py for multiplication) and all these files are imported in main.py. When I click main.py it executes successfully and do all function like adding, mul, etc. What i want to do is to make a executable file for main.py so that i can run it in the computer that doesnot have a python installed or any of that module(add.py,..) exist in the hard drive. Is that possible??
THANKS FOR THE HELP</p>
<p>Finally I got the solution. PyInstaller works well in my case and it is easy to use too. Thank you for your help. (:</p>
| python | [7] |
3,389,429 | 3,389,430 | How can I combine counting rows in an IDictionary with merging rows? | <p>I have the following class that checks for errors:</p>
<pre><code> public bool ValidateAccountDeletion(Account account)
{
var _errors = new Dictionary<string, string>();
var accounts = _accountRepository.GetPk(account.PartitionKey);
if (_productRepository.GetPk("0000" + account.RowKey).Count() != 0)
_errors.Add("", "Account contains products");
return _errors;
}
</code></pre>
<p>and the following extension class to merge my IDictionary and the ModelStateDictionary</p>
<pre><code>public static class ModelExtensions {
public static bool HasValue(this string value) {
return !string.IsNullOrEmpty(value) && value.Trim().Length > 0;
}
public static void Merge(this ModelStateDictionary modelState, IDictionary<string, string> dictionary) {
Guard.AgainstNullParameter(modelState, "modelState");
Guard.AgainstNullParameter(dictionary, "dictionary");
foreach(var item in dictionary) {
modelState.AddModelError(item.Key, item.Value);
}
}
</code></pre>
<p>When I call the validate and the then try to merge it doesn't look clean:</p>
<pre><code> var errors = _accountService.ValidateAccount(vm.Account);
if (errors.Count > 0)
this.ModelState.Merge(errors)
</code></pre>
<p>Is there some way that I could maybe have a different constructor to merge and then just feed in the output
of:</p>
<pre><code> _accountService.ValidateAccount(vm.Account);
</code></pre>
<p>I am trying to think of how I could do this but can't think of a simple way</p>
| c# | [0] |
4,119,430 | 4,119,431 | Serialization and archiving object | <p>I need to do the same operation but in one stream. May you help me, please?</p>
<pre><code>public static byte[] archivingAndSerialization(Object object){
ByteArrayOutputStream serializationByteArray = new ByteArrayOutputStream();
ByteArrayOutputStream archvingByteArray = new ByteArrayOutputStream();
try {
ObjectOutputStream byteStream = new ObjectOutputStream(serializationByteArray);
byteStream.writeObject(object);
ZipOutputStream out = new ZipOutputStream(archvingByteArray);
out.putNextEntry(new ZipEntry("str"));
out.write(serializationByteArray.toByteArray());
out.flush();
out.close();
} catch (IOException e) {
logger.error("Error while IOException!", e);
}
return archvingByteArray.toByteArray();
}
</code></pre>
| java | [1] |
5,233,978 | 5,233,979 | Android - query if a sync account is checked for syncing | <p>How can I query if a sync account is checked for syncing or not?</p>
| android | [4] |
846,823 | 846,824 | Compare two static arrays | <p>I have an issue how to implement to compare two static arrays, ie.</p>
<pre><code>string bufferNames[]={"apple","orange","banana","pomegranate","pear"};
string bufferPictures[] = {"apple.bmp","orange.bmp","banana.bmp","pomegranate.bmp","pear.bmp"};
</code></pre>
<p>Each item in the bufferNames presents the choice that to someone has been given, when the picture from the bufferPictures has been loaded onto the screen. So, if I for example get orange.bmp using rand() function that iterates through that list, how can I get the same one corresponding element orange and two other random not correct elements. Any help would be appreciated. </p>
<p>Thanks in advance.</p>
<p>P.S. If further breaking in of the problem is needed, just say it so.</p>
| c++ | [6] |
4,463,315 | 4,463,316 | How to clear a <label>'s text | <p>Trying to figure out how to clear my label's text...clear it out. So far no luck:</p>
<pre><code>$("label[id*=\"singleModelText\"]").text().empty();
</code></pre>
| jquery | [5] |
2,926,938 | 2,926,939 | A -> B, B -> A classes association | <p>This code doesn't do anything special. It's just a snippet to show the problem with forward declarations. Just a short question: why doesn't it work and how to force it to work?</p>
<pre><code>class A;
class B {
A obj;
public:
int getB() const {
return 0;
}
void doSmth() {
int a = obj.getA();
}
};
class A {
B obj;
public:
int getA() const {
return 1;
}
void doSomething() {
int b = obj.getB();
}
};
</code></pre>
<p>This code gives me errors:</p>
<pre><code>error C2079: 'B::obj' uses undefined class 'A'
error C2228: left of '.getA' must have class/struct/union
</code></pre>
| c++ | [6] |
4,793,074 | 4,793,075 | Arranging words within a given string alphabetically | <p>i'm just trying to write a code for arranging the words within a string alphabetically..
But whenever i am running this it' entering in an infinite loop.. i cant figure out what is exactly happening..can anybody help me out plzzz.. below i've attached my code.</p>
<pre><code>public class AscendString {
String s=new String();
public AscendString(String x)
{
s=x.trim();
}
public int NoWords()
{
int i=0;
String s1=new String();
s1=s;
while(s1.length() > 0)
{ i++;
int j=s1.indexOf(' ');
if(j>0)
{
s1.substring(j+1);
s1=s1.trim();
}
else
s1="";
}
return i;
}
public void Ascend()
{
String str[]=new String[NoWords()];
String s1=new String();
s1=s;
int i=0;
while(s1.length() > 0)
{
int j=s1.indexOf(' ');
if(j>0)
{
str[i]=s1.substring(0,j) ;
s1=s1.substring(j+1);
s1=s1.trim();
i++;
}
else
{
str[i]=s1;
s1="";
}
}
for(int j=0;j < str.length-1;j++)
{
for(int k=0;k < str.length-1-j;k++)
if(str[k].length() > str[k+1].length())
{String temp=str[k];
str[k]=str[k+1];
str[k+1]=temp;
}
}
String str1="";
for(int n=0;n < str.length;n++)
str1=str1+str[n] +" " ;
System.out.println("The String in Alphabetic Order is: "+str1);
}
public static void main(String args[])
{
AscendString exmpl=new AscendString("I Love Java Programming");
exmpl.Ascend();
}
}
</code></pre>
| java | [1] |
2,209,117 | 2,209,118 | android: am pm format of alarm | <p>I am using the alarmmanger class set method for setting the alarm. i
takes the input from user through timepicker dialog for setting the
alarm.alarm work fine when i set specific hour and minutes but
application is not following the am/pm logic. mean if i set the alarm
10:31 am while in system time is 10:30 pm then alarm invoke at 10:31 pm not at 10:30 am.anyone tell me whats the reason?</p>
<pre><code>Calendar time = Calendar.getInstance();
time.set(Calendar.HOUR, hourOfDay);
time.set(Calendar.MINUTE, minute);
time.set(Calendar.SECOND, 5);
//time.set(Calendar.AM_PM);
AlarmManager alarmMgr = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(this, AlarmReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
alarmMgr.set(AlarmManager.RTC_WAKEUP,time.getTimeInMillis(), pendingIntent);
</code></pre>
| android | [4] |
579,392 | 579,393 | PHP switch function doesn't recognize "less than 0" | <pre><code>$bytes = 0;
switch($bytes){
case $bytes == 0:
echo 'Equal to 0.';
break;
case $bytes < 0:
echo 'Less than 0.';
break;
}
</code></pre>
<p>This outputs "Less than 0."</p>
<p>Why?</p>
| php | [2] |
5,749,125 | 5,749,126 | Contains certain text but does not contain certain img, apply a css style to that | <p>How can i express the following in jquery?</p>
<p>Apply a yellow background to every td on a table that contains "$" but does NOT contain img src="images/plus.gif"</p>
<p>I could do it just for the contain part using:</p>
<pre><code>$("#SubscribersManageList tr:contains('$')").css("background", "yellow");
</code></pre>
<p>But its not what i want, what i want is to select those tr that CONTAIN "$" but DONT contain the image src="images/plus.gif", and then apply yellow background to those tr.</p>
<p>Anyone?</p>
| jquery | [5] |
2,502,578 | 2,502,579 | Two different Selects with the same option, then animate overflowed div or error message | <p>EDIT: Oh well, now im managing to make it work properly. But I need the error message to .hide if the user select the proper option after having the error message.</p>
<p>Here is the html/jquery im working on</p>
<pre><code> <form>
<select>
<option>Please Select Your Value</option>
<option>Pick this value 1</option>
</select>
<div class="error">Please select your value</div>
<select>
<option>Please Select Your Value</option>
<option>Pick this value 2</option>
</select>
<div class="error">Please select your value</div>
<input type="submit" value="Show Hidden Div" />
</form>
<div class="suprise">
Hidden Div
</div>
</code></pre>
<p>And the jQuery</p>
<pre><code>$('.submit').click(function(){
var correct = true;
$('select').each(function(){
if($(this).val() != 'option2value'){
//next is the error... it might be better to use an id there
$(this).next().show();
correct = false;
}
})
if(correct){
$(".results").animate({
marginTop: -480}, 400);
}
})
</code></pre>
<p>I just need a little help around here, how to make the proper trigger... Im not sure how to do it thou.</p>
<p>Thanks guys!</p>
| jquery | [5] |
501,399 | 501,400 | Clearing an array which is global context | <pre><code>var obj = {
obj.arr1 = [],
obj.arr2 = []
};
</code></pre>
<p>I have this object in the global context, now each time when i add a new user the <code>obj1.arr[]</code> is used for some manipulation. Now when i add another user, the value obj.arr1[] holds the previous data. </p>
<p>I tried using <code>obj.arr1=[];</code> but this does not work. I feel my object is in global context, how can i clear it. </p>
| javascript | [3] |
1,924,108 | 1,924,109 | GPS Code not working in iPhone os 3.1 | <p>I am Using the following code to get the user current location in iPhone o 3.1
but the application get crash.Did the code change in 3.1?</p>
<pre><code>CLLocationManager *locmanager =[[CLLocationManager alloc] init];
[locmanager setDelegate:self];
[locmanager setDesiredAccuracy:kCLLocationAccuracyBest];
[locmanager startUpdatingLocation];
</code></pre>
| iphone | [8] |
2,675,789 | 2,675,790 | Writing Files to App Directory - NOT SDCARD | <p>Okay, so im having a bit of trouble here. Ive done some Googling but really havent gotten a clear answer.<br>
<br>
You see, I have a file (with no extension) in my "raw" folder in my project. This file is needed for my apps to write a couple of settings and notes. Id prefer to use something like this just to be extra safe.<br>
<br>
The problem is, there is no guide that tells me how to write to my own files. There is a good amount of guides on how to write files to the SDCard but I dont like that because if a user has problems with the SDcard, it could affect my app. <br>
<br>
Also, one thing about writing to the SDcard is making the file "MODE_WORLD_READABLE" since if anything hits the SDCard, anyone can read it. This is something I do not want to happen. On top of that, if the user mounts the USB by using USB mass storage or removes/changes the SDcard, the file is lost.<br>
<br>
How could i go on from making my app read/write on its own directory?<br>
<br>
Thanks!</p>
| android | [4] |
710,070 | 710,071 | I'm looking to make a custom volume monitor | <p>I'm looking to make a simple volume manager app. I know it has been done before but I am just looking to make one to see what its like and to get more familiar with the code and doing certain things with it.</p>
<p>I'm hoping that it could include an if statement where if the volume drops below zero it makes a "Toast" notification saying something along the lines of "You have dropped below zero"</p>
<p>As much as it sounds like I am asking for someone to do this for me I am just asking for a basic idea / framework to work with.</p>
<p>-Thanks for the help!</p>
| android | [4] |
862,614 | 862,615 | Remove value from array based on value? | <p>I have a PHP array with a parent called "items." In that array, I want to remove all values that do not contain a string (which I'm gonna use regex to find). How would I do this?</p>
| php | [2] |
5,252,043 | 5,252,044 | uninstall a software programatically in java | <p>I want to know if there is a way to uninstall a software programatically using java. <br/>
Suppose if I have Firefox installed on my windows machine then how could I use java program to uninstall it.</p>
<p>Thanks.</p>
| java | [1] |
5,115,655 | 5,115,656 | Python inter-computer communication | <p>This whole topic is way out of my depth, so forgive my imprecise question, but I have two computers both connected to one LAN.</p>
<p>What I want is to be able to communicate one string between the two, by running a python script on the first (the host) where the string will originate, and a second on the client computer to retrieve the string.</p>
<p>What is the most efficient way for an inexperienced programmer like me to achieve this?</p>
| python | [7] |
4,529,913 | 4,529,914 | Need a ROT47 JavaScript Implementation | <p>I found the following code to decode a ROT13 string and put it into a webpage with JavaScript:</p>
<pre><code><script type="text/javascript">
document.write("string".replace(/[a-zA-Z]/g,
function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}));
</script>
</code></pre>
<p>I need a similar JavaScript code to decode ROT47.</p>
<p>I found a few functions, but I have no idea how to get it into the same script, so it will put the decoded string into a webpage.</p>
<p>One of them is here - <a href="http://www.visualco.de/ROTn.js.html" rel="nofollow">http://www.visualco.de/ROTn.js.html</a></p>
<p>Can someone please help?</p>
<p>Thanks a lot!</p>
| javascript | [3] |
604,556 | 604,557 | new keyword without class name in c# | <p>While going through the ASP.NET MVC docs I see this idiom being used alot:</p>
<pre><code>new { foo = "bar", baz = "foo" }
</code></pre>
<p>Is this a Dictionary literal syntax?
Is it a new class/struct with the type inferred by the called function definition?
If it is how come the vars don't need a type definition, not even <code>var</code>?</p>
| c# | [0] |
5,745,276 | 5,745,277 | How can i close parent window from child window | <p>I opening the logout link in new tab from parent window destroying the session and redirecting the child window page to index or login page. But simultaneously i want to close parent window. How should i do it? It should work in all browser.
Thanks in advance.</p>
| javascript | [3] |
527,094 | 527,095 | Run a php script from a java class | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2874591/execute-external-program-from-java">Execute external program from Java</a> </p>
</blockquote>
<p>Is it possible to Run a php script from a java class. My project is a struts2 frame work web application. Its purely a java webapp We use a php script to run some daily cron jobs. It was written in php by an ex-employee. Is there a way to run the php script from the javaclass?</p>
| java | [1] |
4,518,530 | 4,518,531 | How to count number of time the user use my app? | <p>I want to count number of time the user use my app. eg: a user use my app and i can to count number of time that user use my app.
Thanks you so much!</p>
| iphone | [8] |
3,820,969 | 3,820,970 | jQuery: "diff" two tables; display rows not in common | <h2>In a checkout application:</h2>
<p>Need to display only the recently added items.</p>
<h2>Constraints:</h2>
<p>No control over submit action in form.<br>
No control over "row adding" mechanism<br></p>
<h2>My idea:</h2>
<ol>
<li>Clone table upon document load</li>
<li>Compare or 'diff' table against clone at "finish"</li>
<li>Display unique rows</li>
</ol>
<h2>Where I'm at so far:</h2>
<p><a href="http://jsfiddle.net/XLsCx/10/" rel="nofollow">http://jsfiddle.net/XLsCx/10/</a></p>
<p>I can't get unique rows to display in new table. The results are wrong too, if you look at what's highlighted in Red.</p>
<p><strong>( sounds of crickets chirping )</strong><br><br>
Haven't figured it out yet, huh? Well, I did ...finally. </p>
<p><a href="http://jsfiddle.net/FkrBc/" rel="nofollow">http://jsfiddle.net/FkrBc/</a></p>
<p>I'll submit this as an answer later.</p>
| jquery | [5] |
1,963,390 | 1,963,391 | Opening a new tab when user clicks on some url in chrome extension | <p>I have written a chrome extension. I'd like all urls to open in a new tab when user clicks on it without using target=_blank in onclick, as it would be tedius work for me. </p>
<p>Any suggestions will be highly appreciated.</p>
<p>Thanks in advance.</p>
| javascript | [3] |
2,174,909 | 2,174,910 | Bitmap from url without scaling | <p>i am getting bitamap from a url. Everything is fine but i m having small issue i.e my bitmap from url gets scales down. I want bitmap of original size without scaling. How to achieve this. I tried options but no success yet. here is my code:</p>
<pre><code>try {
URL url = new URL(src);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);
return myBitmap;
} catch (IOException e) {
e.printStackTrace();
return null;
}
</code></pre>
<p>I set this drawable to imagview. But image is scaled down. I want original size and original size is not too big so need to worry about outofmemory exception. Is there any way to avoid scaling while parsing bitmap from url stream.</p>
<p>Thanks.</p>
| android | [4] |
5,300,059 | 5,300,060 | convert bitmap to integer array form and then compress it in android | <p>how does bitmap return data in the form of integer array. And how do i convert it into integer array form. After conversion to integer array form i want to compress that integer array form. Is it possible? If so how?
Kindly help me out</p>
| android | [4] |
34,528 | 34,529 | "If" statement - Order of validation of objects? | <p>Simple question about the order of an IF statement in C#.NET</p>
<pre><code>if (Company !=null && Company.ID > 0)
{
}
</code></pre>
<p>Does C# work from left to right, and therefore make the check on Company.ID valid?</p>
<p>Thanks.</p>
| c# | [0] |
1,719,789 | 1,719,790 | Scale an array of values with lightning speed | <p>I have an array of double with 12,000 entries. I need to scale each entry's value by a factor (e.g. 0.3345, or 6.78. whatever).</p>
<p>What I did was to loop each entry and perform the multiplication. As I am working on an PPC-based 100MHz embedded system, the large number of multiplication calls is slowing it down tremendously.</p>
<p>I there a way to do this faster. An analogy would be like initializing a block of memory -- one would use memset which is very fast. I wonder if there is an equivalent method.</p>
| c++ | [6] |
324,511 | 324,512 | value undefined for jquery | <p>here is my jquery</p>
<pre><code> var obj=$("#Connect");
alert($("#Connect").value);
</code></pre>
<p>The value appeared to be undefined, but I have a html tag there</p>
<pre><code><input type="button" id="Connect" value="Connect"/>
</code></pre>
<p>what is the problem?</p>
| jquery | [5] |
1,107,232 | 1,107,233 | Additional checkboxes/radiobutton required for treeview | <p>I understand that treeview in asp.net comes with checkboxes option for usage. However, in my application, I will require 2 additional checkboxes or radiobutton on the righthand side of each leaf node of my treeview.</p>
<p>However, I seem to be unable to find a solution to this requirement, and i think treeview structure does not support this feature.</p>
<p>I'm new to asp and I'm not sure if there is any other class which i can use upon to implement this feature.</p>
<p>Hope I can have some ideas from you guys to implement this</p>
<p>All help is appreciated</p>
<p>Thanks!</p>
<p>Regards
bernerd</p>
| asp.net | [9] |
2,262,129 | 2,262,130 | Generating a user unique hash | <p>I need to generate an hash, that is unique for a user on an android device. Since they can have multiple users that seems difficult to me. I was about to use the IMEI of the device (or another device, if there is one), but since android supports multiple users, I have to use something else, without changing my permissions if possible (at the moment I have internet and read/write storage permissions)</p>
<p>Any Ideas?</p>
<p>For hashing itself I would use MD5 or SHA1.</p>
| android | [4] |
3,191,091 | 3,191,092 | PHP: Injecting code on non-sql code? | <p>I've read about MySQL injection and how it's done. I have a doubt, how could a login code be attacked if it doenst get data from a database?</p>
<p>This is what my login code looks like:</p>
<pre><code>if($_GET['login'] == "myname" && $_GET['password'] == "mypass"){
echo 'welcome, admin.';
else
echo 'login failed.'
</code></pre>
<p>ps: this is for practice sake only, I know hardcoded passwords shouldnt be used.</p>
| php | [2] |
2,154,206 | 2,154,207 | Documentation for JavaScript Event Hanlders | <p>I am looking for a list of all JavaScript event handlers (such as onLoad, onSubmit ect...) and the corresponding html tags that they can be applied to. <a href="http://docs.sun.com/source/816-6408-10/handlers.htm" rel="nofollow">This</a> is is the best document I have found so far, but I believe it is is incomplete. The <a href="http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.2.3" rel="nofollow">W3 specs</a> are even worse, all it says is <code>"This attribute may be used with most elements."</code>. All browsers have their own quarks, if you know of a document for a specific browser like Firefox or IE that would also be helpful. </p>
| javascript | [3] |
2,968,345 | 2,968,346 | Change date string format in android | <p>I am getting date string from SAX parsing like this: <strong>Wed, 18 Apr 2012 07:55:29 +0000</strong></p>
<p>Now, I want this string as : <strong>Apr 18, 2012 01:25 PM</strong></p>
<p>How can I do this?</p>
| android | [4] |
711,976 | 711,977 | How to User Variable Names For Opening One or More Files In Python? | <p>Python newb and first-time poster...</p>
<p>I'm building a mass disk copying program and have been pretty successful in working through issues until now. I am trying to open from 1 to n (up to 28) files (actually drives in Linux, e.g., /dev/sdc, /dev/sdd, ...), depending on user checkbox selection. </p>
<p>I'm using something like below, but of course am getting a "can't assign to function call" error when the code hits the eval line. This is not the actual code, but replicates my problem; please ignore the file paths.</p>
<p>What is an appropriate way to do this? </p>
<pre><code>#!/usr/bin/env python
class snippet:
def __init__(self):
# open files for binary writing
file_in = open('/dev/null', 'rb')
ints = [0, 1, 2, 3]
for i in ints:
num = str(i)
eval('f_out' + num) = open('/tmp/tmp' + num, 'wb')
# READ/WRITE CODE GOES HERE
# close files
file_in.close()
for i in ints:
num = str(i)
print "Number: " + num
eval("f_out" + num).close()
if __name__ == '__main__':
app = snippet()
</code></pre>
<p>Thanks,
Roy</p>
| python | [7] |
3,995,153 | 3,995,154 | how do i pass data with & in jquery ajax request | <p>Here is a scenario. when ever i pass following in a ajax request.</p>
<pre><code>$article = $('#article').val();
$.ajax({
url:'url.php',
type:'post',
data:'article='+$article,
success : function(response){
alert(response)
});
</code></pre>
<p>so if $article will contain following:</p>
<blockquote>
<p>what is & and what is or.</p>
</blockquote>
<p>the script only sends the data what is. not the whole data.</p>
| jquery | [5] |
3,154,136 | 3,154,137 | How to escape a string to be passed into DecimalFormat | <p>May I know how I can escape a string to be passed into decimal format?</p>
<pre><code>// currencySymbolPrefix can be any string.
NumberFormat numberFormat = new DecimalFormat(currencySymbolPrefix + "#,##0.00");
</code></pre>
<p>How can I escape <code>currencySymbolPrefix</code>, so that it may contains any characters including '#', and will not be interpreted as one of the pattern.</p>
<p>Please do not suggest</p>
<pre><code>NumberFormat numberFormat = new DecimalFormat("#,##0.00");
final String output = currencySymbolPrefix + numberFormat.format(number);
</code></pre>
<p>as my vendor's method only accept single NumberFormat.</p>
| java | [1] |
900,034 | 900,035 | Comparing time stamps with php? | <p>Are there any built in functions that do unix time stamp comparisons in php?</p>
<p>EDIT: I mean timestamps of the form "2001-12-20 00:00:01". Also edited title... my apologies as this isn't a unix timestamp</p>
| php | [2] |
5,392,860 | 5,392,861 | two views orientation problem | <p>I am new to iphone development.. </p>
<p>am creating one small application where two viewcontrollers like</p>
<ol>
<li>loginController </li>
<li>updateController</li>
</ol>
<p>For apply orientation i created two views for each controller like
for
first controller these are 'landscapeLoginView' & 'portraitLoginView'
& for second these are 'landscapeUpdateView' & 'portraitUpdateView'</p>
<p>I define 'isLogin' variable in MainControllerDelegate file,</p>
<p>Code for orientation is as given below, </p>
<pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
TestAppDelegate *testDelegate = (TestAppDelegate *)[[UIApplication sharedApplication] delegate];
if(testDelegate.isLogin) {
UpdateController *updateController = [[UpdateController alloc] initWithNibName:@"UpdateController" bundle:nil];
[self.view addSubview:updateController.view];
[updateController release];
return YES;
} else
{
if(UIInterfaceOrientationIsPortrait(interfaceOrientation))
{
self.view = self.portrait;
}
else if (UIInterfaceOrientationIsLandscape(interfaceOrientation))
{
self.view = self.landscape;
}
return YES;
}
</code></pre>
<p>}</p>
<p>This will load the respected orientation after clicking on 'Login' button.
Everything work fine for 'LoginController' like button events & all.</p>
<p>but,
when i entered on 'UpdateConroller' and update text from TextView by clicking 'Update'button, it's updated for 'PortraitView' not for 'LandscapeView'.</p>
<p>In Interface Builder i set 'PortraitView' to 'view'.</p>
<p>How can i achive same functionality for 'LandscapeView'? Am i doing right? </p>
| iphone | [8] |
1,873,451 | 1,873,452 | Regarding casting | <p>I was doing a short research on type casting , below is the mine code</p>
<pre><code>interface Foo {}
class Alpha implements Foo {}
class Beta extends Alpha {}
public class Delta extends Beta
{
public static void main( String[] args )
{
Beta x = new Beta();
Alpha a = x;
// Foo f = (Alpha)x;// --> commented out
Beta b = (Beta)(Alpha)x;
Foo f = (Delta)x; // --> complie time error
}
}
</code></pre>
<p>As indicated in the last statement it throws a run time error java.lang.ClassCas tException, please advise and if I cast it with Alpha then it works perfectly fine.</p>
| java | [1] |
3,405,475 | 3,405,476 | Context vs. Selector specificy in jQuery | <p>There are times when one can specify the scope in which a particular element might be found either by using a hierarchical selector, ie:</p>
<pre><code>$('#someParent .someChildren')
</code></pre>
<p>...or by using context, ie:</p>
<pre><code>$('.someChildren', $('#someParent'))
</code></pre>
<p>I know there are times when one can't use the former, so obviously the latter is useful. But in situations like the one I present, which is better and why?</p>
| jquery | [5] |
1,653,782 | 1,653,783 | Image splitting into 9 pieces | <p>My Code:</p>
<pre><code> private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
ngr.Dispose();
List<Image> list = new List<Image>();
Graphics g = Graphics.FromImage(pictureBox1.Image);
Brush redBrush = new SolidBrush(Color.Red);
Pen pen = new Pen(redBrush,3);
MessageBox.Show(pictureBox1.Image.Width + " " + pictureBox1.Image.Height);
for (int i = 0; i < pictureBox1.Image.Width; i = (pictureBox1.Image.Width / 3) + i)
{
for (int y = 0; y < pictureBox1.Image.Height; y = (pictureBox1.Image.Height / 3) + y)
{
Rectangle r = new Rectangle(i, y, pictureBox1.Image.Width / 3, pictureBox1.Image.Height / 3);
g.DrawRectangle(pen,r );
if (i > 0 && y > 0)
{
if (i + r.Width < pictureBox1.Image.Width && y + r.Height < pictureBox1.Image.Height)
{
list.Add(cropImage(pictureBox1.Image, r));
}
}
}
}
g.Dispose();
pictureBox1.Invalidate();
pictureBox1.Image = list[0];
}
private static Image cropImage(Image img, Rectangle cropArea)
{
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(cropArea, System.Drawing.Imaging.PixelFormat.DontCare);
return (Image)(bmpCrop);
}
</code></pre>
<p>This Code adds only 2 pieces to the list but not the other 7 pieces.</p>
<p>Please Help!!</p>
| c# | [0] |
2,654,665 | 2,654,666 | delay the execution of a js function | <p>I wrote a function to display an image in the center of the box. However, when the image is loaded, it comes with some default style including position information. Calling the center image function is essentially happening at the same time as image loading, but it finishes before image is fully loaded. This cause the side effect of center image function to be overritten by the default style of the image, and as a result the image is not placed in the center of the box. </p>
<p>I am wondering if I could delay the execution of center image function to solve this. Any one tell me how to delay the execution of a js function? thanks a lot.</p>
| javascript | [3] |
3,400,761 | 3,400,762 | Get the row that has been clicked in the gridview | <p>I have added OnClick event dynamically for gridview.So when I click on any of the row on grid view, the event is fired but I can't get which row is clicked.
This is the code where I add event.</p>
<pre><code>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Attributes["OnClick"] = Page.ClientScript.GetPostBackClientHyperlink(btnGrid, string.Empty);
}
</code></pre>
<p>//This is the code which catches this event</p>
<pre><code>protected void GridView1_OnClick(object sender, EventArgs e)
{
_ID="10" //Static data. I need this from the gridview1.row[ClickedRow].cell[0]
}
</code></pre>
| asp.net | [9] |
1,444,522 | 1,444,523 | What is the purpose of NSNotification | <p>i am new Notification.what is the purpose of it...
can we use [[NSNotificationCenter defaultCenter] addObserver without postNotification,
If we can do it,how it is identified?what is the relationship between addObserver and postNotification?any one can explain in detail?</p>
| iphone | [8] |
1,685,284 | 1,685,285 | NSURLConnection sends incomplete string | <p>How can i check whether NSURLConnection is sending the whole request string to the webserver or not?
I am calling one webservice in which length of request string varies.
When i send small request string, the webservice is working fine.
But when the request string length is long, the webservice is not giving me proper response.</p>
<p>Has anyone faced such a problem?</p>
| iphone | [8] |
4,977,811 | 4,977,812 | Php code inside html or html inside php? | <p>I am writing code in php but, i am confuse in following coding styles:</p>
<pre><code><html>
<head></head>
<body>
<?php echo 'Hello World'; ?>
<div>This is another</div>
<?php echo 'hello again'; ?>
</body>
</html>
</code></pre>
<p>OR</p>
<pre><code><?php
echo '<html>
<head></head>
<body>
Hello World
<div>This is another</div>
hello again
</body>
</html>';
?>
</code></pre>
<p>And, Which is better in complex programming?</p>
| php | [2] |
5,732,554 | 5,732,555 | Is there any free software for Android that can send my geolocation to a web service? | <p>Is there any free software for Android that can send my mobile phone's geolocation information to a Google map or to my own URL?</p>
| android | [4] |
5,482,628 | 5,482,629 | PHP functions added since version | <p>Is there a resource that allows me to see the PHP functions added/changed since a certain version release?</p>
| php | [2] |
1,677,644 | 1,677,645 | Access the SD card files from Android application | <p>I have the following requirement</p>
<p>1> When the user clicks on the button , the SD card should be accessible to the user.</p>
<p>2> The user clicks on a specific image & I need to save the SD card path of the image selected</p>
<p>3> I need to resize the image before displaying that to the user within the Android application</p>
<p>Kindly provide me any blog/article link from where I can get the sample code for the same.
Thanks in advance.</p>
<p>Warm Regards,</p>
<p>CB</p>
| android | [4] |
3,171,673 | 3,171,674 | Redefinition of constructor with inheritance | <p>Why in the underlying example keeps the compiler complaining about a redefinition for the B constructor. If i remove the {} it complains they need to be there. How is this done correctly?
I want to implement the constructor of B in the CPP file and not inline.</p>
<pre><code>#include <vector>
#include <sstream>
#include <iostream>
using namespace std;
class A
{
public:
A();
~A();
};
class B : public A
{
public:
B() : A() {};
~B();
};
A::A()
{
cout << "A construct!";
}
B::B()
{
cout << "B construct!";
cout << "B construct!";
cout << "B construct!";
cout << "B construct!";
cout << "B construct!";
cout << "B construct!";
cout << "B construct!";
cout << "B construct!";
cout << "B construct!";
cout << "B construct!";
}
int main()
{
return 0;
}
</code></pre>
| c++ | [6] |
3,456,986 | 3,456,987 | Determine if a function is available in a Python module | <p>I am working on some Python socket code that's using the <a href="http://docs.python.org/library/socket.html#socket.fromfd" rel="nofollow"><code>socket.fromfd()</code></a> function.</p>
<p>However, this method is not available on all platforms, so I am writing some fallback code in the case that the method is not defined.</p>
<p><strong>What's the best way to determine if a method is defined at runtime?</strong> Is the following sufficient or is there a better idiom?</p>
<pre><code>if 'fromfd' in dir(socket):
sock = socket.fromfd(...)
else:
sock = socket.socket(...)
</code></pre>
<p>I'm slightly concerned that the documentation for <a href="http://docs.python.org/library/functions.html#dir" rel="nofollow"><code>dir()</code></a> seems to discourage its use. Would <a href="http://docs.python.org/library/functions.html#getattr" rel="nofollow"><code>getattr()</code></a> be a better choice, as in:</p>
<pre><code>if getattr(socket, 'fromfd', None) is not None:
sock = socket.fromfd(...)
else:
sock = socket.socket(...)
</code></pre>
<p>Thoughts?</p>
<p><strong>EDIT</strong> As <a href="http://stackoverflow.com/questions/763971/determine-if-a-function-is-available-in-a-python-module/763975#763975">Paolo</a> pointed out, this question is <a href="http://stackoverflow.com/questions/610883">nearly a duplicate</a> of a question about determining attribute presence. However, since the terminology used is disjoint (lk's <em>"object has an attribute"</em> vs my <em>"module has a function"</em>) it may be helpful to preserve this question for searchability unless the two can be combined.</p>
| python | [7] |
4,050,958 | 4,050,959 | c++ pointer to a reference | <p>Is it legal to have a pointer of a reference in C++? </p>
<p>For example:</p>
<pre><code>int &ref = array[idx];
func(&ref);
</code></pre>
<p>One reason I can think of why you might want to do this if func() already exists in a library which you can't change.</p>
| c++ | [6] |
3,732,223 | 3,732,224 | Null pointer exception on .iterator() call | <p>I'm getting a strange NullPointerException, evidently thrown by the following line of code:</p>
<pre><code>Iterator<Note> it = notes.iterator();
</code></pre>
<p>I've checked, and at the time the java.util.TreeSet <code>notes</code> is always non-null (with 15 elements). The TreeSet API says nothing about <code>iterator()</code> throwing NullPointerExceptions. What else could be going here?</p>
| java | [1] |
470,902 | 470,903 | Showing color selected from an image on touch event in an overlay | <p>I want to display the color selected on touch of an image in an enlarged baloon just above the touch point . Similar to showing my current location in maps using itemized overlays. How can that be achieved ?</p>
| android | [4] |
4,217,247 | 4,217,248 | jQuery: callback doesn't work right | <p>I'm new to jQuery so forgive me (and correct me too please) if I say something wrong here.</p>
<p>I have this code and the callback is being executed right the moment the element is clicked, and not after the slideUp has finished:</p>
<pre><code>$('.close-button').click(function(){
$('.click-menu div').slideUp(3000, function() {
$('.generic-box a, .generic-box p').css('z-index','1');
});
});
</code></pre>
<p>Am I missing something?</p>
<p>Any help would be greatly appreciated.</p>
<p>Thanks.</p>
| jquery | [5] |
1,020,448 | 1,020,449 | Regular expression with javascript | <p>I have following code in java script</p>
<pre><code> var regexp = /\$[A-Z]+[0-9]+/g;
for (var i = 0; i < 6; i++) {
if (regexp.test("$A1")) {
console.log("Matched");
}
else {
console.log("Unmatched");
}
}
</code></pre>
<p>Please run it on your browser console. It will print alternative <strong>Matched</strong> and <strong>Unmatched</strong>. Can anyone tell the reason for it.</p>
| javascript | [3] |
2,453,949 | 2,453,950 | C# .Any() used to check for an already existing element on a single dimensional list | <p>I'm seeing a lot of examples of .Any() used with custom defined lists. I have a list that only contains values and no keys. How can I make use of Any() with a single dimensional list. </p>
<p>Here's how far I have gotten already:</p>
<pre><code> List<string> thread_pause = null;
if (thread_pause.Any(item => item == project_id)&&thread_pause!=null)
{
show("Already In List!");
}
else
{
show(project_id);
session.thread_pause.Insert(0, project_id);
}
</code></pre>
<p>I appreciate any help on this.</p>
| c# | [0] |
1,598,022 | 1,598,023 | Passing property as parameter in method | <p>I know the title could probably be a bit more descriptive/better phrased, but it was the best I could come up with. </p>
<p>Currently I have a class with a lot of methods looking like the ones below:</p>
<pre><code> private static void UpdateArtists()
{
artists.Clear();
foreach (AudioInfo entry in library_entries)
{
artists.Add(entry.Artist, entry);
}
}
private static void UpdateAlbums()
{
albums.Clear();
foreach (AudioInfo entry in library_entries)
{
albums.Add(entry.Album, entry);
}
}
private static void UpdateGenres()
{
genres.Clear();
foreach (AudioInfo entry in library_entries)
{
genres.Add(entry.Genre, entry);
}
}
private static void UpdateYears()
{
years.Clear();
foreach (AudioInfo entry in library_entries)
{
years.Add(entry.Year, entry);
}
}
</code></pre>
<p>Needless to say, writing dozens of these is very tiresome. So I was wondering if it's possible to simplify it and make a method something like this:</p>
<pre><code> private static void Update(Dictionary<string, AudioInfo> dictionary, AudioInfo.Property property)
{
dictionary.Clear();
foreach (AudioInfo entry in library_entries)
{
dictionary.Add(entry.property, entry);
}
//Where "property" is a property in the AudioInfo-class.
}
</code></pre>
<p>Is that doable, and if it is; how?</p>
<p>Thanks!</p>
| c# | [0] |
4,837,165 | 4,837,166 | C# datatable, duplicate data | <p>For testing I would like to expand my result set. I have a <code>DataTable dt</code> that has 7 or so results. I would like to do something like:</p>
<p><code>dt.Rows.Add(dt);</code> a few times, just to make the data set larger.</p>
<p>I also tried <code>dt.Rows.Add(dt.Rows[0]);</code></p>
<p>The first gave an error about the type, the second said the row already existed.</p>
| c# | [0] |
939,781 | 939,782 | Jquery fadein/fadeout list | <p>I have a list:</p>
<pre><code><ul class="list">
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</code></pre>
<p>I need to fadein/fadeout all this <code><li></code> items. I need a loop, so when the last one appears and disappears, the first appears next.</p>
| jquery | [5] |
596,537 | 596,538 | developer toolkits | <p>I'm coming from .Net where there are UI toolkits for the desktop, web, etc. like Telerik and Infragistics that have lots of pre-built tools. Are there similar, pre-built widgets for Android Development? I see lots of cool Android Apps and I would like to use some of the same widgets without having to create my own. Is there a websites that review these toolkits?</p>
| android | [4] |
2,058,918 | 2,058,919 | Location tracking in background in android | <p>I am working on an application which fetch the location details in a periodic manner..
i have tried service and broadcastreciever but failed to achieve the location details in particular time frame say 30mins or so.. can any help or suggest me some thing through which i can achieve the location details again and again ..
Thnks in adv</p>
| android | [4] |
1,399,030 | 1,399,031 | Store private data on external storage | <p>I need that the files generated by my application don't be accessible by others applications. The problem is that these files are multimedia files (photos, videos, audios ...) and are too large to be stored in the internal memory. Encrypt is not an option because the cost of memory for display in galleries or play would be too high.</p>
<p>Any idea?</p>
| android | [4] |
4,943,301 | 4,943,302 | Android updating a database | <p>I there a way I can set up my app so that things like the database and images can be optionally downloaded/updated when when I make changes to the data, without updating the app. i.e. a kind of syncing with the new data?</p>
<p>I would have the database and images on my server and the user can update or not without having an icon on their phone saying there are updates available. </p>
| android | [4] |
2,092,047 | 2,092,048 | Javascript with IPC like features? | <p>This isn't exactly what I'm doing but its close enough.</p>
<p>Lets say I want to implement something simple. Like a todo list that stored serverside.
Lets say it is also popular and i'm worried a bit about people will have 200+ items.</p>
<p>I want to be able to reorder items. I know how to reorder in javascript but because i'm worried about 200+ items I don't want to send the ENTIRE LIST over the network.</p>
<p>So i'll simply send what moved and its new position. But now this is my problem. I want to allow OLD windows or MULTIPLE windows not to cause conflict. The old or other window would not know the most up to date order and reordering with out of date order would cause problems.</p>
<p>Is there some kind of IPC I can use to say hi other window this is the new order/html/whatever? If not then can I do something simple like send it a few ints (cmd and its arguments essentially). How would I do this?</p>
<p>Restrictions: It can not talk to the server. It isn't required to work if a user has another browser instance.</p>
| javascript | [3] |
3,770,701 | 3,770,702 | new ArrayList<Integer>(); giving a syntax error in Java | <p>I am trying to run the following code that I found marked as correct on StackOverflow:</p>
<p><a href="http://stackoverflow.com/questions/1073919/how-to-convert-int-into-listinteger-in-java">Code on SO</a></p>
<pre><code>List<Integer> intList = new ArrayList<Integer>();
for (int index = 0; index < ints.length; index++)
{
intList.add(ints[index]);
}
</code></pre>
<p>When I run the code I get an error: Syntax error on token ";", { expected after this token on the line starting with List</p>
<p>Is there something I am missing?</p>
| java | [1] |
4,772,687 | 4,772,688 | vector<float>* causing seg fault! | <p>I have a vector of floats, defined by:</p>
<pre><code>std::vector<float>* MyVec;
</code></pre>
<p>and I was filling this inside a for loop later with:</p>
<pre><code>MyVec->push_back(somevalue)
</code></pre>
<p>and I was getting a seg fault. In order to try and find out what was going on I commented out the push_back line and I still saw a seg fault, and when it seg faulted the size of MyVec was 490618047. </p>
<p>Is there perhaps something I have forgotten to do with this vector, and how is it getting filled by such a huge number without any entries being entered into the vector?</p>
<p>Thanks in advance.</p>
| c++ | [6] |
2,746,917 | 2,746,918 | how to compare 2 json in python | <p>How to compare 2 json objects in python below are the sample json.</p>
<pre><code>sample_json1={
{
"globalControlId": 72,
"value": 0,
"controlId": 2
},
{
"globalControlId": 77,
"value": 3,
"controlId": 7
}
}
sample_json2={
{
"globalControlId": 72,
"value": 0,
"controlId": 2
},
{
"globalControlId": 77,
"value": 3,
"controlId": 7
}
}
</code></pre>
| python | [7] |
5,540,967 | 5,540,968 | Python logger to dictionary | <p>I am new in python...i am trying to read a python log file and make a dictionary. How will it be done with logger? </p>
| python | [7] |
4,648,048 | 4,648,049 | Android: GameGuardian doesn't find the values of my app? | <p>I've created a simple app, with a button and a TextView. My value starts at 100 and is stored in an integer variable. When you press the button the value decreases by 1 and the TextView is updated.</p>
<p>I installed the application on my phone and tried to find the value with GameGuardian... Fortunately for others, unfortunately for me GameGuardian doesn't find my value...</p>
<p>How do I need to change my code so GameGuardian can find it?</p>
<p>Thanks in advance!</p>
| android | [4] |
3,546,814 | 3,546,815 | jQuery check number of instance | <p>So I guess this is mostly that I don't know how to word this to Google it, but basically I'm trying to build a menu that uses a different hover background color for each menu item. I have this so far:</p>
<pre><code>$(function() {
$('li').hover(function() {
$(this).animate({backgroundColor:'#f00'},200);
}, function() {
$(this).animate({backgroundColor:'#eee'},200);
});
});
</code></pre>
<p>I want to replace '#f00' with a different value based on which menu item is selected. I know I could write a different method for each item using :eq, but if there is a more condensed way to do it, that would be preferred. I was thinking like an array of color values, then the function would substitute the number of the instance with array[number of instance]. Hopefully that makes sense...</p>
| jquery | [5] |
4,500,562 | 4,500,563 | Cross browser JavaScript (not jQuery...) scroll to top animation | <p>I'm looking for a simple, cross-browser "scroll to top" animation I can apply to a link. I don't want to require a JS library such as jQuery/Moo, etc.</p>
<pre><code>// jQuery Equivilant to convert to pure JS...
$('html, body').animate({scrollTop:0}, 400);
</code></pre>
<p>I'm a perfect case for someone who should have learned JS 100% before jumping into a library. :(</p>
| javascript | [3] |
3,004,976 | 3,004,977 | Javascript anonymous function argument passing (wrox professionnal javascript p188) | <p>Wrox Profesionnal Javascript p188
I don't understand this part at line 8 where the anonymous function already have an argument of num, but how can (i) is copied into the argument num. Normally a function would stop at the closing bracket }, adding (i) doesn't make sense for me.</p>
<pre><code>function createFunctions(){
var result = new Array();
for (var i=0; i < 10; i++){
result[i] = function(num){
return function(){
return num;
};
}(i);
}
return result;
}
</code></pre>
| javascript | [3] |
5,056,311 | 5,056,312 | What is the proper way to suggest features to be added to the C# language? | <p>What is the proper way to suggest features to be added to the C# language?</p>
<p>For example, I would like to have an operator similar to <code>??</code> but for selecting the min or max values.</p>
<p>I'd like <code>a <? b</code> to expand to <code>a < b ? a : b</code>
likewise for <code>>?</code></p>
| c# | [0] |
3,823,579 | 3,823,580 | Recursively find the most recent file from each folder in folder hierarchy. | <p>I need to find the most recently created file from each folder under my root folder.
The following code returns all the files from the root folder:</p>
<pre><code>list<string> capturesList = SafeFileEnumerator.EnumerateFiles(pathToSearch, "*.pcap", SearchOption.AllDirectories).ToList();
</code></pre>
<p>The class <code>SafeFileEnumerator</code> searches only the location with permissions:</p>
<pre><code>public static class SafeFileEnumerator
{
public static IEnumerable<string> EnumerateDirectories(string parentDirectory, string searchPattern, SearchOption searchOpt)
{
try
{
var directories = Enumerable.Empty<string>();
if (searchOpt == SearchOption.AllDirectories)
{
directories = Directory.EnumerateDirectories(parentDirectory).SelectMany(x => EnumerateDirectories(x, searchPattern, searchOpt));
}
return directories.Concat(Directory.EnumerateDirectories(parentDirectory, searchPattern));
}
catch (UnauthorizedAccessException)
{
return Enumerable.Empty<string>();
}
}
public static IEnumerable<string> EnumerateFiles(string path, string searchPattern, SearchOption searchOpt)
{
try
{
var dirFiles = Enumerable.Empty<string>();
if (searchOpt == SearchOption.AllDirectories)
{
dirFiles = Directory.EnumerateDirectories(path).SelectMany(x => EnumerateFiles(x, searchPattern, searchOpt));
}
return dirFiles.Concat(Directory.EnumerateFiles(path, searchPattern));
}
catch (UnauthorizedAccessException)
{
return Enumerable.Empty<string>();
}
}
}
</code></pre>
| c# | [0] |
3,158,468 | 3,158,469 | Asp.net Textbox replacement or better design | <p>Can someone direct me to a good Textbox replacement or css design for the standart one.
I think the regular one is boring but functioning well. I just need to make it look nicer.</p>
<p>Thanks.</p>
| asp.net | [9] |
4,732,263 | 4,732,264 | Python elements retrieved from container (list, dict, tuple etc) passed by reference or value? | <p>I have a function that updates data in a cache (implemented as a dictionary).</p>
<pre><code>def updateCache(name, new_data):
global cache
info = cache[name] # is this being passed to me as a val or ref?
datarows = info['datarows']
datarows.append(new_data)
# These will not be necessary if I was dealing with references ...?
# or in other words, are the following statements redundant or required?
info['datarows'] = datarows
cache[name] = info
</code></pre>
<p>As the comment in the snippet enquires, do I need to stick the new updated objects back into the cache, or am I dealing with references to the objects stored in the dict - in which case the last two statements are redundant?</p>
| python | [7] |
1,199,954 | 1,199,955 | Fire jquery script on first page load, and then never again for that user? | <p>I'm using this jQuery Modal Window script on my site: <a href="http://www.zurb.com/playground/reveal-modal-plugin" rel="nofollow">http://www.zurb.com/playground/reveal-modal-plugin</a></p>
<p>It currently activates a Modal Window when the user clicks on a link. However, I want to modify it to automatically run once the page is loaded for the first time. But subsequent visits to that same page by that same user will not activate the script again. I could probably figure out how to get it to run on page load myself. But getting it to only fire one time, and then never again is something I'm not familiar with.</p>
<p>Any help would be greatly appreciated.</p>
| jquery | [5] |
1,282,217 | 1,282,218 | how can i get only day as an input from user such that he don't have to specify the month and insert the date into database | <p>and this whole will be done through some javascript calender or readymade code.</p>
| php | [2] |
5,773,277 | 5,773,278 | Checkbox and buttons in grid view to take the data in next column index | <p>I am using C# to build window form with checkbox and buttons inside grid view. And it has to indicate the data next to the cell. I use "INdex" but it doesn't work properly. </p>
| c# | [0] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.