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 |
|---|---|---|---|---|---|
1,502,131 | 1,502,132 | AsynchTask crashes on return from doInBackground | <p>I have the following code:</p>
<pre><code>public class TestSynch extends Activity {
public static ArrayList<HashMap<String,String>> list;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Context ctx = this.getApplicationContext();
new ProcessFileTask().execute(ctx);
Intent i = new Intent(TestSynch.this, ListSchools.class);
i.setAction(Intent.ACTION_VIEW);
i.putExtra("arraylist", list);
startActivity(i);
}
private class ProcessFileTask extends AsyncTask<Context, Void, ArrayList<HashMap<String,String>>> {
@Override
protected ArrayList<HashMap<String,String>> doInBackground(Context... ctx) {
ArrayList<HashMap<String,String>> threadList = FileOperations.getListAsMaps(ctx[0]);
return threadList;
}
@Override
protected void onPostExecute(ArrayList<HashMap<String,String>> result) {
list = result;
return;
}
}
</code></pre>
<p>I can debug to the return threadList; line in doInBackground, and the ArrayList variable threadList is perfectly correct.</p>
<p>However, onPostExecute doesn't seem to get called and the Activity crashes on return from doInBackground, with LogCat suggesting a nullPointerException attempting to fire the Intent (which I have previously tested and worked ok before I started messing with AsynchTask)</p>
<p>Any idea why this is happening? The code seems simple enough...</p>
<p>Thanks</p>
| android | [4] |
1,423,117 | 1,423,118 | Count number of lines in a method | <p>I have a .CPP file in which I have defined some methods. For the program execution I am calling these methods.
Now I would like to know how many lines from the specific method were executed in a program.</p>
<p>Is there any way I could programmatically get these information.</p>
| c++ | [6] |
1,546,689 | 1,546,690 | How to Get Contact name, number and emai ID from a list of contacts? | <p>I am new to android ,I need to get the details of my contacts, but the details include only 3 </p>
<ol>
<li><p>Contact name</p></li>
<li><p>contact number and </p></li>
<li><p>Email ID</p></li>
</ol>
<p>when I press a Button it will show these 3 details of my all contacts</p>
<p>I am using android Eclair version 2.1. Any solution ?</p>
| android | [4] |
3,988,072 | 3,988,073 | automatically print c# | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5566186/print-pdf-in-c-sharp">Print Pdf in C#</a> </p>
</blockquote>
<p>i have file</p>
<p><strong>c:\PathToFile\File.pdf</strong></p>
<p>how i can run automatically print on default printer, thanks all :)</p>
| c# | [0] |
3,164,379 | 3,164,380 | Why android:uiOptions="splitActionBarWhenNarrow" not working with device | <p>I am using <code>android:uiOptions="splitActionBarWhenNarrow"</code></p>
<p>to split the <code>Menu's</code> .it is working fine with emulator <code>4.03</code></p>
<p>but not with real device <code>4.03</code>.It is samsung tablet</p>
| android | [4] |
5,057,079 | 5,057,080 | how can i avoid running of more than one instance on same java project at the same time? | <p>i have a java project, works as a server. when an instance of this project running, i can run another instance.<br>
how can i avoid running of more than one instance on same java project at the same time?
(Stop the server when another instance is detected)</p>
| java | [1] |
5,600,750 | 5,600,751 | how to Initialize a Javascript Array with non-zero index | <p>I'm passing an array to a function and I'm curious if there is a quick way to use the json style array initializer to pass an anonymous array:</p>
<p>e.g.: </p>
<pre><code>myfunction([1,2,3,4]);
</code></pre>
<p>Is there some special syntax in javascript that would allow one to initialize the array with non-zero index?</p>
<p>for example, instead of </p>
<pre><code>myfunction([,,,,4321]);
//array[4] == 4321 here
</code></pre>
<p>but if you have an array that has the first 100 positions undefined, you would have to have 100 commas. [,,....,4321]</p>
<p>basically looking for a short form for: </p>
<pre><code>var a = new Array(); a[100] = 4321;
</code></pre>
<p>that you can use as a function parameter.</p>
| javascript | [3] |
3,518,562 | 3,518,563 | Is there a better way to see if a file is being written to? | <p>We have a FreeBSD server with samba that employees copy image files on to, which then get uploaded to our web servers (this way they don't have to mess with ftp). Sometimes, if the upload script is running at the same time as files are being copied, it can upload an incomplete file. </p>
<p>We fixed this by getting the list of files along with the file sizes, then waiting 5 seconds and rechecking the file sizes. If the sizes match then its save to upload, if they don't match it checks again in another 5 seconds.</p>
<p>This seems like an odd way to check if the files are being written to. is there a better, more simple way of doing this?</p>
| php | [2] |
2,310,462 | 2,310,463 | Is there any compelling reason for me to un-static this method? | <p>I have this SaveCheckedStateToDB() function:</p>
<pre><code>public class oDaA_DBUtils {
// TOOD: Perhaps this should not be static, and I should force callers to instantiate the class first?
public static void SaveCheckedStateToDB(int AOptionSelected, String id, boolean AToggledOn)
{
//
}
}
</code></pre>
<p>...that I changed to "static" after getting static about calling it from here prior to adding the "static" keyword:</p>
<pre><code> cbOnDemand.setOnCheckedChangeListener(new OnCheckedChangeListener()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
// Contact id is a string?
oDaA_DBUtils.SaveCheckedStateToDB(oDaA_Consts.ALERT_ON_DEMAND, id, isChecked);
}
});
</code></pre>
<p>Now it compiles, but is that a "wrong" way of working? Should I remove the "static" appendage/decoration and force callers to instantiate the class prior to calling SaveCheckedStateToDB()?</p>
| android | [4] |
3,140,433 | 3,140,434 | Revealing a UL on click in jQuery | <p>I have some problems and hoping you could help.</p>
<p>I have the following HTML code </p>
<pre><code><h4><a class="trigger">Click </a></h4>
<ul class="panel">
<li>List items bla bla bla </li>
<li>List items bla bla bla </li>
<li>List items bla bla bla </li>
</ul>
<h4><a class="trigger">Click </a></h4>
<ul class="panel">
<li>List items bla bla bla </li>
<li>List items bla bla bla </li>
<li>List items bla bla bla </li>
</ul>
</code></pre>
<p>And I would like that on click it toggles. I have the following code in jQuery:</p>
<pre><code>$(function(){
$('ul.panel').hide();
$("a.trigger").click(function(){
$("ul.panel").slideToggle("fast");
$(this).toggleClass("active");
return false;
});
});
</code></pre>
<p>Now I know it won't work because it's selecting ALL items. How can I use it so it only toggles the actual trigger that was clicked and not toggle all of them? I have tried to use FIND, SIBLINGS, NEXT, etc but I can't.</p>
<p>Any help, appreciated.</p>
<p>Thank you!!</p>
| jquery | [5] |
995,689 | 995,690 | Avoiding inline JavaScript with dynamic content | <p>I read <a href="http://coding.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/" rel="nofollow">here</a> that you should avoid coding JavaScript inline (see item #1).</p>
<p>It sounds like a great idea; however, I'm not sure how to use js to select dynamic content without setting the id in the function call inline.</p>
<p>For example, I have a simple blog. The comments are hidden, but can be displayed by clicking an anchor (generated dynamically) that calls a JavaScript function to toggle the comments for that specific post:</p>
<pre><code>$commentsButton = "<a name='comments" . $post->id . "' href='#comments" . $post->id . "'> comments (" . count($comments) . ")</a>";
</code></pre>
<p><code>toggleComments()</code> function:</p>
<pre><code>function toggleComments(id) {
$('#' + id + ' .commentsContainer').toggle(500);
}
</code></pre>
<p>How do you keep from doing this kind of thing? Is it always appropriate to avoid inline JavaScript? Or is this a case where it's necessary?</p>
<p><strong>Update:</strong></p>
<p>I ended up using this:</p>
<pre><code>$('.commentButton').each(function() {
$(this).click(function() {
$(this).parents('.post').find('.commentsContainer').toggle(500);
});
});
</code></pre>
<p>with this:</p>
<pre><code>$commentButton = "<a class='commentButton'> comments (" . count($comments) . ")</a>";
</code></pre>
| javascript | [3] |
1,230,960 | 1,230,961 | numberpad implemetation | <p>I am trying to implement a number pad like this </p>
<p><img src="http://getsetbro.com/img/android-number-input.png" alt="link">.</p>
<p>how can I have different font size for number and character.</p>
<p>Thank you</p>
| android | [4] |
5,419,753 | 5,419,754 | Do template parameters need to be forward declared or does the type definition to be known | <p>Basically I have this code, but GCC complains that the vector cannot
be constructed with an empty type. Has anybody encountered this problem
before? I should mention that Vertex3D is only used through pointers in
the file and so there should be no reason for the whole type to be
known by the compiler. I dont know how templates behave in this
respect..</p>
<pre><code>//#include "cgVertex3D.hpp"
#include "cgDirection3D.hpp"
#include "cgHandedness.hpp"
class Vertex3D; // Forward declaration to avoid mutual header include
class Polygon3D {
// Vertices constituting this polygon
vector<Vertex3D*> *vertices = NULL;
public:
...
</code></pre>
| c++ | [6] |
4,961,025 | 4,961,026 | using javascript to dynamically create and delete clickable button with | <p>I have created a english to hindi transliteration webpage .
There are rules for mapping every hindi letter to its english equivalent.
If user presses 'd' , I want to suggest some nearby letters . It would be great if I am able to create & remove buttons (which have associated onclick action) using javascript.
Is that possible ?</p>
| javascript | [3] |
3,507,678 | 3,507,679 | How to resize array in C++? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/756906/can-you-resize-a-c-array-after-initialization">Can you resize a C++ array after initialization?</a> </p>
</blockquote>
<p>I need to do the equivalent of the following C# code in C++</p>
<pre><code>Array.Resize(ref A, A.Length - 1);
</code></pre>
<p>How to achieve this in C++?</p>
| c++ | [6] |
3,752,000 | 3,752,001 | Android SeekBar Minimum Value | <p>does anyone know how to define a SeekBar's minimum value? Is this done in the XML layout or do I need to define it programatically?</p>
<p>Basically I need to change my minimum value from 0 to 0.2</p>
| android | [4] |
5,551,969 | 5,551,970 | Is there an example of how to use a TouchDelegate in Android to increase the size of a view's click target? | <p>My understanding is that when you have a view that's too small to easily touch, you're supposed to use a TouchDelegate to increase the clickable region for that view.</p>
<p>However, searching for usage examples on Google turn up multiple people asking the question, but few answers.</p>
<p>Does anyone know the proper way to set up a touch delegate for a view to, say, increase its clickable region by 4 pixels in every direction?</p>
| android | [4] |
5,367,863 | 5,367,864 | Drawing pixels on Canvas with BufferedImage not filling the whole Canvas | <p>I'm trying to draw pixels on a Canvas using a BufferedImage. In my Canvas constructor I am initializing the image and pixel array like so:</p>
<pre><code>public MyCanvas() {
Dimension size = new Dimension(WIDTH, HEIGHT);
setSize(size);
setPreferredSize(size);
setMinimumSize(size);
setMaximumSize(size);
image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
pixels = ((DataBufferInt) img.getRaster().getDataBuffer()).getData();
}
</code></pre>
<p>I draw every render by doing:</p>
<pre><code>private void render() {
BufferStrategy bs = getBufferStrategy();
if (bs == null) {
createBufferStrategy(3);
return;
}
for (int i = 0; i < pixels.length; i++) {
pixels[i] = 0xFFFFFF;
}
Graphics g = bs.getDrawGraphics();
g.fillRect(0, 0, getWidth(), getHeight());
g.drawImage(img, 0, 0, WIDTH, HEIGHT, null);
g.dispose();
bs.show();
}
</code></pre>
<p>I'm expecting that my canvas is filled with white pixels, but I get black borders on the right and bottom of the white area, i.e. it's doesn't seem to be filling my entire canvas, or it has some negative offset. I've checked that the length of the pixel array is WIDTH * HEIGHT. I'm putting the canvas into a JPanel with BorderLayout.CENTER, in a JFrame.</p>
<p>EDIT:</p>
<p>Changing</p>
<pre><code>g.drawImage(img, 0, 0, WIDTH, HEIGHT, null);
</code></pre>
<p>to</p>
<pre><code>g.drawImage(img, 0, 0, getWidth(), getHeight(), null);
</code></pre>
<p>makes it do what I expect. However I don't understand why I have to fetch the canvas size when I have set the size myself (to WIDTH, HEIGHT), and it doesn't seem to be the same as the size I gave it.</p>
| java | [1] |
4,864,639 | 4,864,640 | Python - index out of range on large initialized list | <p>I'm a beginner at Python and I'm getting a strange out of bounds error.</p>
<p>The idea is that I need a cache initialized using:</p>
<pre><code>arr = [0]*1000000
</code></pre>
<p>then accessed in the same function by calling </p>
<pre><code>def func (i) :
k=1
a = i
arr = [0]*1000000
while (i>1):
if arr[i] != 0:
k = k + arr[i] - 1
break
if i%2 == 0:
i = i/2
else:
i = 3*i + 1
k += 1
arr[a] = k
return k
</code></pre>
<p>if the value i is over 1500 it gives me an out of bounds error. The cache, however, is supposed to be initialized to a million ints. Am I missing something? Thanks</p>
| python | [7] |
2,390,633 | 2,390,634 | How to select Items with a where alt != "someString" | <p>I am selecting a group of checkboxes like so</p>
<pre><code>$(tbl).find('input[type=checkbox]').prop('checked', this.checked);
</code></pre>
<p>I want to EXCLUDE any checkboxes that have an alt="disabled" property and I can't get it to work, can anyone help.</p>
| jquery | [5] |
344,292 | 344,293 | How to include a javascript file in the HTML? | <p>I currently have my JS code in a element inside HTML and it works fine. As soon as I swap it with a with src="myjs.js" it stops working...why? So I need to addeventlisteners in HTML to the root? </p>
| javascript | [3] |
1,463,321 | 1,463,322 | get property name from generic list | <p>Environment: asp.net fx3.5</p>
<p>given</p>
<pre><code>public class Product
{
public int ProductId { get; set; }
public string ProductName { get; set; }
public decimal UnitPrice { get; set; }
}
</code></pre>
<p>i have a <code>List<Product></code> collection.</p>
<p>is there a way to get the property names because i want them to be a header row in my csv file that i'm constructing?</p>
<p>so the result i'm looking for is a <code>string = "ProductId,ProductName,UnitPrice"</code></p>
| c# | [0] |
2,674,702 | 2,674,703 | How to move a movie from Camera Roll to app's Documents folder? | <p>How can I copy/move a movie from Camera Roll to an app's own Documents folder?</p>
| iphone | [8] |
2,716,714 | 2,716,715 | Need help finding what is wrong with my code for a super simple $getJSON call | <p>I cant figure out why the this alert() part below is not working when I call it from $.getJSON???</p>
<pre><code>function parseInfo(data)
{
alert("getJSON worked");
}
</code></pre>
<p>Firebug says I connecting to the server with a 200 OK code</p>
<p> </p>
<pre><code><!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$.getJSON('getData.php', {'data_id' : 'mysql_data'}, parseInfo);
});
function parseInfo(data)
{
alert("getJSON worked");
}
</script>
</head>
<body>
<form action="getData.php" method="get">
Name: <input type="text" name="fname" />
<input type="submit" />
</form>
</body>
</code></pre>
| jquery | [5] |
959,205 | 959,206 | animating a simple jquery function | <p>I have a simple jquery function that resizes a table when it is clicked.</p>
<pre><code> <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$('.expand_table').live("click", function()
{
$('.expand_table').attr('width', 800);
});
});
</script>
</code></pre>
<p>How would I build on this to make the table smoothly expand or grow to the new size?</p>
| jquery | [5] |
5,065,688 | 5,065,689 | Comment code to explain "how" but does not explain "why"? | <p>When I was in a programming study course, I alway had a bad situation: Comment code to explain "how" but does not explain "why".</p>
<p>What I want to know is why re-run the code there is and why you chose to write it.</p>
<p>What can I do to fix this problem to improve my programming?</p>
| c# | [0] |
999,087 | 999,088 | == and is in python | <p>Its been a couple of days since I started learning python, at which point I stumbled across the <code>==</code> and <code>is</code>. Coming from a java background I assumed <code>==</code> does a comparison by object id and <code>is</code> by value, however doing </p>
<pre><code> >>> a = (1,2)
>>> b = (1,2)
>>> a is b
False
>>> a == b
True
</code></pre>
<p>Seems like <code>is</code> is equivalent of java's <code>==</code> and python's <code>==</code> is equivalent to java's <code>equals()</code>. Is this the right way to think about the difference between <code>is</code> and <code>==</code>? Or is there a caveat?</p>
| python | [7] |
2,796,223 | 2,796,224 | What does the colon ( : ) mean in this javascript line? | <p>What does the ":" mean in the 3-6th lines below? </p>
<pre><code>function displayError(error) {
var errorTypes = {
0: "Unknown error",
1: "Permission denied",
2: "Position is not available",
3: "Request timeout"
};
var errorMessage = errorTypes[error.code];
if (error.code == 0 || error.code == 2) {
errorMessage = errorMessage + " " + error.message;
}
var div = document.getElementById("location");
div.innerHTML = errorMessage;
}
</code></pre>
| javascript | [3] |
1,024,609 | 1,024,610 | String handle in C# | <p>I don't understand the use of "get" and "set" command, how to add a list of the accounts using the code below and someone give me some example to fix the error? Thanks! :(</p>
<pre><code> public class Account
{
public string UserName
{get rerurn textBox1.Test; // error
set UserName = textBox1.Text;} // error
public string Password { get; set; }
public string RePassword { get; set; }
public string Name { get; set; }
public string bd { get; set; }
public string dt { get; set; }
public string dc { get; set; }
}
public class ListAcc
{
static void Data()
{
List<Account> UserList = new List<Account>();
}
}
</code></pre>
<p>Okey, thanks everybody, i had fixed that error but if code:</p>
<pre><code> public class ListAcc
{
static void Data()
{
List<Account> UserList = new List<Account>();
//example of adding user account
Account acc = new Account();
acc.Username = textBox1.Text;
UserList.Add(acc);
}
}
</code></pre>
<p>there are a error from access to textBox1.Text? ( An object reference is required for the nonstatic field, method, or property)... Someone can help?</p>
| c# | [0] |
706,118 | 706,119 | Iterating over list or single element in python | <p>I would like to iterate over the outputs of an unknown function. Unfortunately I do not know whether the function returns a single item or a tuple. This must be a standard problem and there must be a standard way of dealing with this -- what I have now is quite ugly. </p>
<pre><code>x = UnknownFunction()
if islist(x):
iterator = x
else:
iterator = [x]
def islist(s):
try:
len(s)
return True
except TypeError:
return False
for ii in iterator:
#do stuff
</code></pre>
| python | [7] |
1,470,652 | 1,470,653 | Find Value in Array | <p>The following array is output from my db.</p>
<pre><code>$this->db->select('code')->from('table');
$array = $this->db->get()->result_array();
//Output:
Array ( [0] => Array ( [code] => ASDF123 ) [1] => Array ( [code] => ASDF124 ) )
</code></pre>
<p>How can I find if a variable is contained in this array?</p>
<p>ie. </p>
<pre><code>if(this_is_in_array($value, $array) == TRUE)...
</code></pre>
<p>What's the simplest way to to that with PHP?</p>
<p><strong>I sincerely apologize for not wording this correctly the first time.</strong></p>
| php | [2] |
1,669,513 | 1,669,514 | Rename Files in a Directory | <p>I have 400 files in a directory (with <code>.png</code> extensions). They start with the name <code>005.png</code> and go up to <code>395.png</code>.</p>
<p>I want to rename them using <code>os.rename</code>:</p>
<pre><code>os.rename(006.png,005.png)
</code></pre>
<p>In other words, I want to shift all the numbers down one, renaming the file <code>005.png</code> to <code>004.png</code> and renaming <code>395.png</code> to <code>394.png</code>, and so on.</p>
<p>I don't want to do this manually, because it would take too long:</p>
<pre><code>os.rename(005.png,004.png)
os.rename(006.png,005.png)
...
</code></pre>
<p>How can I do this simply? I am using the s60 2nd edition FP3.</p>
<p>Thanks in advance!</p>
| python | [7] |
4,550,490 | 4,550,491 | storing input from a seperate class | <p>I posted a question earlier for a homework assignment but I have a new question. I am new at this so I appreciate any help I can get and I'm not looking for code but more of an explanation of the steps I need to take to get to my answer.</p>
<p>I'm working on an address book. The user picks a menu 1, 2, or 3. I have a main class, a validation class, a class that declares set and get and a class that handles the IO functions.</p>
<p>I'm just learning classes so please be patient but basically I want to understand how to save the info if the user wants to enter a new person.
I have a setName and getName and a setPhoneNumber and getPhoneNumber in a class I also have the function to save everything written in the IO class that was provided. I don't understand what saves the information I guess is what I'm saying. Do I need to create a scanner for each line? or How do I send it to the right place?
Do I need to call the whole function that is in the IO class that handles the name and phone number? </p>
<pre><code> if(menuNumber == 2)
{
System.out.println("Enter name: ")
System.out.println("enter phone number: ")
}
</code></pre>
<p>Thank you in advance for any help. I'm taking classes online and so far java hasn't been an easy one. I want to understand it but I'm struggling through this book and my projects have a pretty quick turnaround so I want to learn it but I almost need to stop and ask for someone to break it down for me in english instead of staring at a diagram in a book.</p>
| java | [1] |
3,823,225 | 3,823,226 | JQuery - $this is not defined | <p>Trying to get this code to work but the error I am getting in firebug is <code>$this is not defined</code> and I don't understand why</p>
<p>To explain the background about this code I have a list of spans with identical classes so when I click on particular span I need to send an ajax request and update that particular span.</p>
<p>Hopefully that makes sense.</p>
<pre><code>$(document).ready(function() {
function postAndFade($node, post_key) {
var id = $node.parents('.id').find('.id-value').text();
var post_val = $node.text();
$node.fadeOut('slow');
$.ajax({
type: "POST",
url: "process.php",
data: "id="+id+"&"+post_key+"="+post_val,
success: function(data) {
$node.html(data);
$node.fadeIn('slow');
}
});
return false;
}
$('.featured-value').click(function() { return postAndFade($this, 'featured'); });
$('.visible-value').click(function() { return postAndFade($this, 'visible'); });
});
</code></pre>
| jquery | [5] |
5,369,472 | 5,369,473 | Is there such a thing as .charAt().contains()? | <p>Is there a way to to compare a single char in a string to another string? Here is an example:</p>
<pre><code>String a = "0123456789";
String b = "5 + 3 / 2";
if(b.charAt(0) == 'something in string a') {
// do something
}
</code></pre>
<p>or</p>
<pre><code>b.charAt(i).contains(a)
</code></pre>
| java | [1] |
2,859,139 | 2,859,140 | extract frames from a video file in android | <p>I am trying to extract frames from a video file in android. I have searched alot but couldn't find any clue about that. Is there any way we could do this? Could anyone please help me regarding this.</p>
| android | [4] |
1,834,001 | 1,834,002 | Filtering a set of items by data | <p>Say if've got a set of items with some data on them like this:</p>
<pre><code><li data-filtro="website, web app"><a href="trabajos.php?id=84"><img src="imgs/thumbs/item_tn_84.jpg" /></a></li>
<li data-filtro="website, banners"><a href="trabajos.php?id=131"><img src="imgs/thumbs/item_tn_131.jpg" /></a></li>
<li data-filtro="publicidad"><a href="trabajos.php?id=22"><img src="imgs/thumbs/item_tn_22.jpg" /></a></li>
<li data-filtro="publicidad"><a href="trabajos.php?id=45"><img src="imgs/thumbs/item_tn_54.jpg" /></a></li>
</code></pre>
<p>And to filter some of the by their data content matching the value of a variable named 'valor', I'd like to do something like</p>
<pre><code>var $set = $('li').filter(function(index){
return $(this).data('filtro').indexOf(valor) > -1;
});
</code></pre>
<p>But somehow I can't make it work ... do you guys have two minutes to open my eyes in this?
Thank you in advance!</p>
| jquery | [5] |
2,534,631 | 2,534,632 | Find htdocs path, no matter where file is stored | <p>How can I find my htdocs directory.</p>
<p>When I execute the following command:</p>
<pre><code>echo dirname(__FILE__);
</code></pre>
<p>I get the following output:</p>
<pre><code>/var/www/myexample.com/htdocs/required/css
</code></pre>
<p>I want to find path till /htdocs, but I don't want to hard-code the things</p>
<p>I know I can use:</p>
<pre><code>dirname(dirname(dirname(__FILE__)))
</code></pre>
<p>But, that will work if the current file is in "css" directory. If I will move to some other directory inside "css" directory, then it will not work.</p>
<p>Any solution for this?</p>
| php | [2] |
5,177,654 | 5,177,655 | Interviewstreet Triplet | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/13928575/interviewstreet-triplet-challenge">interviewstreet Triplet challenge</a> </p>
</blockquote>
<p>There is an integer array <code>d</code> which does not contain more than two elements of the same value. How many distinct ascending triples <code>(d[i] < d[j] < d[k], i < j < k)</code> are present? </p>
<p><strong>Input format:</strong></p>
<p>The first line contains an integer <code>N</code> denoting the number of elements in the array. This is followed by a single line containing <code>N</code> integers separated by a single space with no leading/trailing spaces</p>
<p><strong>Output format:</strong></p>
<p>A single integer that denotes the number of distinct ascending triples present in the array</p>
<p><strong>Constraints:</strong></p>
<pre><code>N <= 10^5
</code></pre>
<p>Every element of the array is present at most twice</p>
<p>Every element of the array is a 32-bit positive integer</p>
<p><strong>Sample input:</strong></p>
<pre><code>6
1 1 2 2 3 4
</code></pre>
<p><strong>Sample output:</strong></p>
<pre><code>4
</code></pre>
<p><strong>Explanation:</strong></p>
<p>The distinct triplets are</p>
<pre><code>(1,2,3)
(1,2,4)
(1,3,4)
(2,3,4)
</code></pre>
| java | [1] |
1,547,894 | 1,547,895 | JS listener for global var? | <p>I want to keep everything contained within a single function, and not make all the various variables global.</p>
<p>Is it possible to set up an event listener within the function main to watch a global var?</p>
<p>in this example call doTheStuff() when the index is altered? or might I be going about this the wrong way?</p>
<pre><code>var index = 0;
function main(data, data, data, data, data, data,)
{
fucntion one(){ two() }
function two(){ three() }
function three(){ }
function doTheStuff(){ }
}
</code></pre>
| javascript | [3] |
4,210,232 | 4,210,233 | How to inherit class name in PHP? | <p>How can I get the class name of the child class instead of the parent class? Both print <code>a</code>, but it should print <code>b</code> in the second <code>var_dump()</code>.</p>
<pre><code> <?php
class a
{
public $name;
public function __construct()
{
$this->name=get_class();
}
}
class b extends a
{
public function b()
{
parent::__construct();
}
}
$a= new a();
$b=new b();
var_dump($a); //prints a
var_dump($b); //prints a, i want to be printed b here
?>
</code></pre>
| php | [2] |
4,020,692 | 4,020,693 | 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] |
3,658,340 | 3,658,341 | In what version of jquery the autocomplete feature is introduced? | <p>I am using jquery 1.2.6 for the whole site but I am having difficulties in implementing jquery . Can anyone tell me in what version of jquery the autocomplete feature is brought and is there any process to upgrade the jquery of a older version to a newer version. For ex: upgrading from 1.2.6 ro 1.8. Is there any process to be followed.</p>
| jquery | [5] |
1,316,644 | 1,316,645 | Is it possible to use && and set a variable on same line? | <p>I'm using:</p>
<pre><code>MyTestFunction() && ExecuteMe();
</code></pre>
<p>for quick and easy conditional execution. I'd like to improve the code readability more in some places by creating:</p>
<ol>
<li><p>Single line guard statments I.E:</p>
<pre><code>MyTestFunction() && return;
//prevent execution of function early, but this isn't possible
</code></pre></li>
<li><p>Single line variable setters:</p>
<pre><code>MyTestFunction() && myVar = 5;
</code></pre>
<p>(I realise I can do <code>myVar = MyTestFunction() || 5</code>; but that's not what I want)</p></li>
</ol>
<p>Anyone see a nice way around this?</p>
| javascript | [3] |
1,248,729 | 1,248,730 | How to calculate different between two date()? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/676824/how-to-calculate-the-difference-between-two-dates-using-php">How to calculate the difference between two dates using PHP?</a> </p>
</blockquote>
<p>I have two time in this format: <code>date("Y-m-d H:i:s")</code>.
How can I calculate different between these two time?</p>
| php | [2] |
3,236,001 | 3,236,002 | Android: Launch new instance of application activity from home screen widget | <p>I have an app widget on the home screen which includes a button that launches a basic settings Activity.</p>
<p>When the user presses the Back button, if the main application has some activities in it's stack, the back press takes you to the most recently viewed Activity in the app, rather than back to the homepage. I've tried the following flags for my intent:</p>
<p><code>settingsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);</code></p>
<p><code>settingsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME);</code></p>
<p><code>settingsIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);</code></p>
<p>But no luck with any. Is there any flag or combination of flags I can use to do this? Thanks.</p>
| android | [4] |
1,481,304 | 1,481,305 | how to add uiview as a subview to existing view | <p>i want to add a uiview of smaller frame as subview to parental view but i am not getting the needed</p>
<p>uiview *view = [[uiview alloc] initwithFrame:something];
[self.view addsubview:view];</p>
<p>can anyone suggest me the answer</p>
| iphone | [8] |
5,850,699 | 5,850,700 | JavaScript variable to hold large numbers | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4288821/how-to-deal-with-big-numbers-in-javascript">How to deal with big numbers in javascript</a> </p>
</blockquote>
<p>Javascript does't hold numbers > 17 digits. is there any other way to put bigger number into a variable? apart from parsing it into string?</p>
<p>example: </p>
<pre><code>var x = 12647586984746263548565656;
alert(x);
</code></pre>
<p>Try this out. it wont work since x is a large number.</p>
| javascript | [3] |
2,252,195 | 2,252,196 | Printing row of a list | <p>I'm trying to label rows and columns of my matrix.</p>
<p>I can create columns but I can't seem to properly create rows </p>
<p>Here's what I've done:</p>
<pre><code>matrix = [[1,0,1],[1,0,1],[1,0,1]]
row = 0
col = 0
dim = len(matrix)
for i in range(dim):
print "\t", "col",i,
for r in range(0,dim):
print
for c in range(0,dim):
print "\t", matrix[r][c],
</code></pre>
<p>Anyone have a good idea?</p>
<p>This is the result i get</p>
<pre><code>col 0 col 1 col 2
1 0 1
1 0 1
1 0 1
</code></pre>
<p>I'm looking to print:</p>
<pre><code> col 0 col 1 col 2
row0 1 0 1
row1 1 0 1
row2 1 0 1
</code></pre>
| python | [7] |
1,443,518 | 1,443,519 | How to add validation to a form | <p>I would like to validate a form so that it checks if the user is logged in...</p>
<p>I have got a form with method and action given below:</p>
<pre><code><form method=get action="index.php">
</code></pre>
<p>What I would like to do is that when I click on proceed to checkout, this form should validate if user is logged in. If not it will redirect to login page. I am hoping to put my php code inn the form so that user do not proceed to checkout unless he is logged in.</p>
<p>I tried to use onclick"if (($_SESSION['user_name']) == "")" then it should redirect to login.php.</p>
| php | [2] |
3,617,922 | 3,617,923 | Dropdownlist with suggestions that match what you type in a textbox | <p>I have a dropdown list, a textbox and a button. If I types a word in the textbox and click the button then the dropdown list should select the list item according to that word in the textbox.</p>
<p>For example: If I type 23 then the dropdown should lists the item starting 23.</p>
| jquery | [5] |
3,832,598 | 3,832,599 | PHP list and checkboxes | <p>I want to make a list with checkboxes next each item. For some reason I can print the list but the checkboxes aren't showing up.</p>
<pre><code>$note = mysql_fetch_array( $note_content );
if($note['type'] == 'list')
{
$note_type='list';
print "<dl>";
while($note = mysql_fetch_array( $note_content ))
{
if($note['complete'])
echo "<strike>";
echo "<dt>".$note['body']."</dt>";
if($note['complete'])
echo "</strike>";
}
print "</dl>";
print "<dl style=\"float:right\">";
while($note = mysql_fetch_array( $note_content ))
{
echo "<dt>
<input type='checkbox' name='complete_goal' value='".$note['note_id']."'>
</input>
</dt>";
}
print "</dl>";
}
else
{
echo $note['body'];
}
</code></pre>
| php | [2] |
1,010,319 | 1,010,320 | Understanding Python daemon threads | <p>I've obviously misunderstood something fundamental about a Python Thread object's daemon attribute.</p>
<p>Consider the following:</p>
<pre><code>daemonic.py
import sys, threading, time
class TestThread(threading.Thread):
def __init__(self, daemon):
threading.Thread.__init__(self)
self.daemon = daemon
def run(self):
x = 0
while 1:
if self.daemon:
print "Daemon :: %s" % x
else:
print "Non-Daemon :: %s" % x
x += 1
time.sleep(1)
if __name__ == "__main__":
print "__main__ start"
if sys.argv[1] == "daemonic":
thread = TestThread(True)
else:
thread = TestThread(False)
thread.start()
time.sleep(5)
print "__main__ stop"
</code></pre>
<p>From the python docs: </p>
<blockquote>
<p>The entire Python program exits when
no alive non-daemon threads are left.</p>
</blockquote>
<p>So if I run with TestThread as a daemon, I would expect it to exit once the main thread has completed. But this doesn't happen:</p>
<pre><code>> python daemonic.py daemonic
__main__ start
Daemon :: 0
Daemon :: 1
Daemon :: 2
Daemon :: 3
Daemon :: 4
__main__ stop
Daemon :: 5
Daemon :: 6
^C
</code></pre>
<p>What don't I get?</p>
<hr>
<p>As guessed by Justin and Brent, I was running with Python 2.5. Have just got home and tried out on my own machine running 2.7, and everything works fine. Thanks for your helps!</p>
| python | [7] |
826,925 | 826,926 | Java equal and hashCode with non primitive types | <p><br>
I have a class with some non primitive members.</p>
<pre><code>class Relation {
String name;
Role roleFrom;
Role roleTo;
}
class Role {
RoleType roleType;
String details;
}
class RoleType {
String typeName;
String details;
}
</code></pre>
<p>Two relations are equal, when </p>
<ol>
<li>the name are equal</li>
<li>the role type (identified by unique typeName) are equal for the Role members (roleFrom and roleTo)</li>
</ol>
<p>How to write <code>equals</code> and <code>hashCode</code> for class <code>Relation</code>. When tried with Netbeans, it only displays 3 fields (<code>name</code>, <code>roleFrom</code> and <code>roleTo</code>). Is it because, one should not access the primitive types in roleFrom and roleTo (roleType -> typeName). Or, please show an implementation.</p>
<p>thanks.</p>
| java | [1] |
3,112,241 | 3,112,242 | Animating a toast in android? | <p>Am trying to animate my toast but have been unsuccessful so far. This is what I have in my <code>onCreate()</code>:</p>
<pre><code>ImageView image = new ImageView(this);
image.setImageResource(R.drawable.icon);
Animation move = new TranslateAnimation(0,100, 0, 100);
move.setDuration(2000);
move.setFillEnabled(true);
move.setFillAfter(true);
image.startAnimation(move);
Toast toast = new Toast(this);
toast.setView(image);
toast.show();
</code></pre>
<p>Have tried placing <code>startAnimation()</code> after displaying the toast, but that doesn't work either.</p>
| android | [4] |
5,966,109 | 5,966,110 | Determining if a query is in a string | <p>I have a list of query terms, each with a boolean operator associated with them, like, say:</p>
<pre><code>tom OR jerry OR desperate AND dan OR mickey AND mouse
</code></pre>
<p>Okay, now I have a string containing user-defined input, <code>inputStr</code>.</p>
<p>My question is, in Python, is there a way to determine if the string defined by the user contains the words in the "query"?</p>
<p>I have tried this:</p>
<pre><code>if ('tom' or 'jerry' or 'desperate' and 'dan' or 'mickey' and 'mouse') in "cartoon dan character desperate":
print "in string"
</code></pre>
<p>But it doesn't give the output i expect.
As you can see, I don't care about whether the query terms are ordered; just whether they are in the string or not.</p>
<p>Can this be done? Am I missing something like a library which can help me achieve the required functionality?</p>
<p>Many thanks for any help.</p>
| python | [7] |
4,366,568 | 4,366,569 | Setting text in activity using Button | <p>I was wondering what is the correct way to set the text of a TextView after a button has been pushed? I currently have an app that would change the text every time the activity was created (but for now it only sets the text as one value for testing purposes):</p>
<pre><code>public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mama);
TextView joke = (TextView) findViewById(R.id.TextView02);
joke.setText("This is a test");
Button nextButton = (Button) findViewById(R.id.Button01);
nextButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(JokesMamaActivity.this, JokesMamaActivity.class));
finish();
}
});
}
</code></pre>
<p>How would I be able to set the text without creating a new activity, and have the ability to continually change the text after the button has been clicked?</p>
| android | [4] |
1,487,999 | 1,488,000 | Javascript - execute after all images have loaded | <p>Having read other people's questions I thought </p>
<pre><code>window.onload=...
</code></pre>
<p>would answer my question. I have tried this but it executes the code the instant the page loads (not after the images load).</p>
<p>If it makes any difference the images are coming from a CDN and are not relative.</p>
<p>Anyone know a solution? (I'm not using jQuery)</p>
| javascript | [3] |
3,389,789 | 3,389,790 | jQuery: how do I activate a datepicker from an element that is separate from the input field that the datepicker inserts the date into? | <p>This does not work the way I want to. currently, the text field activates the datepicker. but I want the click of the button to activate the datepicker:</p>
<pre><code> <script type="text/javascript">
$j(function() {
$j(".prop-expiry input").datepicker({
showTrigger: '#exp-date-button'
});
});
</script>
</code></pre>
<p>This does, but I'd like to be able to use a hover image for the date select button (currently, it shows both the img, and the hover img... cause the png is a sprite.)</p>
<pre><code><script type="text/javascript">
$(function() {
$(".prop-expiry input").datepicker({
showOn: 'button',
buttonImage: '..images/btn_datepicker.png',
buttonImageOnly: true
});
});
</script>
</code></pre>
<p>And my field / button where I want the datepicker to show up:</p>
<pre><code><input class="input-field hasDatepicker"
id="object_expires_at"
name="object[expires_at]"
onclick="$j('.prop-expiry input').val('');
$j('.prop-expiry input').css('color', 'black');"
size="30" type="text"
value="Enter or pick a date">
<a id="exp-date-button" class="date-picker">Expiration Date</a>
</code></pre>
<p>What I want: user clicks a#exp-date-button </p>
<p>and then the datepicker appears.</p>
<p>ideas?</p>
| jquery | [5] |
2,040,125 | 2,040,126 | Valid Java Exception Handling - is it really required in all cases? | <p>I'm reading through the documentation <a href="http://docs.oracle.com/javase/tutorial/essential/exceptions/catchOrDeclare.html" rel="nofollow">here</a>. This example is what I'm questioning:</p>
<blockquote>
<p>The first kind of exception is the checked exception. These are
exceptional conditions that a well-written application should
anticipate and recover from. For example, suppose an application
prompts a user for an input file name, then opens the file by passing
the name to the constructor for java.io.FileReader. Normally, the user
provides the name of an existing, readable file, so the construction
of the FileReader object succeeds, and the execution of the
application proceeds normally. But sometimes the user supplies the
name of a nonexistent file, and the constructor throws
java.io.FileNotFoundException. A well-written program will catch this
exception and notify the user of the mistake, possibly prompting for a
corrected file name.</p>
</blockquote>
<p>In PHP I would check to see if the file exists prior to accepting it as valid user input with something like:</p>
<pre><code> if (file_exists($file)) {
//proceed
} else {
//throw error to user
}
</code></pre>
<p>Am I to understand from reading this that in Java you would just need to "assume" the file provided was valid, and use the exception handler to throw an error instead of just checking to see if it exists? Or is using an Exception a much cleaner/efficient way of checking to see if the file exists?</p>
| java | [1] |
5,891,101 | 5,891,102 | Python -- Save Objects Together in a Binary File? | <p>I have a <code>python</code> class that contains many objects -- some are data structures (<code>lists</code>, <code>dicts</code> etc) and some are handlers to other classes (that also contain other data structures...).</p>
<p>Rather than using <code>pickle</code> to save the entire class & its contents, I was wondering if there is a way to <code>serialize</code> the data of <em>several desired objects</em> and save them (ONLY them) in a binary file?</p>
<p>For example, suppose that I have the following 2 python objects:</p>
<pre><code>myList = [1, 2, 3, 4, 5]
myDict = {'a' : 14, 'b' : 5, 'c' : 65}
</code></pre>
<p>What is the best way to save the contents of BOTH of these <code>python</code> objects in a <strong>binary file</strong>? ideally, I'd like to save <em>both objects</em> in the same binary file, and be able to load the data later on.</p>
| python | [7] |
2,978,448 | 2,978,449 | Show submit button dynamically when email is valid | <p>I'm sure this should be easy, but I can't get it working.</p>
<p>html</p>
<pre><code><label for="email">Enter email for updates:</label>
<input type="text" name="email" id="email" placeholder="your@email.com" />
<button name="submit" type="submit">Submit</button>
</code></pre>
<p>js</p>
<pre><code>$(document).ready(function() {
$('button').hide();
$('input').keyup(function() {
if( !validateEmail(email) ){
$('button').show();
}
};
function validateEmail(email) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
return emailReg.test( email );
}
});
</code></pre>
<p>I'm not looking for it to be the best email validation, rather just a simple way to show users when form looks right.</p>
<p>Any help gratefully received.</p>
| jquery | [5] |
1,889,185 | 1,889,186 | Android in app billing - where to place the bind code | <p>I am going through this tutorial they have: developer.android.com/guide/market/billing/billing_integrate.html</p>
<p>and I am in this section "Binding to the MarketBillingService"</p>
<p>They give those code snippets there:</p>
<pre><code>try {
boolean bindResult = mContext.bindService(
new Intent("com.android.vending.billing.MarketBillingService.BIND"), this,
Context.BIND_AUTO_CREATE);
if (bindResult) {
Log.i(TAG, "Service bind successful.");
} else {
Log.e(TAG, "Could not bind to the MarketBillingService.");
}
} catch (SecurityException e) {
Log.e(TAG, "Security exception: " + e);
}
</code></pre>
<p>but I have no idea where to put them. Does it go in the Activity screen where the user presses the "buy" button? If so, what is the mContext object that they use? How do I unstantiate that? Is that like a button listener? Is this code meant to be in a button listener?</p>
<p>Thanks!</p>
| android | [4] |
3,077,939 | 3,077,940 | jquery: div hide/show on focus issue | <p>Thanks to <strong>inti's</strong> code I was able to figure out the answer! </p>
<p>jQuery:</p>
<pre><code>$(document).ready(function(){
$("body").click(function(e) {
//checks to see if the tag you clicked has the #login
//div as a parent.
if($(e.target).closest("#login").size() == 0) {
//makes exception for the #login's <a> tag (id of a_login)
if((e.target.id) == 'a_login') {
$("#login").show();
} else {
$("#login").hide();
}
//if target has #login as parent, keep it visible
} else {
$("#login").show();
}
});
});
</code></pre>
<p>Working jsfiddle example: <a href="http://jsfiddle.net/SuperPhil/3CmE7/" rel="nofollow">http://jsfiddle.net/SuperPhil/3CmE7/</a></p>
<p>Thanks!</p>
<hr>
<p>I am trying to have a login screen similar to the <a href="http://dropbox.com" rel="nofollow">http://dropbox.com</a> login. Where a user clicks on the login link and a div appears (CSS) and when focus out, disappears.</p>
<p>Here is my jQuery</p>
<pre><code>$('#login').bind('click', function() {
$('#login').addClass("clicked").focusout(function() {
$('#login').removeClass('clicked');
});
});
</code></pre>
<p>This doesn't work. Can anyone help me out?</p>
<p><strong>EDIT:</strong></p>
<pre><code>$('#login').click(function() {
$('#login div').addClass("clicked").blur(function() {
$('#login div').removeClass('clicked');
});
});
</code></pre>
| jquery | [5] |
5,624,806 | 5,624,807 | iPhone: screenshot | <p>Is there any method that calls in app when user made screenshot (hold home button + power) ???
Or which methods could be called ? Like applicationDidBecomeActive or something else ? Thanks...</p>
| iphone | [8] |
4,025,388 | 4,025,389 | android style is not taken into account | <p>I have a problem while creating styles in android:</p>
<p>When I use </p>
<pre><code>android:textAppearance="?android:attr/textAppearanceSmall"
</code></pre>
<p>in Button for instance, that's working fine, but if I create a styles.xml like:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="smalltext" parent="@style/Text">
<item name="android:textSize">10sp</item>
<item name="android:textColor">#FFF</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
</style>
</resources>
</code></pre>
<p>and replace in Button:</p>
<pre><code>style="@style/smalltext"
</code></pre>
<p>nothing is taken into account.</p>
<p>Would you have any idea of what could be wrong ?</p>
<p>thanks a lot,
Luc</p>
| android | [4] |
1,781,698 | 1,781,699 | integrated webview in android | <p>I am Android developer .I have integrated webview in android.In that application about chart.Chart is working well in 4.0 version.But we got data all from HTML via.Please help me how to make refresh data.</p>
<p>Thanks</p>
| android | [4] |
1,380,034 | 1,380,035 | selector for button not working | <p>I want to change the background of the button when the button is unclickable.I have used selector for that but it is not working in the case when the button remains unclickable.</p>
<p>This is the selector file:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:drawable="@drawable/button_lightgrey" />
<item android:state_pressed="true" android:state_enabled="true" android:drawable="@drawable/button_blue"/>
<item android:state_focused="true" android:drawable="@drawable/button_darkgreen" />
<item android:drawable="@drawable/button_lightgreen" />
</selector>
</code></pre>
<p>This is the button where i am using this selector file:</p>
<pre><code><Button
android:id="@+id/PrevButton"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:layout_marginLeft="5.0dip"
android:layout_weight="1.0"
android:background="@drawable/ibtn"
android:onClick="onPrevButtonClick"
android:text="Prev" />
</code></pre>
<p>Please help me.All other functions are working in the selector file but only the unclickable button case is not working.Thanks </p>
| android | [4] |
5,221,463 | 5,221,464 | PHP If Variable isset add input with checkbox checked not working | <p>I am having a problem with some code...</p>
<p>Here is the code:</p>
<pre><code><?php
if (isset($myVar)) {
echo '<input type="checkbox" name="ck1" id="ck1" checked />Checked/Not checked';
}
?>
</code></pre>
<p>I've tried checked, checked="checked" checked="true" ...but for some reason the checkbox doesn't come out checked.</p>
| php | [2] |
3,731,587 | 3,731,588 | Allocate space for char | <p>String construct got space for the data by doing</p>
<pre><code>new char[strlen(cp)+1];
</code></pre>
<p>Since there are only <code>strlen(cp)</code>characters in the string, what is the extra byte for?</p>
| c++ | [6] |
4,009,915 | 4,009,916 | How to reverse-engineer www.sryth.com | <p>At the risk of this topic getting voted down and or closed, and my reputation going into negative, I am opening this topic up to discussion in the hopes that it will yield a some useful insights.</p>
<p>I've been experimenting with www.sryth.com in order to glean how it might be implemented.</p>
<ul>
<li><p>Firstly I login and start off from www.sryth.com/game/index.php. (this has content on it like text and links)</p></li>
<li><p>Secondly, I open a link on the page in a new window. This brings up the address <a href="http://www.sryth.com/game/ci.php?f_c=set_pc_location2.inc&f_zoneid=4&f_sectionid=10561&f_previouszoneid=4&f_previoussectionid=1" rel="nofollow">http://www.sryth.com/game/ci.php?f_c=set_pc_location2.inc&f_zoneid=4&f_sectionid=10561&f_previouszoneid=4&f_previoussectionid=1</a></p></li>
</ul>
<p>for a split second before redirecting to the address <a href="http://www.sryth.com/game/ci.php?f_c=parser2.inc" rel="nofollow">http://www.sryth.com/game/ci.php?f_c=parser2.inc</a> (this page also has content on it like text and links).</p>
<p>Any guesses as to the implementation from what I have just described?</p>
| php | [2] |
34,856 | 34,857 | Two id's for javascript function | <p>I have a javascript function that goes like this:</p>
<pre><code>function change_one()
{
var one = document.getElementById("one").value;
document.getElementById("tag").value=one;
}
</code></pre>
<p>It works fine until there are two elements the same id.</p>
<p>I'm using php to fetch stuff from mysql and while it's looping thru, it's echoing input tags that have the same id value.</p>
<p>How I get this javascript code to apply to all of the input tags that have the id equal to "one"?</p>
| javascript | [3] |
3,438,980 | 3,438,981 | Extracting property names from a c# source file | <p>I want to parse a c# file. The only thing I want is to determine if it contains a property with a specific name; just a simple true/false response. Or rather, since I'd checking for more than one property in each run, extracting a list of property names could be helpful</p>
<p>I thought that I could create an elegant solution using the <code>CodeDomProvider</code> functionality (f# example):</p>
<pre><code>use reader = new StreamReader(existingFile)
let codeProvider = new CSharpCodeProvider()
let codeUnit = codeProvider.Parse(reader)
</code></pre>
<p>Unfortunately, the <code>Parse</code> function is not implemented for the <code>CSharpCodeProvider</code>. Is there a way to get a <code>CodeCompileUnit</code> from a source file? Or is there another elegant way? (I had hoped to avoid regular expressions on this)?</p>
<p>Edit:
I'm going to use this for automatic code generation. Basically, I'm going to generate a partial class in file xyz.partial.cs. This will generate a skeleton property. But if I want to change the implementation of a property, I will cut that property and paste it into the hand coded xyz.cs. When recreating the generated class, I want it to skip generating properties that I have moved to the hand-coded file.</p>
<p>Therefore, reflection is out of the question, because reflection will tell me that the property does indeed exists, but not if it is defined in the one or the other file.</p>
| c# | [0] |
16,507 | 16,508 | PHP Learning Curve | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3487276/what-to-do-after-learning-basic-php">What to do after learning basic PHP?</a><br>
<a href="http://stackoverflow.com/questions/2948323/how-to-increase-my-advanced-knowledge-of-php-further-quickly">How to increase my “advanced” knowledge of PHP further? (quickly)</a> </p>
</blockquote>
<p>Hi,</p>
<p>I started learning PHP about this time last month and i now know how to create websites using basic php. I would like to further my knowledge but i dont know which way to turn. </p>
<p>I've heard of frameworks like codeigniter, zend, cakePHP but dont know what use they are for. Should they be my next step? Im currently using NetBeans. </p>
<p>I look at other php scripts and how their directly structure is tidy and sorted into folders whereas all my files are on the root level. How do i learn to create a script structure correctly? </p>
<p>I would also like to learn how to use templates, do the frameworks help with this?</p>
<p>Also, I learned Java at college. So should OO PHP be my next step?</p>
<p><strong>Basically, what is the road map for going from a beginner to master?</strong></p>
| php | [2] |
13,683 | 13,684 | C++ init member variables with multiple constructors | <p>Usually a constructor should look like this:</p>
<pre><code>//ctor1
SmallSim::SmallSim()
:mSimInit(false)
,mServersCreated(false)
,mTotalCPUTime(0)
{
...
}
</code></pre>
<p>What happens if I have multiple constructors?</p>
<p>It looks to me that If I call the first constructor from my second, the member vars in the first do not get initialized.</p>
<pre><code>//ctor2
SmallSim::SmallSim(bool ImmediateExecution, bool Report)
{
SmallSim();
...
}
</code></pre>
<p>So do I need to repeat
:mSimInit(false)
,mServersCreated(false)
,mTotalCPUTime(0)
on every constructor I have? </p>
<p>As far as I know using an InitClassVars() is not the best way to go...</p>
<pre><code>//ctor1
SmallSim::SmallSim()
{
InitClassVars();
...
}
//ctor2
SmallSim::SmallSim(bool ImmediateExecution, bool Report)
{
InitClassVars();
...
}
//Common function for init of member vars for multiple constructors
void SmallSim::InitClassVars(void)
{
mSimInit = false;
mServersCreated = false;
mTotalCPUTime = 0;
}
</code></pre>
<p>Is there a correct way to Init the member vars with out repeating the init on every constructor?</p>
| c++ | [6] |
3,392,076 | 3,392,077 | How to Send C++ Struct Message from C# Socket? | <p>This is the C++ Message that i need to pass from C#:</p>
<pre>
struct LoginMessage:public NMessage
{
char szUser[ 16 ];
char szPass[ 16 ];
LoginMessage()
{
msgId = CTRL_SESSION_LOGIN;
msgSize = sizeof( LoginMessage );
}
};
struct NMessage
{
DWORD msgSize;
union
{
DWORD msgId;
struct
{
BYTE msgId0;
BYTE msgId1;
BYTE msgId2;
BYTE msgId3;
};
};
NMessage()
{
}
BOOL IsLegal()
{
return msgSize>=sizeof(NMessage) && msgSize
</pre>
<p>What is the equivalent of this in C# so that C++ can understand this message?
Sample code is greatly appreciated.</p>
| c# | [0] |
2,057,868 | 2,057,869 | DateTime, minutes since update? | <p>I have this DateTime object (update) which is set to DateTime.now, when i update my application.</p>
<p>I also have this timerTick event, called on every 5 seconds which should check how many minutes ago, update was.</p>
<p>I've tried with:</p>
<pre><code>if ((DateTime.Now - Updated).Minutes > 0)
{
updateTextBlock.Text = "updated " + ((DateTime.Now - Updated).Minutes).ToString() + " minutes ago";
}
</code></pre>
<p>But it does not seem to work correctly. Isn't there a better way to do this?</p>
<p>/R</p>
| c# | [0] |
2,995,880 | 2,995,881 | Does running separate python processes avoid the GIL? | <p>I'm curious in how the Global Interpreter Lock in python actually works. If I have a c++ application launch four separate instances of a python script will they run in parallel on separate cores, or does the GIL go even deeper then just the single process that was launched and control all python process's regardless of the process that spawned it? </p>
| python | [7] |
2,021,969 | 2,021,970 | How to impose interface? | <p>How I should make sure that classes needed as a one of params to my templated class will have a certain interface? I know that one way is to make in Interface class pure virtual but I would like to avoid it. Is there any other way to do it? I would like to avoid anything which isn't standard</p>
<pre><code> //Example
template<class SomePolicy>
class My
{
void fnc()const
{
SomePolicy::mustHaveThisInterface();//<--here I have to have
// this interface in orded to work
}
};
</code></pre>
| c++ | [6] |
1,121,893 | 1,121,894 | Bind event to all "select" dropdownlist elements | <p>I have a form with a variable amount of "select" dropdownlists and textboxes. I want to bind the <code>.change()</code> event to only the "select" elements. I've tried <code>$(":input").change()</code> but binds the <code>.change()</code> event to all the inputs. Is there something like <code>$(":text")</code> or a way to specify the <code>$(":input")</code> to only target "select" elements?</p>
| jquery | [5] |
4,874,400 | 4,874,401 | merge all the elements in a list python | <p>I have a list of string like:</p>
<pre><code>s = [("abc","bcd","cde"),("123","3r4","32f")]
</code></pre>
<p>Now I want to convert this to the following:</p>
<pre><code>output = ["abcbcdcde","1233r432f"]
</code></pre>
<p>What is the pythonic way to do this?
THanks</p>
| python | [7] |
226,740 | 226,741 | Do I *always* have to check for null after a safe cast? | <p>Quick question; do I always need to check for a null value after performing a safe cast? I do it this way now, but in a situation like this:</p>
<pre><code>void button1_Click(object sender, EventArgs e)
{
Button = sender as Button;
if (button != null) // <-- necessary?
{
// do stuff with 'button'
}
}
</code></pre>
<p>I am just wondering if I am not thinking of something. I check for null every time out of habit, but in a case like this I think that I would prefer a crash if a non-Button object was hooked up to a handler that should only be for buttons. </p>
<p>EDIT: OK, thanks guys. I was just curious if there was an angle that I was missing.</p>
| c# | [0] |
1,829,389 | 1,829,390 | Location object Javascript | <p>I've got a php file inside this folder structure:</p>
<p>Web -> script -> gen.php</p>
<p>From this gen.php I want to redirect with the <code>location()</code> function in Javascript to</p>
<p>Web->Index.html</p>
<p>I tried to do it like this:</p>
<pre><code>location = "localhost/Web/index.html"
</code></pre>
<p>But I only get a <code>404 error</code> saying that this path is invalid. What is the correct way to do this? </p>
| javascript | [3] |
5,780,128 | 5,780,129 | Creating objects in Java question | <p>In PHP, to create a new object you would do something like this, <code>$dog = new Dog;</code>. But in Java you would do something like, <code>Dog x = new Dog;</code> or <code>Dog x;</code>. Could someone explain why you need to say the Dog class in front of the variable?</p>
| java | [1] |
2,700,952 | 2,700,953 | Python shelve with already opened file | <p>Is it possible to use shelve with a file that is already opened? I'd like to do something like the following, but shelve.open doesn't accept a file descriptor.</p>
<pre><code> f = open('file.shelve')
s = shelve.open(f)
</code></pre>
| python | [7] |
3,318,171 | 3,318,172 | Android:Playing bigger size audio wav sound file produces crash | <p>I am trying to play the bigger size audio wav file(which is >20 mb) using the following code(AudioTrack) on my Android 1.6 HTC device which basically has less memory. But i found device crash as soon as it executes reading, writing and play. But the same code works fine and plays the lesser size audio wav files(10kb, 20 kb files etc) very well.
P.S: I should play PCM(.wav) buffer sound, the reason behind why i use AudioTrack here.</p>
<p>Though my device has lesser memory, how would i read bigger audio files bytes by bytes and play the sound to avoid crashing due to memory constraints.</p>
<pre><code>private void AudioTrackPlayPCM() throws IOException
</code></pre>
<p>{</p>
<p>String filePath = "/sdcard/myWav.wav"; // 8 kb file</p>
<p>byte[] byteData = null;<br>
File file = null; </p>
<p>file = new File(filePath);</p>
<p>byteData = new byte[(int) file.length()];</p>
<p>FileInputStream in = null;</p>
<p>try {
in = new FileInputStream( file );
in.read( byteData );
in.close(); </p>
<p>} catch (FileNotFoundException e)
{</p>
<p>// TODO Auto-generated catch block
e.printStackTrace();</p>
<p>}</p>
<p>int intSize = android.media.AudioTrack.getMinBufferSize(8000, AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_8BIT); </p>
<p>AudioTrack at = new AudioTrack(AudioManager.STREAM_MUSIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_8BIT, intSize, AudioTrack.MODE_STREAM); </p>
<p>at.play();</p>
<p>at.write(byteData, 0, byteData.length);<br>
at.stop();</p>
<p>at.release();</p>
<p>}</p>
<p>Could someone guide me please to play the AudioTrack code for bigger size wav files?</p>
| android | [4] |
4,798,566 | 4,798,567 | Create Android library | <p>I've written a library (game engine) and would like to use it for my apps and games that I'll be creating. </p>
<p>I see there are two ways to add libraries to your code:</p>
<ol>
<li>Export to jar and add that to build path</li>
<li>Have it as a project file its self, and simply add project to build path.</li>
</ol>
<p>I've tried the second method, yet I get a:</p>
<blockquote>
<p>Unable to instantiate activity error</p>
</blockquote>
<p><strong>Stack trace:</strong></p>
<blockquote>
<p>[2012-07-15 21:06:08 - ScienceProject] ------------------------------
[2012-07-15 21:06:08 - ScienceProject] Android Launch! [2012-07-15
21:06:08 - ScienceProject] adb is running normally. [2012-07-15
21:06:08 - ScienceProject] Performing
com.webstorms.scienceproject.ScienceProjectActivity activity launch
[2012-07-15 21:06:08 - ScienceProject] Automatic Target Mode: using
existing emulator 'emulator-5554' running compatible AVD 'HVGA'
[2012-07-15 21:06:09 - ScienceProject] Application already deployed.
No need to reinstall. [2012-07-15 21:06:09 - ScienceProject] Project
dependency found, installing: WSGameEngine [2012-07-15 21:06:10 -
WSGameEngine] Application already deployed. No need to reinstall.
[2012-07-15 21:06:10 - ScienceProject] Starting activity
com.webstorms.scienceproject.ScienceProjectActivity on device
emulator-5554 [2012-07-15 21:06:12 - ScienceProject] ActivityManager:
Starting: Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER]
cmp=com.webstorms.scienceproject/.ScienceProjectActivity }</p>
</blockquote>
| android | [4] |
879,562 | 879,563 | Retrieving a closest node to the caret position | <p>I have a document (inside editable iframe),<br>
I need to retrieve a closest node to the caret position, not the parent node, but the sibling node (so they must have same parent) that is located (when available) left to the caret position(collapsed selection).</p>
<p>The node can be any node, like text node, paragraph, div and etc.<br>
Note: the browser is <strong>not</strong> IE.</p>
<p>I have this for now:</p>
<pre><code> var content = document.getElementById('iframedocument').contentWindow;
var selection = content.getSelection();
var range = selection.getRangeAt(0);
</code></pre>
| javascript | [3] |
1,832,521 | 1,832,522 | Trouble understanding instance variable | <p>Here is the definition:</p>
<p>In object-oriented programming with classes, an instance variable is a variable defined in a class (i.e. a member variable) // I get this part</p>
<p>, for which each object of the class has a separate copy. // This part I don't get.</p>
<p>How can an object have a seperate copy? a seperate copy of what?</p>
<p>Sorry for asking basic questions, I'm still a noob.</p>
<p>Thank you</p>
| c++ | [6] |
4,299,688 | 4,299,689 | xmlHttpRequest.send(Params) not working in tomcat 7 | <p>I am trying to send some parameters through xmlHttpRequest.send(params) written in a JS file to my servlet where I try to get the parameters by req.getParameter("some_Parameter"); it returns null on the servlet. though if i send the parameters by appending them in url it works fine. but when the url will be large it will break the code. so please someone help me out.</p>
<p>Thanks in advance. </p>
<pre><code>function doHttpPost(theFormName, completeActivity)
{
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
var xmlMessage = buildPOST(theFormName, completeActivity);
var responseTxt;
try {
xmlhttp.Open(document.forms[theFormName].method, document.forms[theFormName].action+'?'+xmlMessage, false);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
responseTxt = xmlhttp.responseText;
}
}
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
enableDisableLinks(true);
setPointer();
xmlhttp.Send();
if(xmlhttp.Status != 200) {
alert("Post to server failed");
}
} catch (e) {
responseTxt = "Exception while posting form data: Error No: " + e.number + ", Message: " + e.description;
}
resetPointer();
enableDisableLinks(false);
var expectedTxt = "Form Data had been successfully posted to the database."
if(responseTxt.toString() == expectedTxt.toString()) {
// MNP: New requirement from Jeanne, should not refresh CM page, commenting it off for now
//if(completeActivity) {
// if (typeof (ViewCaseDetailBtn) != 'undefined') {
// ViewCaseDetailBtn.click();
// }
//}
return true;
} else {
alert (responseTxt);
}
return false;
}
</code></pre>
| javascript | [3] |
461,150 | 461,151 | android.annotation.SuppressLint undefined | <p>I am new to Android trying to use Linphone pluging in Android getting android.annotation.SuppressLint undefined erorrs after importing this API.
The attribute value is undefined for the annotation type TargetApi PlusApi.java
please help!!</p>
| android | [4] |
5,248,149 | 5,248,150 | does explode get executed more than once in a foreach? | <pre><code>$array='hello hello2';
foreach(explode(' ',$array) as $v)
echo $v;
</code></pre>
<p>How many times does explode get executed?</p>
<p>And is it better that to use another var like:</p>
<pre><code> $exploded = explode(...);
foreach($exploded as $v)
...
</code></pre>
<p>?</p>
| php | [2] |
4,991,908 | 4,991,909 | Reading a text file word by word | <p>I have a text file containing just lowercase letters and no punctuation except for spaces. I would like to know the best way of reading the file char by char, in a way that if the next char is a space, it signifies the end of one word and the start of a new word. i.e. as each character is read it is added to a string, if the next char is space, then the word is passed to another method and reset until the reader reaches the end of the file.</p>
<p>I'm trying to do this with a StringReader, something like this:</p>
<pre><code>public String GetNextWord(StringReader reader)
{
String word = "";
char c;
do
{
c = Convert.ToChar(reader.Read());
word += c;
} while (c != ' ');
return word;
}
</code></pre>
<p>and put the GetNextWord method in a while loop till the end of the file. Does this approach make sense or are there better ways of achieving this?</p>
| c# | [0] |
4,509,836 | 4,509,837 | Math result should be zero but is slightly off compared to direct substitution | <p>Update: Thanks guys, I didn't realize it was very close to zero but not exactly zero. Is there a way around it so my program sees it as a zero? Its throwing my results off because this value is not being picked up as a zero.
Update2: figured it out, adding:</p>
<pre><code>from decimal import *
getcontext().prec = 6
</code></pre>
<p>and then Decimal(number) fixed it.Thanks everyone!</p>
<p>I am running a simple piece of code but was getting a weird result with a specific number. Its a bit strange because when I run the same command in the python terminal I get the result I expect.</p>
<p>I made the print statement, the command its running so I could copy/paste it in the interpreter(python 2.7) to see if the results are the same. Here's the program:</p>
<pre><code>x = 20
for s in range(100 + 1):
for c in range(100+1):
if s == 7:
print s, '-', (c*0.01), '*', x, ' = ', (s - (c*0.01) * x)
</code></pre>
<p>The results look fine except one:</p>
<pre><code>7 - 0.33 * 20 = 0.4
7 - 0.34 * 20 = 0.2
7 - 0.35 * 20 = -8.881784197e-16
7 - 0.36 * 20 = -0.2
7 - 0.37 * 20 = -0.4
</code></pre>
<p>When I copy/paste <code>7 - 0.35 * 20</code> into the interpreter I get 0.0 which is what I would expect(the other results in the program seem fine, except 7 - 0.35 * 20 and(not shown) a similar value with 14.</p>
<p>I'm a bit stumped, I'm not what's going on here.</p>
| python | [7] |
5,300,364 | 5,300,365 | Sending email from asp.net 3.5 using vb.net | <p>Dim mail As New MailMessage</p>
<pre><code> Mail.Subject = CtxtMessage.Text
Mail.To.Add("admin@gmail.com")
Mail.From = New MailAddress("abcd@gmail.com")
Mail.Body = "good work"
Dim smtp As New SmtpClient("smtp.gmail.com")
smtp.EnableSsl = True 'Secured conn
smtp.Credentials = New System.Net.NetworkCredential("abcd@gmail.com", "") 'authentication of sender
smtp.Port = "587" 'port no for sending
smtp.Send(Mail)
</code></pre>
<p>Using this only gmail users can send the mails to admin.. But what do i need to add so that yahoo or any other users can send mail to admin?</p>
| asp.net | [9] |
4,023,414 | 4,023,415 | Sticky slide menu using jquery | <p>often many site developing sticky slide menu. the menu slide out from bottom right and when user click on close button it does not close rather it's size become small. menu has title always like "Recommended for you".</p>
<p>i was looking for this type of menu and search google for any jquery plug-in exist or not but found none. so here i am giving the url just go there and scroll down to bottom then a menu comes from bottom-right side. i just need that same type of menu. so tell me way to develop same one like it or if same kind of menu code already exist and if anyone aware of that then plzz share the site link.</p>
<p><a href="http://www.1stwebdesigner.com/freebies/wordpress-theme-jquery-and-ajax/" rel="nofollow">enter link description here</a></p>
<p><a href="http://jquerybyexample.blogspot.com/2011/05/how-to-set-focus-on-first-textbox-of.html" rel="nofollow">enter link description here</a></p>
<p>thanks</p>
| jquery | [5] |
3,427,570 | 3,427,571 | protect (encrypt) password in the web.config file (asp.net) | <pre><code> <system.net>
<mailSettings>
<smtp from="email@domain.com" deliveryMethod="Network">
<network clientDomain="www.domain.com" host="smtp.live.com" defaultCredentials="false" port="25" userName=" email@domain.com " password="password" enableSsl="true" />
</smtp>
</mailSettings>
</system.net>
</code></pre>
<p>This is the case where I need encryption for my password. I searched and googled much on the web but I can’t be able to encrypt anymore. </p>
<p>Can anyone help me do this in a simple but secure way.</p>
| asp.net | [9] |
1,693,263 | 1,693,264 | PHP not writing client IP to file | <p>I cant figure out why it wont write the client IP address to the file, everything else works.</p>
<pre><code><?php
$myFile = "ips.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
fwrite($fh, $_SERVER['REMOTE_HOST']);
fclose($fh);
echo $_SERVER['REMOTE_ADDR'];
?>
</code></pre>
<p>Thanks in advance.</p>
| php | [2] |
2,900,870 | 2,900,871 | Rejection from Apple because "This game is not recognize by Game Center" | <p>I just got a rejection from Apple because they are having the error message: "This game is not recognize by Game Center".
I have been testing (with many others) the game for weeks using Game Center and nobody ever had that error. All provisioning profiles have GC enable, is has been submitted with GC enabled, achievements and leaderboard checked out.
In the ITunes Connect, the reviewer told me: "The review was conducted while logged into a valid Game Center account, however, the error alert was still displayed."</p>
<p>Has anyone ever had that type of issue in submitting a game?
Also, the app was reviewed on a saturday, could it be a rookie reviewing it?</p>
<p>Thanks in advance.</p>
<p>Patrick</p>
| iphone | [8] |
5,124,071 | 5,124,072 | Trying to create an alarm using rtc ans i2c on Atmega64 but having a query | <p>I have to create a clock and calendar with rtc using i2c which I have done and it is working fine. But I want to implement a multiple alarms feature in this program. Now when I do add an alarm for a specific time for the buzzer to start ringing, the time is not displayed until the buzzer stops! So since my buzzer rings for 2 seconds my time skips three seconds in the display screen which is not what I want. Is there any way in which my buzzer can continue to ring while the time is displayed continuously. Kind of like multi-threading? Thanks for the help guys.</p>
| jquery | [5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.