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,515,530 | 4,515,531 | jQuery order by date in data attribute | <p>If i have this markup:</p>
<pre><code><p data-date="Fri, 26 Aug 2011 20:58:39 GMT">item 1</p>
<p data-date="Fri, 24 Aug 2011 20:58:39 GMT">item 1</p>
<p data-date="Fri, 25 Aug 2011 20:58:39 GMT">item 1</p>
</code></pre>
<p>How could i use jQuery to order these P's by their data-date attribute?</p>
<p>Thanks</p>
| jquery | [5] |
3,189,887 | 3,189,888 | jQuery popup dialog when user loading images | <p>Basically I want a modal windows popup with loading indicator when a user first come to the site and then it will disappear after all the images are loaded. Any plugin or way to do it?</p>
| jquery | [5] |
551,140 | 551,141 | How to simplify this jQuery expression? | <pre><code>$country.parent().parent().next().children('td').children('.province-select')
</code></pre>
<p>Basically I have some HTML that looks like this:</p>
<pre><code><table>
<tr>
<th>country</th>
<td><select name="country"/></td>
</tr>
<tr>
<th>province</th>
<td><select class="province-select"/></td>
</tr>
</table>
</code></pre>
<p>Once I've nabbed the country <code>select</code>, I need to find the next <code>.province-select</code>. <em>Would be nice</em> if it's little more robust to subtle HTML changes. </p>
<p>AFAIK <code>next()</code> only finds siblings, and <code>closest()</code> only traverses up the DOM tree.</p>
<hr>
<p>I have a few of these all in the same table. That's why I'm using all this parent/next garbage. I don't want to use IDs because... well, then the script will only work on one specific country/province pair; I need it to run on all of them; thus I need to find the corresponding province field for the country field.</p>
| jquery | [5] |
2,904,172 | 2,904,173 | map api in android | <p>I need to use map in my Android application. There are many Android platforms. Do I need Google APIs for maps or will Map work for all platforms? I am getting an error when I change platforms from Google APIs to Android 2.2.</p>
| android | [4] |
983,082 | 983,083 | Verbose Log Message appeared from inside Android | <p>I have just switch back to the Android build after a while away to fix some final issues. However when I run my build I get this message spammed constantly:</p>
<pre><code>AudioHardwareMSM7X30( 1267): AudioStreamOutMSM72xx::getParameter route=8
</code></pre>
<p>This looks very similar (other than the 1267 which is a line number?) to a message in AudioHardware.cpp that I found at..</p>
<p><a href="http://vogue-android.googlecode.com/hg/eclair2.0" rel="nofollow">vogue-android.googlecode.com/hg/eclair2.0</a></p>
<p>I am running on a Evo Shift with the stock OS, not rooted or anything. Could someone tell me where this message is coming from and how to shut it off?</p>
| android | [4] |
564,492 | 564,493 | multiple jquery extensions on the same page cause an error, solutions anybody? | <p>I am using IE 8, have got a web page with 2 jquery extensions (one is a menu, the other one is a fency textbox). When I run each of the extensions alone they work fine, when I run them together I get the following js error:</p>
<p>Error: Object doesn't support this property or method</p>
<p>I am registring the handlers in the following way:</p>
<p>The Textbox:</p>
<pre><code><script type="text/javascript">
$().ready(function() {
$('#ctl00_Main_Status1_tbStatus').textboxhelp({ help: 'I am thinking of a...' });
});
</script>
</code></pre>
<p>The Menu:</p>
<pre><code><script type="text/javascript">
$(function() {
alert('in menu');
$("#1, #2, #3").lavaLamp({
fx: "backout",
speed: 700,
click: function(event, menuItem) {
return false;
}
});
});
</script>
</code></pre>
<p>Any help would be greatly appriciated, I am very new to the jquery...</p>
| jquery | [5] |
2,934,502 | 2,934,503 | what does dot and net means? | <p>What is the meaning of dot in asp.net and what is the meaning of net?</p>
| asp.net | [9] |
4,174,307 | 4,174,308 | jquery syntax .css() with a var | <pre><code>var foo = "/someimage.png"
$('#client_bg').css("background", "url(foo)");
</code></pre>
<p>What is the proper syntax for this?</p>
| javascript | [3] |
3,480,853 | 3,480,854 | How to pass array to function without variable instantiation, in C++ | <p>Can I do this in C++ (if yes, what is the syntax?):</p>
<pre><code>void func(string* strs) {
// do something
}
func({"abc", "cde"});
</code></pre>
<p>I want to pass an array to function, without instantiating it as a variable. Thanks for suggestions.</p>
| c++ | [6] |
2,057,251 | 2,057,252 | why we can't override the variables in java | <p>why we can't override the variables in java , It hides variable </p>
<pre><code>class A {
int a = 4;
public void test(){
System.out.println("Test method of A" );
}
}
class B extends A {
int a = 5;
public void test(){
System.out.println("Test method of B" );
}
public static void main(String s[]){
A a= new B();
System.out.println("Value of a : " a.a );
System.out.println("Method result " a.test() );
}
}
</code></pre>
<p>Output ::</p>
<pre><code>Value of a : 4
Mthod result :Test method of B
</code></pre>
<p>As the B's class test method get called but variable was accessed from super class reference</p>
| java | [1] |
1,122,722 | 1,122,723 | How to make an option in select box readonly not disabled using jquery? | <p>How to make an option in select box readonly not disabled using jquery? I have a multiple select box for selecting roles and a single select primary role.</p>
<p>Now i want to make the selected option in primary role to automatically checked in roles multiple select box in read only mode.</p>
<p>Any help will be appreciated</p>
| jquery | [5] |
4,917,952 | 4,917,953 | jQuery slider fails to load on first page load? | <p>The slider on my home page has a mind of it's own and rarely loads correctly when i first go to the website. <a href="http://www.dailyshowbusiness.com" rel="nofollow">http://www.dailyshowbusiness.com</a></p>
<p>The slider should have 1 large image with the 3 smaller (choices) images below, usually when i type the domain and press enter all i can see is the 3 smaller images, but not the main image.</p>
<p>Now if i click on another page and then click on home the plugin loads correctly.</p>
<p>Why is it not loading the first time. Any ideas?</p>
<p>Thanks.</p>
| jquery | [5] |
1,100,177 | 1,100,178 | Python how to match files to templates | <p>I'm looking to match many files against some common templates, and extract the differences. I'd like suggestions on the best way to do this. For example:</p>
<p>Template A:</p>
<pre><code><1000 text lines that have to match>
a=?
b=2
c=3
d=?
e=5
f=6
<more text>
</code></pre>
<p>Template B:</p>
<pre><code><1000 different text lines that have to match>
h=20
i=21
j=?
<more text>
k=22
l=?
m=24
<more text>
</code></pre>
<p>If I passed in file C:</p>
<pre><code><1000 text lines that match A>
a=500
b=2
c=3
d=600
e=5
f=6
<more text>
</code></pre>
<p>I'd like an easy way to say this matches template A, and extract 'a=500', 'd=600'.</p>
<p>I could match these with a regex, but the files are rather large, and building that regex would be a pain.</p>
<p>I've also tried difflib, but parsing the opcodes and extracting the differences doesn't seem optimal.</p>
<p>Anyone have a better suggestion?</p>
| python | [7] |
1,950,232 | 1,950,233 | Javascript: Removing first text line if string starts with certain characters | <p>I wrote a script for some text manipulation, and want to add a function so that the first line of my input string is removed if it starts with the symbol '>'. I tried to find a solution for hours now, but I cannot get it to work: Somehow the first line is not removed properly.</p>
<p>My input text should be processed as it is if it looks like this:
"<code>HABHHIKKLLMMNMNIL</code>"
and the first line should be removed if it looks like this:
"</p>
<pre><code>>some text
HABHHIKKLLMMNMNIL
</code></pre>
<p>"</p>
<p>My current solution would look like this:</p>
<pre><code>// remove first line if starts with '>'
if (sequence_str.substring(0) === '>'){
// break the textblock into an array of lines
var lines = sequence_str.split('\n');
// remove one line, starting at the first position
lines.splice(0,1);
// join the array back into a single string
var sequence_str = lines.join('\n');
}
sequence_str = sequence_str.replace(/(\r\n|\n|\r)/gm,""); //remove linebreaks
</code></pre>
<p>I would appreciate any ideas, and I hope some could help me to figure out where the problem is.</p>
<p>Thanks!</p>
| javascript | [3] |
3,657,042 | 3,657,043 | Installing a Library (dotless) | <p>Trying to install <a href="http://www.dotlesscss.org/" rel="nofollow">http://www.dotlesscss.org/</a> to my project and I'm a bit stuck on step 2</p>
<ol>
<li>Include our reference to your web project</li>
</ol>
<p>where do I put these files and how do I include this "reference"?</p>
| asp.net | [9] |
3,705,148 | 3,705,149 | Automatically update an android app without requiring user interaction | <p>From what I gather, android apps are updated by downloading the apk from the android market, and having the user confirm the update. I also gather that the app needs user confirmation before the update can push through if the droid isn't rooted. I want to know if it's possible to update an app in an unrooted phone remotely, without requiring any user interaction, with the app being located on a non-market server. </p>
<p>Right now, I only know about installing apps via the marketplace, and through adb. Are there other ways, perhaps?</p>
| android | [4] |
5,042,558 | 5,042,559 | ASP.net Using a Session Varriable to move a GridView SelectedDataKey to another page | <p>Help please!</p>
<p>I am pulling out what little hair I have left over this and can't find an answer.</p>
<p>I am attempting to move the selected row in a grid view to another page and use the SelectedDataKey or the primary key value of the selected row to indicate what data should be displayed in a grid view on another page. This is the last little bit of a school project that I can't figure out.</p>
<p>What I am doing on the first page is to use a button click event to set a session variable that looks something like this. Session["Select"] = GridView1.SelectedDataKey; The button will then send the user to the next page. Response.Redirect("CustomerAccounts.aspx");</p>
<p>Once on the next page I want to use the primary key selected on the first page to show only the data with a coresponding value on the second page by using a where statement in the next gridview. So I am setting the [CustomerID]=? Session("Session["Select"])</p>
<p>Am I setting up the where correctly in the second gridview? </p>
| asp.net | [9] |
1,821,473 | 1,821,474 | ShareIntent: add more than one link | <p>I want to share a link on facebook, the following works fine:</p>
<pre><code>sendIntent = new Intent(android.content.Intent.ACTION_SEND);
sendIntent.setType("text/plain");
sendIntent.putExtra(android.content.Intent.EXTRA_TEXT, "<a href=\"my url\">my url</a>");
shareIntent = Intent.createChooser(sendIntent, "Share it!");
</code></pre>
<p>but I'd like to add another link at the end, "shared via my app, download it at google play link" I think it would be nice...is there a way to achieve this?</p>
| android | [4] |
1,742,957 | 1,742,958 | Is there any way to run code on the client in ASP.NET? | <p>As the title says, how would I go about doing this? I want to check a value stored in a file.</p>
| asp.net | [9] |
4,538,903 | 4,538,904 | How i call NSObject method in UIViewController class method? | <p>I am the beginner in iphone development.
I develop an application in which i calling some GPS related information(method name is getGPSInformation{}) in clsGPS{} is an pure NSObject class.The code is as follows,</p>
<pre><code>#import "clsGPS.h"
-(void)getGPSInformation
{
locationManager = [[CLLocationManager alloc ] init];
locationManager.delegate = self;
locationManager.distanceFilter = 5.0f;
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
[locationManager startUpdatingLocation];
}
</code></pre>
<p>I want the above method calling in UIViewController class. How i call this method in UIViewController class from that i automatically call this method at application launching time?
should i calling that method in viewDidLoad event or viewWillAppear method? </p>
| iphone | [8] |
1,752,385 | 1,752,386 | multiple android developer accounts with one google account | <p>I wish to create multiple android developer accounts with one google account so that 'ownership' is with one google account. Is that possible?</p>
| android | [4] |
4,861,022 | 4,861,023 | how to get the name of .png file programtically+iphone | <p>I want to get the name of image(.png) which is in uiimageview.</p>
<p>Example : -</p>
<pre><code>TouchImageView *touchImageView = [[TouchImageView alloc] initWithFrame:CGRectMake(0, 53, 70, 70)];
touchImageView.image = [UIImage imageNamed:@"Circle.png"];
</code></pre>
<p>Now in somewhere in code i want to get that tounchImageview is having the image name Cirlce.png </p>
<p>How can i get that. Please help me</p>
| iphone | [8] |
1,995,799 | 1,995,800 | How do you write code at home? | <p>At work I use Visual Studio 2005 and Resharper and I love them. However, I have an idea for an open source project that I want to work on from home and independently from my day job but I don’t want to have to shell out thousands of pounds for VS 2005 and resharper.</p>
<p>I've looked at the C# express edition products and Sharpdevelop. The express edition products don’t support unit testing so they’re out. Sharpdevelop looks like my best option but lacks the shine of VS 2005.</p>
<p>My question is; how do you guys do this? Do you (can you legally) reuse your work licenses at home? Or do people bite the bullet and pay for personal licenses or use the aforementioned free/open source products? </p>
| c# | [0] |
3,553,627 | 3,553,628 | iPhone - is @2x valid for UIWebView? | <p>I have this UIWebView on my app that shows a local html file. Do the images on that web view follow the @2x rule? I mean, if I build both, the regular and the @2x images will the webview load the retina ones for the iPhone 4?</p>
<p>remember that the images are being loaded by the HTML tag , not by any UIImage method.</p>
<p>thanks. </p>
| iphone | [8] |
2,156,547 | 2,156,548 | Disable activity slide-in animation when launching new activity? | <p>I have an activity which launches another activity, via a button click. By default, on newer OS versions of android, the OS will animate the new activity sliding in from right to left.</p>
<p>Is there a way to disable this animation? I just want the new activity to appear without any sort of animation.</p>
<p>Thanks</p>
| android | [4] |
2,997,229 | 2,997,230 | setting html select with jquery val() with its innerhtml | <p>I am trying to set the selected attribute on a select pull down with jquery val(). I only have the caption (aka innerhtml) of the element I want the selected, but not the value.
For example:</p>
<p>A pulldown of states. I want the "New york" option to be selected. I want to write a jquery statement which does</p>
<pre><code>$("#pull-down").val([get value of the option tag which has "New York" as its innerhtml])
</code></pre>
<p>Is this possible?</p>
| jquery | [5] |
927,361 | 927,362 | How to drawText along the oval path with relative RectF parameters | <p>I want to drawText along the oval path.Below is the code snippet. It is observed that with RectF parameters 0.1f,0.1f,0.9f,0.9f the text is not being drawn.Pls provide feedback.</p>
<pre><code>protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
float scale = (float) getWidth();
canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.scale(scale, scale);
canvas.drawColor(Color.WHITE);
Paint ovalpaint = new Paint();
ovalpaint.setFlags(Paint.ANTI_ALIAS_FLAG);
ovalpaint.setColor(Color.CYAN);
RectF oval = new RectF(0.1f,0.1f,0.9f,0.9f);
canvas.drawOval(oval, ovalpaint);
Path rim= new Path();
rim.addOval(oval,Direction.CW);
Paint paint = new Paint();
paint.setColor(Color.BLUE);
paint.setTextSize(30);
paint.setAntiAlias(true);
canvas.drawTextOnPath("Hi I am visible", rim, 0, 30, paint);
}
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
int chosenWidth = chooseDimension(widthMode, widthSize);
int chosenHeight = chooseDimension(heightMode, heightSize);
int chosenDimension = Math.min(chosenWidth, chosenHeight);
setMeasuredDimension(chosenDimension, chosenDimension);
}
</code></pre>
<p>private int chooseDimension(int mode, int size) {</p>
<pre><code> if (mode == MeasureSpec.AT_MOST || mode == MeasureSpec.EXACTLY) {
System.out.println("in if");
return size;
} else { // (mode == MeasureSpec.UNSPECIFIED)
System.out.println("in eles");
return 300;
}
}
</code></pre>
<p>}</p>
| android | [4] |
5,235,147 | 5,235,148 | Session problem in IE | <p>I have written two functions <code>setSes()</code> and <code>getSes()</code> and here I have written <code>session_start()</code>.Its wroking for all browser except IE.</p>
<pre><code>function setSes(){
$res=mysql_fetch_assoc(mysql_query("select * from table1 limit 1"));//data from DB
$_SESSION['ses1']=$res['name'];//Its not working .... $res['name']='Raj'
$_SESSION['ses1']="priyabrata";//Its working
}
function getSes(){
session_start();
print"<pre>";
print_r($_SESSION);
}
</code></pre>
<p>please get some ideas</p>
| php | [2] |
2,658,404 | 2,658,405 | How to check if webview failed to load page (android)? | <p>I have a webview in my app, however sometimes due to connectivity the webview fails to load and I get the default webpage unavailable page. I want to show an alertdialog if the webview failed to load. Is there anyway I can check (maybe in the shouldOverridePageLoad function) that a webview loaded successfully? Thanks again</p>
| android | [4] |
154,851 | 154,852 | Creating a variable from a large, complicated section of html | <p>I have several large (200+ lines) of html that I need to place in a variable to use several times in a loop. It gets very messy to escape this and that and keep formatting clean. Is there anyway to set a variable like this IF statement?</p>
<pre><code><?php if($condition): ?> <p>html here</p> <?php endif; ?>
</code></pre>
<p>I know its possible with external files, but Id rather not add a series of includes to achieve this.</p>
| php | [2] |
5,750,509 | 5,750,510 | Define a function isVowel(char) that returns True if char is a vowel ('a', 'e', 'i', 'o', or 'u'), and False otherwise | <p><strong>Question:</strong></p>
<p>Define a function isVowel(char) that returns True if char is a vowel ('a', 'e', 'i', 'o', or 'u'), and False otherwise. You can assume that char is a single letter of any case (ie, 'A' and 'a' are both valid).</p>
<p>Do not use the keyword in. Your function should take in a single string and return a boolean.</p>
<p><strong>Code Given:</strong></p>
<pre><code>def isVowel(char):
'''
char: a single letter of any case
returns: True if char is a vowel and False otherwise.
'''
</code></pre>
<p><strong>My Code:</strong></p>
<pre><code>def isVowel(char):
'''
char: a single letter of any case
returns: True if char is a vowel and False otherwise.
'''
if char == 'a' or 'e' or 'i' or 'o' or 'u' or 'A' or 'E' or 'I' or 'O' or 'U':
return True
else:
return False
</code></pre>
<p><strong>My Problem:</strong>
My output is always True. What am I doing wrong?</p>
| python | [7] |
2,548,118 | 2,548,119 | Remove last dynamically added row | <p>I did some all day learning and I figured out how to add rows dynamically for my form with jquery. But now I can't for the life of me figure out how to remove that last added row.</p>
<pre><code>$('#btnAdd').click(function() {
var num = $('.clonedInput').length;
var newNum = new Number(num + 1);
var newElem = $('#input' + num).clone().attr('id', 'input' + newNum);
newElem.children('.client').attr('id', 'client' + newNum).attr('name', 'client' + newNum);
newElem.children('.color').attr('id', 'color' + newNum).attr('name', 'color' + newNum);
$('#input' + num).after(newElem);
$('#btnDel').attr('disabled','');
if (newNum == 5)
$('#btnAdd').attr('disabled','disabled');
});
<form id="myForm">
<div id="input1" style="margin-bottom:4px;" class="clonedInput">
<select name="client" id="client" class="client">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<input type="text" name="color" id="color" class="color"/>
</div>
<div>
<input type="button" id="btnAdd" value="Add Row" />
</div>
</form>
</code></pre>
<p>And on jsFiddle for your viewing pleasure: <a href="http://jsfiddle.net/P8bTz/1/" rel="nofollow"><strong>Demo</strong></a></p>
<p><strong>Answer</strong> <em>Courtesy of <strong>Blender</em></strong></p>
<pre><code>$('#btnRemove').on('click', function() {
$('.clonedInput').last().remove();
});
</code></pre>
| jquery | [5] |
2,244,831 | 2,244,832 | How to refactor the following code without killing OOPS in C# | <p>I have 3 interfaces with 2 methods each doing the same job.</p>
<pre><code>Interface A
{
Void M1()
Void M2()
}
Interface B
{
Void M1()
Void M2()
}
Interface C
{
Void M1()
Void M2()
}
</code></pre>
<p>Now, There are 3 classes implementing each of these interfaces.</p>
<pre><code>Public Class A1:A
{
Public void M1()
{
}
Public void M2()
{
}
}
Public Class B1:B
{
Public void M1()
{
}
Public void M2()
{
}
}
Public Class C1:C
{
Public void M1()
{
}
Public void M2()
{
}
}
</code></pre>
<p>Functionality of M1 and M2 is exactly same in 3 classes. Interfaces are a part of library, I cannot change the interface and also cannot declare a new interface.</p>
<p>I want to refactor this code so that this duplication can be removed. I thought of creating a common class containing this functionality and then calling common class from each of these classes. </p>
<p>Please suggest.</p>
| c# | [0] |
4,523,849 | 4,523,850 | jQuery clone li and its children | <p>I'm trying to clone one <code>li</code> and its children and then append it to another <code>div</code>. My problem is I can only seem to get the anchor tags in the <code>li</code> tags and not the actual <code>li</code> structure. I'm using <code>contains</code> to find the correct <code>li</code> to clone. I know first is the wrong function to use but what I need to do is get the previous <code>li</code> and its children where <code>currentCategory</code> is found. I created JSfiddle to show it clearer <a href="http://jsfiddle.net/2EE2J/" rel="nofollow">http://jsfiddle.net/2EE2J/</a></p>
<pre><code>$(document).ready(function () {
var currentCategory = $(".Breadcrumb ul li:last").text();
$(".SideCategoryListFlyout li a:contains('" + currentCategory + "')").first().clone().appendTo("#test");
});
</code></pre>
<p>I am getting this:</p>
<pre><code><a href="link">link</a>
<a href="link">link</a>
<a href="link">link</a>
</code></pre>
<p>I want this:</p>
<pre><code><ul>
<li class=""><a class="sf-with-ul" href="">Belts<span class="sf-sub-indicator"> »</span></a><ul style="visibility: hidden; display: none;">
<li><a href="">Casual Belts</a></li>
<li><a href="">Jean Belts</a></li>
</ul>
</code></pre>
| jquery | [5] |
977,532 | 977,533 | possible for an iPhone app to make the iPhone "go dark" for a specified number of minutes? | <p>Can an iPhone app be made to stop all calls and text messages for a specified number of minutes, that is, prevent the user from making or getting calls and messages? Can an app turn the device off temporarily? Context: help kids to concentrate while doing their homework/studying and not be interrupted with calls and text-messages from their schoolmates.</p>
| iphone | [8] |
5,213,435 | 5,213,436 | Why is my overriden sendActionsForControlEvents: never called? | <p>The UIControl documentation clearly states:</p>
<blockquote>
<p>When a user touches the control in a
way that corresponds to one or more
specified events, UIControl sends
itself sendActionsForControlEvents:.</p>
</blockquote>
<p>So what I did is pretty simple. I created a UIControl subclass, and overrided this, like this:</p>
<pre><code>- (void)sendActionsForControlEvents:(UIControlEvents)controlEvents {
[super sendActionsForControlEvents:controlEvents];
NSLog(@"- (void)sendActionsForControlEvents:(UIControlEvents)controlEvents");
}
</code></pre>
<p>Then I instantiated my custom UIControl and added a action-target-thing like this:</p>
<pre><code>MyCustomControl *twb = [[MyCustomControl alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 80.0f, 80.0f)];
twb.backgroundColor = [UIColor yellowColor];
[twb addTarget:self action:@selector(anyTouch:) forControlEvents:UIControlEventAllTouchEvents];
[self addSubview:twb];
</code></pre>
<p>also, I implemented that -anyTouch: method for the selector, like this:</p>
<pre><code>- (void) anyTouch:(id)sender {
NSLog(@"anyTouch");
}
</code></pre>
<p>What happens: I touch the view from that control, and -anyTouch throws out the "anyTouch" log messages while I am touching around on it. But even though I subclassed UIControl and overrided that sendActionsForControlEvents:, I don't get the log message like I should. That makes no sense. I've overwritten it. It should log that message, damn it. %!§$%</p>
| iphone | [8] |
2,921,146 | 2,921,147 | Draw and move a point over an image in python | <p>Hi all I have to do a little script in Python.
In this script I have a variable (that represents a coordinate) that is continuously updated to a new value.
So I have to draw a red point over a image and update the point position every time the variable that contains the coordinate is updated.</p>
<p>I tried to explain what I need doing something like this but obviously it doesn't works:</p>
<pre><code>import Tkinter, Image, ImageDraw, ImageTk
i=0
root = Tkinter.Tk()
im = Image.open("img.jpg")
root.geometry("%dx%d" % (im.size[0], im.size[1]))
while True:
draw = ImageDraw.Draw(im)
draw.ellipse((i, 0, 10, 10), fill=(255, 0, 0))
pi = ImageTk.PhotoImage(im)
label = Tkinter.Label(root, image=pi)
label.place(x=0, y=0, width=im.size[0], height=im.size[1])
i+=1
del draw
</code></pre>
<p>someone may help me please? thanks very much!</p>
| python | [7] |
3,835,514 | 3,835,515 | how to get the current position of image view during animation in iphone | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4422500/how-to-get-uiview-frame-origin-and-size-while-animation">How to get UIView frame origin and size while animation</a> </p>
</blockquote>
<pre><code> -(void)anothertarget1
{
UIImage *uranus=[UIImage imageNamed:@"red-ball1.png"];
imagev=[[UIImageView alloc]initWithFrame:CGRectMake(5, 10, 100, 100)];
imagev.alpha=0.6;
imagev.image=uranus;
[self.view addSubview:imagev];
CGPoint goal = CGPointMake(self.view.center.x+70,self.view.center.y+24);
CGPoint center=imagev.center;
NSLog(@"center=%f",center);
UIViewAnimationOptions opt = UIViewAnimationOptionAllowUserInteraction;
[UIView animateWithDuration:20 delay:0 options:opt animations:^{
//forimageview1;
imagev.center = goal;
} completion:^(BOOL f) {
imagev.hidden=YES;
}];
}
</code></pre>
<p>i want to make an object which get the current position of <code>UIImageview</code> during animation
please help me</p>
| iphone | [8] |
2,677,007 | 2,677,008 | how to display a date as 2/25/2007 format in javascript, if i have date object | <p>how to display a date as 2/25/2007 format in javascript, if i have date object</p>
| javascript | [3] |
969,004 | 969,005 | Add nib into UIScrollView | <p>I am having troubles with the UIScrollView.</p>
<p>I have a file called: ExhibitionViewController.h / m and a nib ExhibitionView.xib in which I have placed a UIScrollView.</p>
<p>I have a file called ExhibitionSubViewController.h / .m and ExhibitionSubView.xib which I would like to display within that UIScrollView and I cannot seem to get it to work.</p>
<p>What would be the correct code to do that?</p>
| iphone | [8] |
5,201,509 | 5,201,510 | Done is not working in softKeyboard in Autocomplete TextView in android | <p>I have One AutocompleTextView and I want to make the virtual keyboard disappear when he hits "DONE" at the AutocompleTextView. So far, the buttons "NEXT"/"DONE" do nothing at all.... Unfortunately I found no resources addressing this problem.</p>
<p>Any suggestions? thanks in advance</p>
| android | [4] |
1,940,818 | 1,940,819 | JavaScript real-time validation | <p>I have a website for mobile subscribers, and i want the field where they enter their phone numbers to accept only "numbers" and the numbers should be only 7 digits, no more, no less. So if they try to input non-integer sign it'll be auto removed/will not even show up... How to achieve that?</p>
| javascript | [3] |
5,743,284 | 5,743,285 | how to design a windows appication using c# to execute command line from lightscribe? | <p>hI Guys,</p>
<p>Do you all have any idea on how to design a windows appication using c# to execute command line from lightscribe? any help would be grateful</p>
| c# | [0] |
5,227,561 | 5,227,562 | Accessing <a> inside div id | <p>im trying to color the <code><a></code> background color</p>
<pre><code><div id="contact"><a href="mailto:name@.domain.net>name</a>
</code></pre>
<p>with the selector </p>
<pre><code>$('#contact a').css("background", "red");
</code></pre>
<p>however im not successfull, where is my error?</p>
| jquery | [5] |
826,267 | 826,268 | Split in series PHP | <p>i have this string <code>++++++1DESIGNRESULTSM25Fe415(Main)</code></p>
<p>and i have similar string about 2000 lines from which i want to split these..</p>
<pre><code>[++++++] [1] [DESIGNRESULTS] [M25] [Fe415] [(Main)]
</code></pre>
<p>from the pattern only the 2nd 4h and 5th value changes </p>
<p>eg.. <code>++++++2DESIGNRESULTSM30Fe418(Main)</code> etc..</p>
<p>what i actually want is:</p>
<ol>
<li>Split the first value [++++++]</li>
<li>Split the value after 4 Character of [DESIGNRESULTS] so ill get this [M25]</li>
<li>Split the value before 4 Character of [(Main)] so ill get this [Fe415]</li>
<li>After all this done store the final chunk of piece in an array.</li>
</ol>
<p>the similar output what i want is</p>
<pre><code>Array ( [0] => 1 [1] => M25 [2] => Fe415 )
</code></pre>
<p>Please help me with this...</p>
<p>Thanks in advance :)</p>
| php | [2] |
809,894 | 809,895 | Why does my 32-bit application not access the 32-bit registry hive? | <p>I have a C# application that calls: </p>
<pre><code>Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\MyApp")
</code></pre>
<p>It is set to target x86, and when I run it I can see from Task Manager that it is a 32-bit process. However that line of code is strangely going to the 64-bit hive at HKCU\Software\MyApp, instead of the 32-bit hive at HKCU\Software\Wow6432Node\MyApp. Any ideas?</p>
<p>I also started two instances of Powershell, one 32-bit and one 64-bit, and ran the below but both return the values at the 64-bit hive too.</p>
<pre><code>get-itemproperty -Path Registry::HKEY_CURRENT_USER\Software\MyApp
</code></pre>
<p>Any ideas what might have gone wrong here? I have triple-checked that the registry settings at the 32 and 64 bit hives are different from regedit too.</p>
| c# | [0] |
1,918,418 | 1,918,419 | How to convert unicode symbols to ascii-safe equivalents in PHP | <p>User may input character like Ā Ē ú, how to remove that mark and become A E u in php</p>
<p>Thanks</p>
| php | [2] |
5,731,361 | 5,731,362 | Sending HTML E-mails with Attachment for Android | <p>I'm trying to use <a href="http://stackoverflow.com/questions/4345032/how-to-send-a-simple-email-programatically-exists-a-simple-way-to-do-it">this solution</a> but Eclipse still cant resolve "Attachment" and "DataService". </p>
<p>I've imported mail.jar and activation.jar, what could I be doing wrong? I've tried countless other sending email solutions on SO/Google but I couldn't get any of them to work with my attachment and send HTML emails. </p>
<p>Any help would be appreciated.</p>
| android | [4] |
1,578,239 | 1,578,240 | Removing higher layer | <p>I want to remove 8th layer upper than this layer.</p>
<p>so I wrote this code : <a href="http://jsfiddle.net/3JaGg/" rel="nofollow">http://jsfiddle.net/3JaGg/</a>
this code work now, but I want to know is there any better way ?</p>
<p>because I use <code>parent()</code> for 8 times.</p>
<pre><code>$(this).parent().parent().parent().parent().parent().parent().parent().parent().remove();
</code></pre>
<p>Note: I use many DIVs because I want rounding the corners with CSS2</p>
| jquery | [5] |
1,415,734 | 1,415,735 | How to show messageBox/ alert in asp.net? | <p>How can i show a messageBox in my asp.net page? (i write with c#)
whice lines i need to write?</p>
| asp.net | [9] |
1,728,514 | 1,728,515 | Impossible to write something on a field | <p>I have build a sort of split view for one of my android applications. I have made an activity which is a container of a listview and a framelayout. I use the listview for a menu and in my framelayout, I load views of different activities. I have read the source code of the <a href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/TabHost.java" rel="nofollow">TabHost</a> for building this system.</p>
<p>Activities that I load in my framelayout could contain a webview.</p>
<p>The system work pretty well but I have a big issue. When I click on a field in a webview, the soft keyboard doesn't appear and typing on the physical keyboard has no affect.</p>
<p>I have made many many researches and I found nothing :'( I really appreciate if somebody could give me an idea for solving this issue.</p>
| android | [4] |
3,369,178 | 3,369,179 | how to send email from android emulator without using intents? | <p>I have tried with javaApi to send email.It is working well.but I need to send email without giving password and also not only to gmail but yahoo and others such as hotmail,rediff etc..how can I acheive this?pls give some ideas..</p>
| android | [4] |
4,997,090 | 4,997,091 | how to find out if csv file fields are tab delimited or comma delimited | <p>how to find out if csv file fields are tab delimited or comma delimited. I need php validation for this. Can anyone plz help. Thanks in advance.</p>
| php | [2] |
4,928,049 | 4,928,050 | How can I show a set of images as a slide show in android? | <p>How can I show a set of images as a slide show in android?</p>
| android | [4] |
1,368,349 | 1,368,350 | compile souce code of android in cygwin | <p>i have several problem:</p>
<ol>
<li><p>if i modify Email app ,if i can use cygwin to compile.if yes how to compile,if no if i can compile in VMware Workstation with Ubuntu.</p></li>
<li><p>if i modify framework resources,if i can use cygwin to compile.if yes how to compile,if no if i can compile in VMware Workstation with Ubuntu.</p></li>
<li><p>how to combile whole source code ,if i can use cygwin or VMware Workstation with Ubuntu</p></li>
</ol>
<p>every one can give me some guide or link and so on</p>
| android | [4] |
5,633,017 | 5,633,018 | Execute 'adb' from an APK | <p>Planning to execute 'adb' to do some operation from an TestActivity.Java and try to execute the TestActivity.apk.</p>
<pre><code>File wd = new File("/Android/android-sdk-windows/tools/");
Process proc = Runtime.getRuntime().exec(
"adb shell monkey -p com.sample.cts -v 50", null, wd);
proc.waitFor() ;
</code></pre>
<p>Getting error - java.io.IOException: Error running exec(). Command: [adb, shell, monkey, -p, com.sample.cts, -v, 5000] Working Directory: null Environment: null</p>
<p>Can you please help me on this?</p>
| android | [4] |
4,903,265 | 4,903,266 | C# Sending buttonclicks to same Object | <p>I have a lot of buttons in my project. To make the program I shorter need to get every click of a button to the same "Button_click" method. Is this possible? </p>
<p>Thanks </p>
| c# | [0] |
4,333,299 | 4,333,300 | reset selectOneMenu javascript | <p>The following code resets one selectOneMenu through particular id. How to make it dynamic for more selectOneMenus to reset at the top value.</p>
<pre><code>var test= document.getElementById('form1:text3');
test.options.selectedIndex=0;
</code></pre>
<p>This resets to top value of menu, but how to make it dynamic.</p>
<p>ANy help is appreciated.</p>
| javascript | [3] |
645,756 | 645,757 | Get intersected Rect! | <p>I found the following function CGRectIntersectsRect (frame1,frame2)
which returns true if they are intersected.
Is there another function that returns the intersected Rect?</p>
| iphone | [8] |
5,785,610 | 5,785,611 | How to display show message to user after Response.close? | <p>In my asp.net web application i have to convert resx file to excelfile and then i should provide an option to download the converted file. I have done the download function using response.Addheader method. Now i wanted to display statics to the user of how many keys are converted from resx file to excel file. </p>
<p>I have placed an label to display no of keys migrated but the code is not exceuted after response.end. Pls help me to get this done</p>
<p>Thanks
Rm</p>
| asp.net | [9] |
5,494,169 | 5,494,170 | jquery and highslide | <p>I use this js <a href="http://highslide.com" rel="nofollow">http://highslide.com</a>.
I have a separate div and i want open the highslide with this div with onclick event..
I have try this but not work..</p>
<p><pre><code>
$('#po').click(function(){
var s = $('#ap_1');
return hs.expand(s, config1);
});
</pre></code></p>
<p><code>#ap_1</code> is the first a tag element ...</p>
| jquery | [5] |
2,086,006 | 2,086,007 | Wait method confusion | <p>I have a confusion with wait() method of thread class. It is known that wait() method is called from a synchronized context always. But after execution of wait method, will that thread release the lock on that object which it was holding.</p>
<p>I mean to ask that "When a thread goes to wait pool of an object, before going will it release the lock it has."</p>
| java | [1] |
5,160,132 | 5,160,133 | What does $obj = new BlahBlahName($_GET); do? | <p>I know that we use GET function to get the variables from the url in php when we use the GET method to pass data across pages or within the same page.</p>
<p>However </p>
<pre><code>$obj = new BlahBlahName($_GET);
</code></pre>
<p>what does this do? </p>
| php | [2] |
5,095,096 | 5,095,097 | How to get if an element is in view? | <p>In my application I want to use:</p>
<pre><code>element.scrollIntoView()
</code></pre>
<p>To make sure the element is inside the viewport, it works.</p>
<p>However, I found that it may cause some problem, for example when an element is inside the viewport and then I set it 'into view'. Then the scroll bar will move accordingly, this is not what I expected.</p>
<p>So, I want to make sure the element is not inside the viewport, then call the <code>scrollIntoView</code>.</p>
<p>How to get if the element is inside the viewport or not?</p>
| javascript | [3] |
1,541,019 | 1,541,020 | how can we link UITableview in tab bar controller? | <p>i have coded in applicationdidfinishing method in appdelegate.m file.RtbfViewController,infoViewController are UItableviewcontrolleras.but when i click HOME tab,it does not show table.what i have to do? anyone can help?</p>
<pre><code>tabBarController = [[UITabBarController alloc] init];
RtbfViewController *rtbfViewController = [[RtbfViewController alloc]
initWithStyle:UITableViewStyleGrouped];
rtbfViewController.tabBarItem.title = @"HOME";
InfoViewController *infoViewController = [[InfoViewController alloc]
initWithStyle:UITableViewStyleGrouped];
infoViewController.tabBarItem.title = @"INFO";
tabBarController.viewControllers = [NSArray arrayWithObjects:
rtbfViewController,infoViewController,nil];
tabBarController.customizableViewControllers = [NSArray arrayWithObjects:nil];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
</code></pre>
| iphone | [8] |
4,408,316 | 4,408,317 | android: pass kernel input event /dev/input/event* to java | <p>how can I create java events from an new input device on an android device?</p>
| android | [4] |
1,572,533 | 1,572,534 | How does this code to vaidate email work? | <p>This code validates your email field, but I can't understand how it works.</p>
<pre><code>NSString *e = email.text;
NSString *emailRegEx =@"(?:[a-z0-9!#$%\\&'*+/=?\\^_`{|}~-]+(?:\\.[a-z0-9!#$%\\&'*+/=?\\^_`{|}"
@"~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\"
@"x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-"
@"z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5"
@"]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-"
@"9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21"
@"-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])";
NSPredicate *regExPredicate =[NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegEx];
BOOL myStringMatchesRegEx = [regExPredicate evaluateWithObject:e];
NSLog(@"myStringMatchesRegEx = %d ",myStringMatchesRegEx);
</code></pre>
| iphone | [8] |
356,092 | 356,093 | How to solve this hover out issue | <p>I am trying to apply a hover in and hover out effect on a button and a div will popup above the hovered button. The popup div will disappear if user hover out of the button.</p>
<p>My problem is that when the popup div pops and the button's hover out event will kick in because the popup div is hovered at the moment.</p>
<pre><code>$('.helpImg').hover(function(){
$(this).css({'cursor': 'pointer'});
tooltip = $(this).next().attr('id');
$('#tool').show(150);
}, function (){
$(this).css({'cursor': 'auto'});
$('#tool').hide(50);
})
</code></pre>
<p>the #tool div will hide right after I click the button becasue the div is above the button and it's considered 'hover out'</p>
<p>Anyway to solve this?? Thanks .</p>
<p><strong>Updated Code</strong></p>
<pre><code> $('.helpImg').hover(function(){
$(this).css({'cursor': 'pointer'});
toolid=$(this).next().attr('id');
$('#tooltip-' + toolid).show(150);
},function (){
$('#toolip-' + toolid).hide(150);
})
</code></pre>
<p>I can't hardcode my popup <code>div</code> because I don't know the ID unless I hover my <code>helpImg</code> element. </p>
| jquery | [5] |
2,825,207 | 2,825,208 | Android findViewById is returning NULL | <p>sometime I have a strange problem with my xml views and contained sub elements in Android Eclipse SDK.</p>
<p>For example, I have a xml view called main.xml with a LinearLayout and a TextView as only child, with the id <em>textView1</em>. Everything works fine for a (long) time. When doing some major code changes, it <strong>might</strong> happen, that <code>findViewById(R.id.textView1);</code> starts returning <em>null</em>. Recompilation does not change anything. That is strange.</p>
<p>After some time I found a workaround... I copied <em>main.xml</em> to <em>main2.xml</em> and changed <code>setContentView(R.layout.main)</code> to <code>setContentView(R.layout.main2)</code> and everything was working fine againg, without changing anything other than the layout reference, even the layout itself was only copied. No content was modified. After the first working run, I can delete <em>main2.xml</em> and set the layout back to <code>R.layout.main</code>. No more NullPointerException.</p>
<p>Does someone have an idea what is going wrong and how to fix this without doing the stupid copy thing?</p>
<p>Best,
Hacksteak</p>
| android | [4] |
703,528 | 703,529 | Flare and PHP exec() linux command not working | <p>I'm trying to use flare on my web server with PHP. I have a directory called flare that contains the extracted files from flare06linux.tgz (the command line version). My PHP info says my system is Linux, so I'm using a linux command. (http://cpcheats.co/phpinfo/). The index of /flare is <a href="http://cpcheats.co/pin-tracker/flare" rel="nofollow">http://cpcheats.co/pin-tracker/flare</a>. The file which executes the code to decompile movie.swf is called flare.php. This is flare.php: </p>
<p><code><?php
exec('./flare movie.swf');
?></code></p>
<p>When I run it it is supposed to create a file called movie.flr which contains the decompiled code of the swf. But it is not doing anything. What is the problem?</p>
| php | [2] |
1,696,372 | 1,696,373 | Apply color to row on select w/ jQuery | <p>If I have a selector with drop-down options, how can I change a color of all cells in this row on change?</p>
<pre><code>function changeColor(){
}
$(".mySelector").change(function() {
changeColor();
});
<table>
<tr>
<td>val 1</td>
<td>val 2</td>
<td>
<select class="mySelector">
<option value="red">red</option>
<option value="grn">green</option>
<option value="blu">blue</option>
</select>
</td>
</tr>
<tr>
<td>val 3</td>
<td>val 4</td>
<td>
<select class="mySelector">
<option value="red">red</option>
<option value="grn">green</option>
<option value="blu">blue</option>
</select>
</td>
</tr>
</table>
</code></pre>
| jquery | [5] |
5,337,113 | 5,337,114 | Java difference between static and final static variable initialization | <pre><code>public class StaticTest {
private static StaticTest stObj=new StaticTest();
private static int VAR1=10;
private static final int VAR2=20;
public StaticTest() {
System.out.println("Var1 : "+VAR1);
System.out.println("Var2 : "+VAR2);
}
public static void main(String[] args) {
System.out.println("VAR1 after constrution : "+StaticTest.VAR1);
}
}
</code></pre>
<p>Output : </p>
<p>Var1 : 0
Var2 : 20
VAR1 after constrution : 10</p>
<p>Why is this different behavior for VAR1 and VAR2 ?</p>
| java | [1] |
4,840,121 | 4,840,122 | preg_match help | <p>I want to extract some phone numbers that are in a local text file on my hard drive. I'm thinking that I can use preg_match for this. I've got the following that manages to pull the first phone number then stops. Do I need a loop or what am I missing to get all of the phone numbers? I'm not even sure that my regex is correct. The phone numbers are all in the format: xxx-xxx-xxxx</p>
<pre><code>$file=file_get_contents('1.txt');
preg_match('/([0-9]){3}-([0-9]){3}-([0-9]){4}/', $file, $matches);
print_r($matches);
</code></pre>
| php | [2] |
3,572,060 | 3,572,061 | (The avoidance of) Copy mechanics in C++ | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3422125/why-copy-constructor-and-assignment-operator-are-disallowed">Why copy constructor and assignment operator are disallowed?</a> </p>
</blockquote>
<p>I'm learning C++ from a solid C background, and in the eagerness to avoid the errors of previous C++ that I gleaned from reddit and hacker news, I've been using the <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml" rel="nofollow">Google C++ style guide</a> and LLVM's source code as references for my own code. One thing that sticks out is both the projects' use of the following code. The following is taken from LLVM's include/Support/MemoryBuffer.h:</p>
<pre><code>MemoryBuffer(const MemoryBuffer &); // DO NOT IMPLEMENT
MemoryBuffer &operator=(const MemoryBuffer &); // DO NOT IMPLEMENT
</code></pre>
<p>Google <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Copy_Constructors#Copy_Constructors" rel="nofollow">echoes</a> this usage. Clearly, it's a good thing to disable these "copy constructors".</p>
<p>So my question is: why are these things so scary, and (if they are not guarded against) what does their use look like and what effect does it cause in code?</p>
| c++ | [6] |
5,776,409 | 5,776,410 | how to clear the the activity stack in android | <p>I have the following application flow in my android app,</p>
<p>Login->Home->screen1->screen2->screen3->screen4-> logout</p>
<p>In the screen4 I have a log out button, which allows the user to logout from the application and re-login. When I re-login to the app, the previous data is still shown. Is there a way to start the application fresh when the user logs out from the app?</p>
<p>NOTE: all the above activities launch mode set to "single task",</p>
<p>regards,
Sam.</p>
| android | [4] |
5,744,895 | 5,744,896 | Protected nested class not accessible to derived classes in other package | <p>Here is what I'm trying to accomplish</p>
<p>File 1: ./net/Class1.java</p>
<pre><code>package net;
public class Class1
{
protected static class Nested
{
}
}
</code></pre>
<p>File 2: ./com/Class2.java</p>
<pre><code>package com;
import net.Class1;
public class Class2 extends Class1
{
Nested nested = new Nested();
}
</code></pre>
<p>Here is the error I'm getting</p>
<pre><code>>javac ./net/Class1.java ./com/Class2.java
.\com\Class2.java:7: error: Nested() has protected access in Nested
Nested nested = new Nested();
</code></pre>
<p>Is this error expected? Am I doing something wrong?</p>
| java | [1] |
3,688,105 | 3,688,106 | Android developing an app | <p>Is there any Android tutorial which is more than just a "Hello World!" or "Click me!"? I have googled it and most tutorials I found were with more than half of it on setting up SDK etc and then a little explanation on how to display hello world etc. I'd like to follow on to a bit more advanced tutorial before I can start creating my own test applications.</p>
<p>I'd like to develop an app (quiz game) as my test app having features list below -</p>
<ul>
<li>Display 10 questions with multiple choice answers. The question set gets updated every Monday.</li>
<li>Keep a leaderboard of the highest scores with their time taken.</li>
</ul>
<p><strong>PLEASE NOTE:</strong> I am not expecting you to write code for me. I just made above app features list just to learn developing Android app as Hello World tutorial aren't good enough. If you know any tutorial which cover anything part related or even not... that'd be great.</p>
| android | [4] |
2,465,953 | 2,465,954 | Error on implementing interface | <p>This will likely (hopefully?) be an "amateur hour" type question. :)</p>
<p>I'm new to interfaces, etc. and doing things correctly, but I have an MVC 3 project that references a C# library project.</p>
<p>In the C# library project, I have the following code:</p>
<pre><code> public interface IRepositoryAddable<T>
{
void Add(T entity);
}
</code></pre>
<p>I repeat this sort of code for other types of repository so that I can make things easier and standard across all my repositories.</p>
<p>For example, I have a repository for anything of type "ISkill":</p>
<pre><code>public interface ISkillRepository : IRepositoryAddable<ISkill>, IRepositoryDeleteable<ISkill>, IRepositoryDeleteableByID<ISkill, int>, IRepositoryGettableByID<ISkill, int>, IRepositoryListable<ISkill>, IRepositorySavable<ISkill>
{ }
</code></pre>
<p>Then, in my actual repository, I have: </p>
<pre><code> public class SkillRepository : ISkillRepository
{
public void Add(Skill skillToAdd)
{
return;
}
}
</code></pre>
<p>As far as I'm aware, this should suffice to implement the ISkillRepositoryListable interface. However, I receive the following error:</p>
<blockquote>
<p>Error 5 'DakotaSkills.MVC.Models.Repository.SkillRepository'
does not implement interface member
'DakotaSkills.Lib.Interfaces.Repository.IRepositoryAddable.Add(DakotaSkills.Lib.Interfaces.ISkill)' C:\Users\Sean\Projects\Web\DakotaSkills\src\DakotaSkills.MVC\Models\Repository\SkillRepository.cs 11 18 DakotaSkills.MVC</p>
</blockquote>
<p>Other interface methods for the repository have shown as being implemented fine and I'm not quite sure what I'm doing wrong. For the record, my "Skill" type implements "ISkill" and I receive no error on its implementation.</p>
<p>Help?</p>
<p>Thanks!</p>
| c# | [0] |
4,524,628 | 4,524,629 | is it ok to not define class defaults? | <p>sparing the details of context and why i care...</p>
<p>is it okay to do this:</p>
<pre><code>class IsThisOk(object):
def __init__( self, **kwargs ):
for k in kwargs:
setattr( self, k, kwargs[k] )
obj = IsThisOk( apples=2 , oranges=2 )
</code></pre>
<p>because I've always approached it as:</p>
<pre><code>class OptionB(object):
apples = None
oranges = None
"""class defaults"""
def __init__( self, **kwargs ):
for k in kwargs:
setattr(self,k,kwargs[k])
b = OptionB( apples=2 , oranges=2 )
</code></pre>
<p>=====</p>
<p>edit :</p>
<p>i originally had this in the above , which is something I shouldn't have...</p>
<pre><code>class OptionA(object):
"""set self.k but with class defaults"""
apples = None
oranges = None
def __init__( self, **kwargs ):
for k in kwargs:
self.k = kwargs[k]
a = OptionA( apples=2 , oranges=2 )
</code></pre>
<p>This all came from me trying to optimize some code. </p>
<p>i also noted that::</p>
<pre><code> for k in kwargs:
setattr( self, k, kwargs[k] )
</code></pre>
<p>is a bit faster than</p>
<pre><code> for k,v in kwargs.iteritems():
setattr( self, k, v )
</code></pre>
| python | [7] |
80,522 | 80,523 | xml parsing in android | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3984530/xml-parsing-in-android">xml parsing in android</a> </p>
</blockquote>
<p>what is use of xml prasing in android program</p>
| android | [4] |
79,166 | 79,167 | javascript for...in statement. Exclude first and last iteration. And split loop multiple of 12 | <p>I have a javascript calculator coded not by me and I'm doing front-end coding, to make it usable on web page with UI. There's a piece of code when all calculations are done and it starts to prepare data for UI. </p>
<pre><code> for (var RowIndex in Calc.Graphic)
{
Row = Calc.Graphic[RowIndex];
Graph += "<tr>";
Graph += "<td>"+ RowIndex +"</td>";
Graph += "<td>" + Row.SummPay + "</td>";
Graph += "</tr>";
}
</code></pre>
<p>This loop males table with payment schedule, and I need to exlude from it first and last iteration because it technical data. RowIndex - is month count and Row.SummPay is Summ.
Here's the table after javascript work. How can I exclude 0 and 13.</p>
<pre><code>Month SummPay
0 0
1 84501
2 70418
3 58682
4 48901
5 40751
6 33960
7 28300
8 23583
9 19653
10 16378
11 13648
12 11225
13 1000
</code></pre>
<p>And if there's more then 12 month stop loop and start forming new table floated left like</p>
<pre><code>1 84501 13 11225
2 70418 14 11225
3 58682 15 11225
4 48901 16 11225
5 40751 17 11225
6 33960 18 11225
7 28300 19 11225
8 23583 20 11225
9 19653 21 11225
10 16378 22 11225
11 13648 23 11225
12 11225 24 11225
</code></pre>
| javascript | [3] |
3,226,426 | 3,226,427 | Did <input type=submit /> uses javascript behind the scenes | <p>Did this example of type="submit" have javascript behind the scenes?</p>
<pre><code><html>
<head>
</head>
<body>
<form action="process.php" method="post">
Username: <input type="text" name="username" value=""/><br />
Password: <input type="text" name="username" value=""/><br />
<input type="submit" value="Submit"/>
</form>
</body>
</code></pre>
<p></p>
<p><br/><br/>
Because the other way to submit your data inputs into server is like this.</p>
<pre><code><html>
<head>
<script>
function submit(form){
form.submit();
}
</script>
</head>
<body>
<form action="process.php" method="post">
Username: <input type="text" name="username" value=""/><br />
Password: <input type="text" name="username" value=""/><br />
<input type="button" value="Submit" onclick="submit(this.form);" />
</form>
</body>
</code></pre>
<p></p>
<p><br/><br/>
If so then we dont need javascript to send data into server?? am i right?</p>
| php | [2] |
4,194,242 | 4,194,243 | $_FILES['file']['tmp_name'] + Cropping from the tmp Image | <p>I'm currently allowing users to upload an img and then I save the image as folows:</p>
<pre><code> $tmp = imagecreatetruecolor($configWidth, $configHeight);
imagecopyresampled($tmp, $src, 0,0,0,0,$configWidth,$configHeight,$origWidth,$origHeight);
imagejpeg($tmp, $_SERVER['DOCUMENT_ROOT'].$folder.$newFileName,90);
</code></pre>
<p>I then show the image to the user so they can crop the image.</p>
<p>I wanted to ask if I could display the image for cropping without saving it - eg: could I show the image to the user for cropping from the tmp_name - the tmp php image?</p>
<p>I'm not sure if this is possible but it would avoid having to save an image that is then later deleted post cropping...</p>
<p>thx</p>
| php | [2] |
2,230,475 | 2,230,476 | Selecting specific data (td) from table | <p>I need to select all the languages from the following table. The output should be Java, Ruby, Smalltalk, C++. What jQuery statement should I use? Thanks</p>
<pre><code><table id="languages" border="0" cellspacing="1">
<thead>
<tr>
<th>Language</th>
<th>Type</th>
<th>Invented</th>
</tr>
</thead>
<tbody>
<tr>
<td>Java</td>
<td>Static</td>
<td>1995</td>
</tr>
<tr>
<td>Ruby</td>
<td>Dynamic</td>
<td>1993</td>
</tr>
<tr>
<td>Smalltalk</td>
<td>Dynamic</td>
<td>1972</td>
</tr>
<tr>
<td>C++</td>
<td>Static</td>
<td>1983</td>
</tr>
</tbody>
</table>
</code></pre>
| jquery | [5] |
5,720,963 | 5,720,964 | python and windows double backslash | <p>I got a program running on my local machine which uses some files. I create the reference to the files by using: <code>os.path.join( tempfile.gettempdir(), 'filename.txt' )</code></p>
<p>After that I'm running a program which accepts some parameters <code>--log-file filepath</code> where filepath is one of the files I just explained above.</p>
<p>On my machine python creates backslashes for the paths but not double backslashes and the program complains because it's considered an escape character and should be a double backslash.</p>
<p>Is there any standard way of making sure that I get a working path with double backslashes in python? I could use regex but I would prefer something similar to what <code>os.</code> provides. Maybe I'm missing something.</p>
<p>I'm calling the program using <code>subprocess.Popen</code>:</p>
<p><code>self._proc = subprocess.Popen( command.split( ' ' ) )</code></p>
<p>where <code>command</code> is something like <code>pcix.exe --log-file file_path</code></p>
<p>Also, running a test on my console shows that my python does not produce double backslash for paths:</p>
<pre><code>>>> print os.path.join(tempfile.gettempdir(), "test.txt")
c:\users\manilo~1\appdata\local\temp\test.txt
</code></pre>
<p>Leaving out the print command produces the same path:</p>
<pre><code>>>> os.path.join(tempfile.gettempdir(), "test.txt")
c:\users\manilo~1\appdata\local\temp\test.txt
</code></pre>
<p>Any idea why?</p>
<p>P.S. The platform i'm running is <code>CPython</code></p>
| python | [7] |
3,533,029 | 3,533,030 | What is the best place to get podcasts for improving C# programming skills? | <p>I am always looking for places to learn more.</p>
<p>Which places do you recommend for podcasts about programming?</p>
| c# | [0] |
500,455 | 500,456 | Parse error: syntax error, unexpected T_STRING in C:\...\GuestbookPHP.php on line 43 | <p>I couldnt figure out why I am getting this error in my code. Can anyone help me figure this out please? </p>
<p>Just to let you know, my line 43 is </p>
<blockquote>
<p>INSERT INTO commentList</p>
</blockquote>
<pre><code> <?php
$dbServer='localhost';
$dbUser='root';
$dbPass='password';
$dbName='Guestbook';
mysql_connect("$dbServer", "$dbUser", "$dbPass") or die(mysql_error());
mysql_select_db("$dbName") or die(mysql_error());
mysql_query("CREATE TABLE commentLlist(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
name VARCHAR(30),
comment VARCHAR(160))")
or die(mysql_error());
// Retrieving data from the url
$name = $_GET['name'];
$comment = $_GET['comment'];
if ( $name != null && $comment != null ) {
INSERT INTO commentList
VALUES("$name", "$comment");
} else if ($name == null) {
INSERT INTO commentList
VALUES("Anonymous", "$comment");
} else if ($comment == null) {
INSERT INTO commentList
VALUES("$name", " has nothing to say!");
$display_string = "<li>";
$display_string .= "$name";
$display_string .= " says";
$display_string .= "$comment";
$display_string .= "<li>";
echo $display_string;
?>
</code></pre>
| php | [2] |
816,867 | 816,868 | Jquery Radio Button Checked, Whole Page quickly flicks | <p>I have a form that has a question which has two radio options (Yes and No). </p>
<p>I managed to get the code working fine, but when i click yes out of the radio button the whole screen flashes very quickly. </p>
<p>I have never seen this before. can anyone help? </p>
<pre><code>$(document).ready(function(){
$(".pension_hide").css("display","none");
$("#q32081_q11_0").click(function(){
if($("#q32081_q11_0").is("input:radio"))
{
$(".pension_hide").show("fast");
}
else
{
$(".pension_hide").hide("fast");
}
});
});
</code></pre>
<p>I also have a radio button called q32081_q11_1 which is the no button, i also want this to remove the field when i have checked it.</p>
<p>Thanks for your help everyone!</p>
| jquery | [5] |
4,268,511 | 4,268,512 | how to get keycode value without passing event in JS for firefox? | <p>I have a JSP page which has an event onkeydown and calla a Ajax function ajaxFn(this), this function calls a series of functions and then comes to common function ajaxInteraction(response,ajaxObj).
In this common function there is a subfunction which determines the keycode value,</p>
<pre><code>ajaxObj.onkeydown = function(){
var keynum;
// keynum = event.which;
if(window.event) // IE
{
keynum = event.keyCode;
}
</code></pre>
<p>which recognises only the value from IE and does not recognises Mozilla.
I want to capture the keycode values in the same function for mozilla.
Am not able to capture the value using event.which since event is not passed here from JSP.</p>
<p>P.S: i cannot change the existing code.</p>
| javascript | [3] |
2,139,017 | 2,139,018 | jquery validate - pass in rules as an array? | <p>Im using jquery.validate but im passing in my rules as an array, is this possible? It doesnt seem to work, can anyone point me in the right directions?</p>
<p>Thanks!</p>
<pre><code>rules:{
for (var i=0;i<myRules.length;i++)
{
myRules[i]:{
required = true;
}
}
},
</code></pre>
| jquery | [5] |
1,653,709 | 1,653,710 | class variables | <p>This might be a dumb question but I had this question hover around me. Is there any difference between class variables and member variables in java or they both one and the same.</p>
<pre><code>class Example {
protected String str;
public static String str1 = "xyz";
}
</code></pre>
<p>I know that str1 is a class variable, is str also a class variable?</p>
| java | [1] |
2,151,761 | 2,151,762 | Launch installed application with launch activity null | <p>I am using the following code to get a list of installed applications and launch them.It only opens application like calculator or clock.When i try to open applications like contacts or camera it does not work as their launch activity is null.How do i open such applications.</p>
<p>In the below code s[5] points to the camera.</p>
<pre><code> final PackageManager pm = getPackageManager();
List<ApplicationInfo> packages = pm
.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo packageInfo : packages)
{
s[i]=packageInfo.packageName;
i++;
Log.d(TAG, "Installed package :" + packageInfo.packageName);
Log.d(TAG,"Launch Activity :"+ pm.getLaunchIntentForPackage(packageInfo.packageName));
}
}
Intent mIntent = getPackageManager().getLaunchIntentForPackage(s[5]);
try {
startActivity(mIntent);
}
catch (Exception err) {
Toast t = Toast.makeText(getApplicationContext(),
"Not Found", Toast.LENGTH_SHORT);
t.show();
}
</code></pre>
<p>}</p>
<p>}</p>
| android | [4] |
2,406,804 | 2,406,805 | How to play youtube videos inside iphone app from the video url? | <p>I am working on a project where I have to play some videos in my iphone app.Is there any way so that I can play the videos directly using youtube video URL??? I have to use lots of videos and I don't want to save them in my local iphone database.Please help me with appropriate and details code as I am very new to this field. This is very urgent for me.</p>
<p>In my project there will be a list of cancer disease. I mean blood cancer, bladder cancer, brain cancer etc. If a user clicks a particular cancer disease, then there should be a video regarding that cancer in the next view. I want to play that video directly (or something like that) using url.It should be like youtube video (streaming video). Is it possible??Please help me. I am in trouble.Thanks in Advance.</p>
| iphone | [8] |
4,662,279 | 4,662,280 | confused with c++ code | <p>I know that in line one instead of the io stream is Banner CPP, which is a class that is being imported.
I dont understand the rest, i know x.Display is a function, but what line 3 to 6 do</p>
<pre><code>#include "Banner CPP"//1
int main()//2
{
banner x;//3
x.favourite = "C++";//4
x.Display();//5
return 0;//6
}//7
</code></pre>
| c++ | [6] |
3,440,246 | 3,440,247 | how to record .wav format file in android | <p>I would like to record .wav files using android. is there any way to do this...anybody help me...
thanks in advance</p>
| android | [4] |
4,626,109 | 4,626,110 | OpenGL in Android. What is Configuration? | <p>I am learning OpenGL programming in Android. I wrote a basic program that shows a cube on the screen, but it is displaying a black screen only. Can any one tell me what is the basic configuration of Eclipse for OpenGL?</p>
| android | [4] |
5,181,032 | 5,181,033 | Replace Javascript code and run it | <p>Suppose I have this code:</p>
<pre><code>my_script_data = document.getElementById("id_php_defer__core");
if (my_script_data == undefined) {
Alert(request.responseText); // all looks good!
my_script_data = document.createElement("script");
my_script_data.setAttribute("id", "id_php_defer__core");
my_script_data.innerHTML = 'function myinitfunc() { ' + "\n" + request.responseText + "\n" + ' }';
to = document.head;
if (to != undefined) {
to.appendChild(my_script_data);
}
}
else {
Alert(request.responseText); // all looks good!
my_script_data.innerHTML = 'function myinitfunc() { ' + "\n" + request.responseText + "\n" + ' }';
eval(my_script_data.innerHTML);
}
</code></pre>
<p>The "request.responseText" is actually a Javascript array declaration with lots of values set.</p>
<p>After above code, the "myinitfunc" is called later.</p>
<p>(And as it should only contain "request.responseText" the global (!) array of values should be updated.)</p>
<p>However, while the code works on first run, subsequent runs seem to do nothing, so I am doing something wrong, but what? :)</p>
| javascript | [3] |
3,317,664 | 3,317,665 | Making some part of each array string(elements) as bold by using JavaScript | <p>I want to make the text Bold for CMS: and for remaining it should be norrmal in same(one) string.
How can i do that if complete string is coming in the form of array elements,,, There are multiple value(string) to print. all the avlues will be passed through an array and we have to print the result in the said format. pls, help me.</p>
<p><strong>CMS:</strong> Centers for Medicare & Medicaid Services</p>
<p><strong>DOE:</strong> Department of Education</p>
| javascript | [3] |
5,311,032 | 5,311,033 | JDBC Create Record | <p>I am working on some project, where a user can fill in student details in a form with textfields and radio buttons etc, and the values shall then be used to create a record in a database.</p>
<p>Now, this is how i started:</p>
<pre><code>String firstName = textField_1.getText();
String surname = textField_2.getText();
String Gender = rdbtnM.getText();
</code></pre>
<p>Basically, what it does is, its retrieving values from particular input fields.
Now, my question is, for gender i have two radio buttons. rdbtnM and rdbtnF.
A user can only click on one: Male or Female.
How do i write in String Gender, that it should get the value from M or F ?</p>
<p>Please advise?</p>
| java | [1] |
3,442,870 | 3,442,871 | how to send 2d barcode sms | <p>any one know how to send 2d barcode on sms or which type of sms format require to send barcode image on sms?</p>
| asp.net | [9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.