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,273,882 | 1,273,883 | Get image url from a <img> tag via preg_match | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3820666/grabbing-the-href-attribute-of-an-a-element">Grabbing the href attribute of an A element</a> </p>
</blockquote>
<p>there is image:</p>
<pre><code><img id="image" src="/dxkxkx.jpg" />
</code></pre>
<p>I want to get image url from the <code><img></code> tag which its <code>id="image"</code> by preg_match, but below my codes failed, I got nothing from output:</p>
<pre><code><?php
preg_match('/<img id=\"image\".+src=\"?(.+\.(jpg|jpeg|png))\"?.+>/i', $content, $matches);
print_r($matches);
?>
</code></pre>
<p>Please help,thanks in advance.</p>
| php | [2] |
2,125,901 | 2,125,902 | JavaScript cleaner/purifier? | <p>Is there any way to cleanup JavaScript code? </p>
<p>I want to enable users to post arbitrary JS but i want to filter some of it out, like eval and document.write. Do you know of any tool that can do this?</p>
| javascript | [3] |
1,242,542 | 1,242,543 | Security and Global variable | <p>Is there any security risks to using a global variable (singleton) initialized in the global.asax file. I plan on storing app settings like connection strings in there.</p>
<p>Thanks </p>
| asp.net | [9] |
2,126,117 | 2,126,118 | Set an element as percentage width using a variable? | <p>How do you set an element as percentage width using a variable?</p>
<pre><code>var progBarValue = $('.days-due').text();
$('.bar').width(progBarValue%);
</code></pre>
| jquery | [5] |
4,619,936 | 4,619,937 | java.lang.VerifyError in Android application | <p>Hello I get this error every time I'm trying to open an activity</p>
<pre><code>java.lang.VerifyError: com.karriapps.smartsiddur.Saharit
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1429)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
</code></pre>
<p>Can someone direct me to a solution or a way to check where the problem is coming from
thanks</p>
| android | [4] |
5,923,360 | 5,923,361 | Include separate project as a view in xml | <p>So, I have created a complex view in a separate Eclipse ADT project. It consists of items laid out in XML and then the items animated in an activity.</p>
<p>What I want to do is convert this so that I can include it as a view in another project I am working on.</p>
<p>I have an idea that I need to create a class that extends <code>View</code> I will then override <code>OnDraw(Canvas canvas)</code> What do I do after this stage if I am on the right track?</p>
| android | [4] |
5,201,677 | 5,201,678 | C#: loop through appdomains in assembly | <p>how to loop through appdomains in assembly?</p>
| c# | [0] |
5,781,028 | 5,781,029 | Inline functions in C++ | <p>Hii ,</p>
<p>I am a novice in C++. I did read about inline functions and understood them right. But <a href="http://www.parashift.com/c++-faq-lite/inline-functions.html" rel="nofollow">this</a> site says that "We get an 'unresolved external' error if we write the definition of an inline function in one .cpp file and call it from another file....why is that so ... ?
This can be done for normal functions right...Please correct me if i am wrong ... </p>
<p>Thanks</p>
| c++ | [6] |
3,331,047 | 3,331,048 | how to get javascript calender value on server side | <p>I am new on Asp.net. I am using Javascript calender It use Input tag.if I use <code>runat="server"</code> so that I can get value on cs page then it does not display calender. How can I get calender value from input tag to .cs page </p>
| asp.net | [9] |
4,372,347 | 4,372,348 | Adding the same function to many elements (using js prototypes?) | <p>In my application, I receive a collection of Comments with JSON.</p>
<p>Then, I want to add functions to every item in this collection, so for example if a Comment has <code>comment.first_name</code> and <code>comment.last_name</code>, I want to build <code>comment.full_name()</code>.</p>
<p>So far, I'm doing:</p>
<pre><code>comment.full_name = function() { return this.first_name+" "+this.last_name }
</code></pre>
<p>My question is, since there are many comments (and other methods more complex than this one), how could I use <strong>prototypes</strong> or <strong>constructors</strong> to add the same function to every item in the collection, without inserting it into each element?</p>
<p><strong>EDIT</strong>:</p>
<p>Here is an example of code:</p>
<pre><code>comments = ({"1": {"first_name":"John", "last_name":"Silver"}, "2": {"first_name":"Jack", "last_name":"Sparrow"}})
</code></pre>
<p>Now, I'm looking for something that will return</p>
<pre><code>comments[1].name() //=> John Silver
comments[2].name() //=> Jack Sparrow
</code></pre>
| javascript | [3] |
4,158,719 | 4,158,720 | Get AD Account Via asp.net | <p>This might be a simple question. I am creating a website were authentication will be using an AD Account. AD username will be stored in SQL Server Database Table and when a customer tries to open the website it will take his/hers AD Account and make sure it exists in the database and if so it will let them into the website otherwise User Denied. </p>
<p>I have tried using "HttpContext.Current.User.Identity.Name" but that does not get me the user that is trying to run the website it actually just gets the AD Account where the IIS Resides on.</p>
<p>If anyone can show me how I can obtain an AD Account (Username) of who is trying to run my website via .net.</p>
<p><strong>UPDATED</strong><br>
Got the answer: </p>
<p>1) In web.config add:</p>
<pre><code> <authentication mode="Windows"/>
</code></pre>
<p>2) On the IIS side go under Hosted folder properties<br>
3) Click on Tab "Directory Security"<br>
4) Uncheck all except Itegrated Windows Authentication </p>
<p>That should work. </p>
| asp.net | [9] |
4,251,514 | 4,251,515 | Add a variable in an existing variable name in javascript | <p>in the beginning i declare a variable like this:</p>
<pre><code>var content = "likes";
var main_likes_data = true;
</code></pre>
<p>And later i want to change the variable to false, but i need to add a new variable like this:</p>
<pre><code>main_" + content + "_data = false;
</code></pre>
<p>But this does not work!</p>
<p>Can someone please tell me the right sytax to change the variable?</p>
<p>Thank You!!!</p>
| javascript | [3] |
5,808,184 | 5,808,185 | Retrieve Regeistered users info - asp website | <p>i have created an intranet website using visual studio(c#) , i have published it as well and it works fine . the website has a registration page and lets user to create accounts , my problem is whenever someone registers in website , i would like to see the list of registered users and assign them permissions(member , guest , admin etc) so that not everyone who register can see the protected content</p>
<p>how do i do this , do i use visual studio's ASP.NET CONFIGURATION PAGE for this?</p>
<p>am a complete beginner in asp , can some one please guide.</p>
| asp.net | [9] |
3,560,517 | 3,560,518 | Applying an event handler to elements through a loop in Javascript | <p>I would like to add an Event Handler for all of my <code><td></code> tags. I've tried the following:</p>
<pre><code>var allSquares = document.getElementsByTagName("td");
for (var i = 0, len = allSquares.length; i < len; i++){
allSquares[i].addEventListener('ondragover', allowDrop, false);
}
</code></pre>
<p>Anyone has an idea why it didn't work?
Thanks ahead</p>
| javascript | [3] |
1,851,197 | 1,851,198 | Which dll should I use to create excel file with dynamic data and to do conditional formatting depending upon the dynamic data in c# | <p>I want to create a excel file with multiple sheets containing dynamic data and I want to do conditional formatting depending on the data, so which dll should I use that is freely available.</p>
| c# | [0] |
304,085 | 304,086 | Crazy talk (paranoid about initialization) | <p>I learned long ago that the only reliable way for a static member of be initialized for sure is to do in a function. Now, what I'm about to do is to start returning static data by non-const reference and I need someone to stop me.</p>
<pre><code>function int& dataSlot()
{
static int dataMember = 0;
return dataMember;
}
</code></pre>
<p>To my knowledge this is the only way to ensure that the static member is initlized to zero. However, it creates obscure code like this:</p>
<pre><code>dataSlot() = 7; // perfectly normal?
</code></pre>
<p>The other way is to put the definition in a translation unit and keep the stuff out of the header file. I have nothing against that per se but I have no idea what the standard says regard when and under what circumstances that is safe.</p>
<p>The absolute last thing I wanna end up doing is accidently accessing uninitialized data and losing control of my program.</p>
| c++ | [6] |
4,598,807 | 4,598,808 | Make a long int easier to read | <p>I'm working on a fairly simple console application but I got one little problem. It's very hard to read large numbers unless you go close to the monitor and look very carefully. It's very important that the user immediately can see how much it is. For example, which of these is the easiest to read?</p>
<pre><code>143000532
143.000.532
</code></pre>
<p>I want it to look like the second one. It's fairly simple to just do an if every time I need to print a large number but that's tedious and makes the code look bad. Is there any way I can do this in a beautiful way and still be able to use the variable in calculations and comparisons?</p>
| c# | [0] |
4,165,434 | 4,165,435 | How to make an exception for "," and "." in KeyPress Event? | <p>Note: This is not about EXCEPTIONS!</p>
<p>I'm trying to make a textbox accept everything but Symbols and Punctations... but I need to allow "," and "." . I'm using:</p>
<pre><code>if (char.IsPunctuation(e.KeyChar) == true)
{
e.Handled = true;
}
if (char.IsSymbol(e.KeyChar) == true)
{
e.Handled = true;
}
</code></pre>
<p>Is there anyway to make an exception for those two Characters ( , and . ) ?</p>
| c# | [0] |
1,952,133 | 1,952,134 | convert this string into decimal | <p>Sounds easy but when I tried to achieve i'm stock about how is the formatter to make this conversion this are some examples of strings that i need to convert to decimal</p>
<pre><code>00.24
48.34
01.24
</code></pre>
<p>Does anybody know how can i Accomplish this?? I tried like this</p>
<pre><code>try
{
decimal x = Convert.ToDecimal("00.24", );
//Which formatter do I need to pass??
decimal x = Convert.ToDecimal("00.24", Formatter???);
}
Catch(Exception e)
{
throw new Exception()
}
</code></pre>
<p>But It doesn't work because the result it's 24D and i need 0.24D</p>
| c# | [0] |
4,338,066 | 4,338,067 | Javascript passing parameters into function | <p>Hey, i cant seem to get this to work, im a little confused on how im supposed to pass the colour paramaters:</p>
<pre><code>function colourGreen(red, green, blue)
{
document.getElementById("button1").style.backgroundColor = 'rgb(red,green,blue)';
}
</code></pre>
<p>.............
.............</p>
<pre><code><input type="button" id = "button2" value="Price up" onclick = 'colourGreen(0,255,0)'>
</code></pre>
| javascript | [3] |
2,387,373 | 2,387,374 | Create anonymous type from string | <p>So I have a anonymous type which I have used ToString on, and put into a file. It looks like this (and remarkably like JSon...):</p>
<pre><code>{ Name = Name, Description = Description, Status = Pending, Key = Template, SubmittedBy = MyName, Identity = 2fb7a40b-e07a-4f1a-a48b-2c2720567f35 }
</code></pre>
<p>now I want to go the other way (edit:take the string from a file and put it into a format I can put into a known object) and put it into an anonymous type (which has the same properties, but I don't care if they are castable or anything like that, I just want a quick way to do something like.</p>
<pre><code>AnonObject = GetObjectFromFile(blah);
RealObject.Name = AnonObject.Name;
</code></pre>
<p>I only have an interface for RealObject, so I can't add serialisation to the class. If you know a better way, let me know.
Thanks.</p>
| c# | [0] |
4,007,040 | 4,007,041 | How to build multi dimensional array for store this? | <p>I want to store information like below with a key like key = activity window then other info under it, then another key etc..</p>
<pre><code>key: 'activity window'
name: 'Recent Activity'
iconCls: 'activity'
module: 'activity-win'
</code></pre>
<p>any idea how to put this into a multi dimensional array?</p>
| php | [2] |
54,178 | 54,179 | Why can't I assign a new value to "this" in a prototype function? | <p>Why can I do this:</p>
<pre><code>Array.prototype.foo = function() {
this.splice(0, this.length);
return this.concat([1,2,3]);
}
</code></pre>
<p>But I can't do this:</p>
<pre><code>Array.prototype.foo = function() {
return this = [1,2,3];
}
</code></pre>
<p>Both functions destroy the value of this and change it to <code>[1,2,3]</code> but the second one throws the following error: <code>Uncaught ReferenceError: Invalid left-hand side in assignment</code></p>
<p>I suspect it's because allowing assignment means I could potentially change the array to something else (like a string), but I'm hoping someone out there knows for sure and/or has a more detailed explanation.</p>
| javascript | [3] |
4,037,139 | 4,037,140 | Javascript windowwidth - resize | <p>I'm trying to figure out with this isn't working.
It used to take care of height instead of width, but i simply can't get it it work.
Anyone could point me in the right direction of the problem perhaps?</p>
<pre><code> function getWindowWidth() {
var windowWidth = 0;
if (typeof(window.innerWidth) == 'number') {
innerWidth = window.innerWidth;
}
else {
if (document.documentElement && document.documentElement.clientWidth) {
windowWidth = document.documentElement.clientWidth;
}
else {
if (document.body && document.body.clientWidth) {
windowWidth = document.body.clientWidth;
}
}
}
return windowWidth;
}
function Removewhensmall(id) {
if (document.getElementById) {
var windowWidth = getWindowWidth();
if (windowWidth > 0) {
var contentElement = document.getElementById(id);
var contentWidth = contentElement.offsetWidth;
if (windowWidth < 600) {
contentElement.style.display = 'none';
}
}
}
}
window.onload = function() {
Removewhensmall('rightwrap');
Removewhensmall('leftwrap2');
}
window.onresize = function() {
Removewhensmall('rightwrap');
Removewhensmall('leftwrap2');
}
</code></pre>
| javascript | [3] |
5,333,135 | 5,333,136 | Is there a way to convert Class object to Java source string? | <p>I use <code>Class.forName("classname")</code> to get a Class object, I want to convert to Class object to String, which means decompile the java file, and show this string to GUI.</p>
<p>How can I do? Thanks</p>
| java | [1] |
4,104,647 | 4,104,648 | How do I load an image in PHP | <p>I'm completly newbie to PHP.
i want a code to load a image to PHP server and then send it to browser.
for example i want to once page named sample.php is requested, in response send an image to browser...
in other words, I want to create a PHP file that acts like a proxy...</p>
<p>Thanks all</p>
| php | [2] |
3,882,189 | 3,882,190 | How to authenticate users before downloading files? | <p>For example, if users want to download /webroot/files/bigimage.jpg, they are given a URL www.domain.com/download.php?filename=bigimage.jpg. Then,</p>
<ol>
<li>How to prevent unauthenticated users
to access the file bigimage.jpg?</li>
<li>If an authenticated user visits that
URL, I want to trigger the download
behavior of browsers (e.g., in IE,
show the dialog with "Open", "Save"
and "Cancel" buttons) instead of
displaying the image in browsers.
How to do this?</li>
</ol>
<p>EDIT:
Make the question more clearer.</p>
<p>I am using LAMP stack. For Q1, I am not asking how to do authentication, I am asking how to prevent users access the file directly. Also, reading contents of the whole file and echo them is resource extensive. Is there better solution?</p>
| php | [2] |
4,613,879 | 4,613,880 | Navigation bar (iphone) | <p>I have created email functionality view in which everything is working fine, but the color of a navigation bar item is not changing like other views. I have used below code for navigation color but 1 navigation bar button item is left with default color. How do I change it?</p>
<pre><code>controller.navigationBar.barStyle = UIBarStyleBlack;</code></pre>
| iphone | [8] |
3,952,697 | 3,952,698 | how to swap an element with jquery? | <p>I have the following setup within my HTML document...</p>
<pre><code><div id="logo"><h2>my top logo</h2></div>
<div id="one"><p>this is the first section with stuff in it</p></div>
<div id="two"><h1>this is the section section with stuff in it</h1></div>
<script>//this script associates to stuff in div id=two</script>
</code></pre>
<p>Is there a way to tell < div id = one >, to go under the < script > tag this way it looks like this...</p>
<pre><code><div id="logo"><h2>my top logo</h2></div>
<div id="two"><h1>this is the section section with stuff in it</h1></div>
<script>//this script associates to stuff in div id=two</script>
<div id="one"><p>this is the first section with stuff in it</p></div>
</code></pre>
<p>I can't depend on a parent div element id that contains all these. I need to only depend on what you see right here. </p>
<p>Thanks</p>
| jquery | [5] |
5,242,584 | 5,242,585 | Building JavaScript objects representing a tree | <pre><code>function createObjects(element, depth){
element.label = element.getElementsByTagName("label")[0].firstChild.nodeValue;
element.url = element.getElementsByTagName("url")[0].firstChild.nodeValue;
element.depth = depth;
if(treeWidths[depth] == undefined){
treeWidths[depth] = 1;
} else {
treeWidths[depth]++;
}
element.children = new Array();
allNodes.push(element);
var children = element.getElementsByTagName("children")[0].childNodes;
for(var i=0; i<children.length; i++){
if(children[i].nodeType != 3 && children[i].tagName == "node"){
element.children.push(createObjects(children[i], depth+1));
}
}
element.expanded = false;
element.visible = false;
element.moved = false;
element.x = 0;
element.y = 0;
if (getNodeWidth() < element.label.length * 10)
element.width = element.label.length * 10;
else
element.width = getNodeWidth();
element.height = getNodeHeight();
return element; }
</code></pre>
<p>Having problems with Firefox, it says that 'element.children.push' is not a function but works (only) in Google Chrome...</p>
<p>Any clue?</p>
| javascript | [3] |
4,081,815 | 4,081,816 | Removing useable time slots from an array | <p>I'll ask my question in a moment first allow me to explain what I've done and am trying to accomplish.</p>
<p>Goal: Only show times that are available for a service to be booked on a muli-staff calendar.The import thing here is that services have minimum booking times (in minutes) </p>
<p>Approach:</p>
<p>Steps</p>
<p>1) Create an array of all possible times someone could start a booking (i.e, 9am-5pm where each key increase by a set interval (i.e, 5min,9:05, 9:10,etc)</p>
<p>2) Load each staffs bookings for that day into an array and intersect these arrays so you find out if at least one person is available at a certain time. </p>
<p>3) Generate an array that is the difference of available hours in the day with the result of the intersected staff bookings.</p>
<p>Where the problem lies...</p>
<p>If staff member "Mary" has a booking from 9:15 - 9:45 and John has an appointment from 9:00 - 9:30. It will show '9:00' as being available although it's only available from 9:00-9:15 .
Which doesn't work because in this case the minimum booking time is 30mins.</p>
<p>Question:</p>
<p>I have an array of hours: minutes at an set interval (5 mins). How do I remove blocks of time that are two short ?</p>
| php | [2] |
2,378,748 | 2,378,749 | socket permission in java | <p>Through java applet I am trying to get socket connection from a client to the server. I encountered "Access denied - SocketPermission". Please let me know the changes I need to make in the Applet and in the server program.</p>
<p>Thanks,
John</p>
| java | [1] |
4,466,141 | 4,466,142 | c#: reading html source of a webpage into a string | <p>i would like to be able to read the html source of a certain webpage into a string in c# using winforms</p>
<p>how do i do this?</p>
| c# | [0] |
4,266,431 | 4,266,432 | Native Heap Maximum size and release of memory | <p>I am a little bit confused about the native heap on android, I would
like know the native heap max size, there is a way to know it? </p>
<p>Like </p>
<pre><code>getRuntime().maxMemory()
</code></pre>
<p>which I use for know the maximum limit of VM heap. </p>
<p>Another question is relative at how the native heap memory is
released, I read that IS NOT the GC of Dalvik which free that memory,
is correct? If yes, when the memory of native heap is released?
Thanks a lot in advance for any suggestion.
pedr0 </p>
| android | [4] |
75,432 | 75,433 | Need help in understanding a small part of a basic class in c++? | <p>Can somebody explain me what is being done in the CVector CVector::operator+ (CVector param). How does the dot operator work with temp. I understand when you do object.function() but how does it make sense to do object.object does this just set them both equal to each other? Confused!!</p>
<pre><code>#include <iostream>
using namespace std;
class CVector {
public:
int x,y;
CVector () {};
CVector (int,int);
CVector operator + (CVector);
};
CVector::CVector (int a, int b) {
x = a;
y = b;
}
CVector CVector::operator+ (CVector param) {
CVector temp;
temp.x = x + param.x;
temp.y = y + param.y;
return (temp);
}
int main () {
CVector a (3,1);
CVector b (1,2);
CVector c;
c = a + b;
cout << c.x << "," << c.y;
return 0;
}
</code></pre>
| c++ | [6] |
3,804,773 | 3,804,774 | "The Web is not marked as an application in IIS" | <p>I am using IIS 5.1 and .Net 2005. I'm getting an error while opening a .NET application as local ISS.</p>
<pre><code>Error - The Web is not marked as an application in IIS.
</code></pre>
<p>I have checked the directory in IIS and it seems everything is in right place.</p>
<p>How might I resolve this?</p>
| c# | [0] |
2,141,634 | 2,141,635 | Parse Multi-Part Email with Sub-parts using Python | <p>I am using this function to parse an email. I am able to parse "simple" multi-part emails, but it produces an error (UnboundLocalError: local variable 'html' referenced before assignment) when the email defines multiple boundaries (sub-parts). I would like the script to separate the text and html portions and return only the html portion (unless there is no html portion, return the text).</p>
<pre><code>def get_text(msg):
text = ""
if msg.is_multipart():
for part in msg.get_payload():
if part.get_content_charset() is None:
charset = chardet.detect(str(part))['encoding']
else:
charset = part.get_content_charset()
if part.get_content_type() == 'text/plain':
text = unicode(part.get_payload(decode=True),str(charset),"ignore").encode('utf8','replace')
if part.get_content_type() == 'text/html':
html = unicode(part.get_payload(decode=True),str(charset),"ignore").encode('utf8','replace')
if html is None:
return text.strip()
else:
return html.strip()
else:
text = unicode(msg.get_payload(decode=True),msg.get_content_charset(),'ignore').encode('utf8','replace')
return text.strip()
</code></pre>
| python | [7] |
600,133 | 600,134 | Can I call constructor within an arithmetic expression? | <p>I am implementing a Matrix class and I overloaded the <code>*</code> and <code>+</code> operators. I also have a constructor:</p>
<pre><code>Matrix (int row, int col, const elemType &init_val)
</code></pre>
<p>that constructs a matrix initialized to hold init_val in all positions. So based on this implementation, I have in my test program:</p>
<pre><code> Matrix<int> mi4 = Matrix<int> (2, 2, 3) + Matrix<int> (2, 2, 1);
</code></pre>
<p>The compiler gives me the following error:</p>
<pre><code>testMatrix.cpp:41: error: ambiguous overload for ‘operator+’ in ‘Matrix<int>(2, 2, ((const int&)((const int*)(&3)))) + Matrix<int>(2, 2, ((const int&)((const int*)(&1))))’
Matrix.h:91: note: candidates are: Matrix<elemType> operator+(const Matrix<elemType>&, const Matrix<elemType>&) [with elemType = int]
</code></pre>
<p>I remember in C++ standard library, you can call constructor within an expression. How can I implement that? Thanks a lot!</p>
| c++ | [6] |
1,489,023 | 1,489,024 | Android, on touch listener and padding? | <p>As soon as I set padding on one of my image views, the click function does not work:</p>
<pre><code>myImageView.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction() & MotionEvent.ACTION_MASK) {
//do stuff
</code></pre>
<p>Any one know what I am doing wrong?</p>
<p>The error is:</p>
<p>The jar file has no source attachment, you can add a source by clicking below.
This happens when you click.</p>
| android | [4] |
1,324,507 | 1,324,508 | How to remove an appended() image using jquery? | <p>In my web application I have around 10 headings with same class name, so when a user click on that a loading image will be appended to them and some data will be filled via ajax in a div then after this whole processing i just want to remove that loading image.</p>
<p>Here is my code:</p>
<pre><code>jQuery('.replyhead').live('click',function(){
var idval=jQuery(this).attr('id');
jQuery(this).append('<img src="images/loading.gif"/>');
jQuery.post('abc.php',{rack:idval},function(data) {
jQuery('#r'+idval).html(data);
//now here i just need to remove that loading.gif
});
});
</code></pre>
<p>Any recommendations on how to do this?</p>
| jquery | [5] |
535,184 | 535,185 | Android Emulator for Tablet | <p>My PC is core i-5 with 4gb RAM.</p>
<p>whenever i try to run an AVD in eclipse it comes fast, if i want to run an AVD for TAB it take 5 to 10 minutes. Is there any way to make it fast? Also some time it comes with blackscreen says open gl es API problem type something</p>
<p>Also after fast run, i dont close it, i use it same AVD for all run. But it becames slower after every installation or run by my app. so i have to close and restart my AVD, is there any solution for it. Also some time DDMS cant find AVD, while it was running in font.</p>
<p>Anyone face these problem? any tricks? </p>
<p>one another thing, some time app dont run automatically after installation, i have to select app in AVD's APPS</p>
| android | [4] |
882,761 | 882,762 | Is there any difference between setData and changeData? | <p>I don't see any difference between the two functions.</p>
<p>Using the following JavaScript code:</p>
<pre><code>var x = {};
$(x).bind({
setData: function (event, key, value) {
console.log("setData()", key, value);
},
changeData: function (event, key, value) {
console.log("changeData()", key, value);
}
});
$(x).data("key1", "alpha");
$(x).data("key1", "beta");
$(x).data("key2", "gamma");
</code></pre>
<p>... I get the following in the console:</p>
<pre><code>setData() key1 alpha
changeData() key1 alpha
setData() key1 beta
changeData() key1 beta
setData() key2 alpha
changeData() key2 alpha
</code></pre>
<p>Both events fire every time.</p>
| jquery | [5] |
2,928,627 | 2,928,628 | Alternatives to adding dynamically generated inline JavaScript | <p>Generating inline JavaScript in HTML has always made me feel dirty and after having used <a href="http://en.wikipedia.org/wiki/Yahoo!%5FUI%5FLibrary" rel="nofollow">YUI</a> a bit I get the sense that it's best to leverage HTML elements as an alternative. Would it be insane to use a hidden <ul> to store keys and values to be used by static JavaScript which would only act when it found the <ul> rather than using inline JavaScript?</p>
<p>What practices are common out there and what practices have the most merit with regards to avoiding inline JavaScript?</p>
| javascript | [3] |
2,749,982 | 2,749,983 | Moving an image 10px on hover and changing opacity | <p>I have my code below which works well but i also want to move the image down 10px and back again on mouseout as well as putting the opacity back to 0.7.</p>
<pre><code>$('#drinksList section a img').load(function() {
$(this).data('height', this.height);
}).bind('mouseenter mouseleave', function(e) {
$(this).stop().animate({
opacity: 1,
height: $(this).data('height') * (e.type === 'mouseenter' ? 1.05 : 1)
});
});
</code></pre>
<p>Any help would be appreciated. </p>
| jquery | [5] |
4,320,329 | 4,320,330 | Having a button open an alert window, create a new button, and then open a new alert window | <p>This is my basic code without the html header and ending. I am trying to do a javascript button push to help people realize the dangers of clicking on random links or buttons from within a web page. I have been able to get everything but the show_alert2 function to work. I am very new to javascript so I might just be missing something but I can not figure out what it is. Any help would be most appreciated.</p>
<pre><code><head>
//<script type="text/javascript">
function show_alert()
{
alert("You really just clicked on a random button?");
document.write("<h1>Hi there. You have just been hacked.</h1>");
document.write("<p>It is a very bad Idea to click on links that you don't know where they
lead too.</br>Click on the button below to fix the damgaes to your computer.</p>")
document.write('<input type="button" id="delta" onmouseup="show_alert2()" value="Save your
System." />');
}
function show_alert2()
{
alert("Some People never Learn do they....");
}
</script>
</head>
<body>
<input type="button" onclick="show_alert()" value="Show alert box" />
</body>
</code></pre>
| javascript | [3] |
2,495,669 | 2,495,670 | How can I play a video? | <p>How can I play a video in Android? Where do I put my video file?</p>
| android | [4] |
4,779,608 | 4,779,609 | how to make "Farm Flip - Memory Match for Kids" like memory based game | <p>i'm about to developp a memory game for children <a href="http://itunes.apple.com/gb/app/farm-flip-memory-match-for/id380346867?mt=8" rel="nofollow">like</a>,i have 6 different images show in in random order in 12 places. note(each image show twice) and i want to know how to set images randomly and how to mach UIImage with animation? any help..</p>
| iphone | [8] |
37,335 | 37,336 | HELP! jCarousel won't initialise properly! | <p>HELP!</p>
<p>My code:</p>
<pre><code><script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="jquery.tabs.pack.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('#container-1').tabs();
});
</script>
<link rel="stylesheet" href="jquery.tabs.css" type="text/css" />
<!--[if lte IE 7]>
<link rel="stylesheet" href="jquery.tabs-ie.css" type="text/css" media="projection, screen">
<![endif]-->
<link rel="stylesheet" type="text/css" href="ie7/skin.css" /> <!-- CAROUSEL SKIN/THEME -->
<script src="jquery.jcarousel.js" language="javascript" type="text/javascript"></script>
<script src="init.js" language="javascript" type="text/javascript"></script>
</code></pre>
| jquery | [5] |
3,887,348 | 3,887,349 | On InMobi Addtracker My application is not getting reported | <p>I am using inmobi in my android application.
For that i am using InMobiAdTrackerAndroid.jar with this jar i am following documentation.</p>
<p>1: We are using following codes inmy application Launcher class
IMAdTrackerUtil.setLogLevel(LOG_LEVEL.VERBOSE);
IMAdTrackerAnalytics.getInstance().startSession(getApplicationContext(),Constants.INMOBI_APP_ID);</p>
<p>2: We are using this constants in place of above bold text
public static final String INMOBI_APP_ID = "5cd90875-04c7-476d-aa6e-ee7cf0ac70f6";</p>
<p>3: In AndroidManifest.xml class we add following code
</p>
<pre><code> <receiver
android:name="com.inmobi.adtracker.androidsdk.IMAdTrackerInstallRefererReciever"
android:enabled="true"
android:exported="true" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
</code></pre>
<p>4: InMobiAdTrackerAndroid.jar is the library which we are using for inmobi and this library is added in build path.</p>
<p>On InMobi site in Reporting i am not getting an Application's name.(Application is present in DashBoard not present in Reporting)
I tested application using qrcode of my application and it forwarded me to google play where my application is present.
So what is the reason my application is not showing on Reportings.
here i a using samsung Tablet with sdk version 11.</p>
| android | [4] |
115,602 | 115,603 | Session for multiple files when logged in? | <p>I have <strong>/admin/</strong> folder with multiple files in it that get POST/GET and do certain things with my data base. The question is do I need to do (<code>if $_SESSION['isAdmin'] == true</code>) at the beginning of every file to enable access to those files only to <strong>admin</strong> who is logged in or there is some another more optimal way? Thanks.</p>
| php | [2] |
1,974,735 | 1,974,736 | custome control event in list view android | <p>I have a listview. which is mase by custome control..
and custome control class extends baseadapter class.
one of my custome control is button..
so onclick of that particular button I have to find position of row..
pleas tell me howz it possible</p>
| android | [4] |
2,105,542 | 2,105,543 | How to pass argument to a jquery function through an onClick event? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3273350/jquery-click-pass-parameters-to-user-function">jquery .click pass parameters to user function</a> </p>
</blockquote>
<pre><code> $('#topleft').click(function (x) {
loadPopupBox();
$("#popupinner").load('getdetail.php?id=' +x);
});
</code></pre>
<p>How to pass a value to the variable x from an onclick event? The value of the variable x is POSTED to getdetail.php and the data returned from the getdetail.php is loaded to a DIV with ID popupinner. Now everything works except the data POST/GET.</p>
| jquery | [5] |
816,597 | 816,598 | starting an .exe file from c++ in windows | <p>I try to start an a program from my code in c++ Visual studio.
I tried those cmds: </p>
<pre><code>system( "\" C:/Program Files (x86)/scilab-5.3.3/bin/WScilex.exe\"");
system( "start" C:/Program Files (x86)/scilab-5.3.3/bin/WScilex.exe\"");
system( "\" C:\\Program "" Files""(x86)\\scilab-5.3.3\\bin\\WScilex.exe"");
</code></pre>
<p>none of them worked, has anybody an Idea how to get this done
thanks in advance </p>
| c++ | [6] |
1,261,669 | 1,261,670 | visual c sharp progress bar with background worker | <p>i have the following code that updates my progress bar in visual c sharp. it works fine and the bar moves for each percentage. but i also have code that i got from a post on another site, that is suppose to put the progress bar value in the middle of the progress bar as % percentage. it displays the % of the progress bar value for a split second but then disappears. i am new to c sharp and have tried several things like pBar.update and pBar.refresh after the pBar value change. i have edited some of the code to make it easier to understand. see below, once i reportprogress the background worker progresschanged executes and again the pBar value changes i see it change, and also the textbox text gets updated, but for some reason the code further below that draws the % text within the progress bar gets overwritten somehow. again i see the % for a split second. you can see some of my comments where i was trying various things to see if it would redraw the %</p>
<pre><code> private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
backgroundWorker1.ReportProgress(10);
collect_long_process();
}
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
pBar.Value = e.ProgressPercentage;
txtBox_pBar.Text = "Gathering info";
int percent = 10;//(int)(((double)pBar.Value / (double)pBar.Maximum) * 100);
pBar.CreateGraphics().DrawString(percent.ToString() + "%", new Font("Arial", (float)8.25, FontStyle.Regular),
Brushes.Black, new PointF(pBar.Width / 2 - 10, pBar.Height / 2 - 7));
//pBar.Update();
//Application.DoEvents();
}
</code></pre>
| c# | [0] |
5,850,664 | 5,850,665 | set setInAnimation and setOutAnimation while starting activity | <p>I have the following situation </p>
<pre><code>TabActivity>group activiyt>(A->B->C)
</code></pre>
<p>Here A,B and C are activities. And me loading like this</p>
<pre><code> setContentView(this,getLocalActivityManager().startActivity("zero",intent.addFlags(Intent.FLG_ACTIVITY_CLEAR_TOP)) .getDecorView());
</code></pre>
<p><strong>What i need is to set animation (Slide from left/Right) when i change one activity to another?</strong><br>
Currently me used the following animation, after <code>setContentView</code> to new view </p>
<pre><code>public static Animation inFromRightAnimation() {
Animation inFromRight = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f);
inFromRight.setDuration(ANIMATIION_DURATION);
inFromRight.setInterpolator(new AccelerateInterpolator());
return inFromRight;
}
</code></pre>
<p>but it only do animation to new view.<br>
I need like current move left at the same time new move from right<br>
<strong>Is there any way to set <code>setInAnimation</code> and <code>setOutAnimation</code> in startActivity like view flipper?</strong><br>
Thank you </p>
| android | [4] |
936,105 | 936,106 | Parsing Domain From URL In PHP | <p>I need to build a function which parses the domain from a URL.</p>
<p>So, with <code>http://google.com/dhasjkdas/sadsdds/sdda/sdads.html</code> or <code>http://www.google.com/dhasjkdas/sadsdds/sdda/sdads.html</code>, it should return <code>google.com</code>; with <code>http://google.co.uk/dhasjkdas/sadsdds/sdda/sdads.html</code>, it should return <code>google.co.uk</code>.</p>
| php | [2] |
4,733,081 | 4,733,082 | How to access/escape PHP object member with a $ character in its name? | <p>I'm decoding some JSON (from the Youtube data API) with json_decode and it gives me an object that looks like this when var_dump()ed:</p>
<pre><code>object(stdClass)[29]
public 'type' => string 'text' (length=4)
public '$t' => string 'Miley and Mandy! KCA VIDEO WINNERS' (length=34)
</code></pre>
<p>How can I access the $t member?</p>
| php | [2] |
4,399,395 | 4,399,396 | How to check if an application is present in /system/app folder? | <p>I want to check if a specific apk is present in system app folder. How can I do that?</p>
| android | [4] |
5,514,542 | 5,514,543 | How to create e-book store with php? | <p>How do I create a downloadable ebook store with PHP? Please suggest any tutorial!</p>
| php | [2] |
3,550,713 | 3,550,714 | Can I mutiple select object variables in jQuery? | <p>Something like doesn't work, what's the work around?</p>
<pre><code>var tgtCol = $('td[aria-describedby=tblGrid_Subject]');
var tgtHdr = $('#tblGrid_Subject');
$(tgtHdr, tgtCol).attr('colSpan', '3');
</code></pre>
| jquery | [5] |
38,608 | 38,609 | CollectionChanged event gets executed for non associated object | <p>I have two ObservableCollection objects and obj1 has attach to collection change event. Obj1 has a value from obj2 by obj1 = obj2. When I add any item on obj2 it execute collection changed event of object 1. I could not understand why this is happening.</p>
<blockquote>
<pre><code> public MainWindow()
{
InitializeComponent();
ObservableCollection<int> obj1 = new ObservableCollection<int>();
ObservableCollection<int> obj2 = new ObservableCollection<int>();
obj1 = obj2;
obj1.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(obj1_CollectionChanged);
obj2.Add(1);
</code></pre>
</blockquote>
<p>}</p>
<pre><code> void obj1_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
MessageBox.Show("Testing");
}
</code></pre>
| c# | [0] |
874,949 | 874,950 | Performance issue with javascript spell check | <p>After integrating spell checking into our web application with <a href="http://javascriptspellcheck.com/" rel="nofollow"> Javascript Spell Check </a> we are facing performance problem with the application. The application slows down after some time and it affects normal actions like scrolling the web page. Has anyone else faced the same problem before?</p>
| javascript | [3] |
5,195,437 | 5,195,438 | How can I switch the activity of the content of a tab in Tabhost | <p>I have created a TabHost and in 1 of the tab, I have added the content using </p>
<pre><code> mTabHost.addTab(mTabHost.newTabSpec("tab1")
.setIndicator(getString(R.string.dialerIconLabel),
getResources().getDrawable(R.drawable.ic_tab_dialer))
.setContent(intent));
</code></pre>
<p>Is it possible for me to switch the content's activity programatically after I called 'addTab of TabHost'?</p>
<p>Thank you.</p>
| android | [4] |
4,514,604 | 4,514,605 | highlight a text in textview | <p>How can we highlight a text in textview like the imgage shown below,the user tap the select verse it hilight the verse in yellow color and a popup window apper for that verse for doing action.How to do this?
Thanks in advance.<img src="http://i.stack.imgur.com/o1Jrc.png" alt="enter image description here"></p>
| iphone | [8] |
5,270,337 | 5,270,338 | Define Variable with Function | <p>I need help explanation of this script</p>
<pre><code>var test = {
property_1 : 'aaa',
property_2 : 'bbb'
}
var place = function(str, ph){
return test[ph];
}
</code></pre>
<p>What is the meaning of definition <code>place</code> and what will be return type of that function?<br>
I can't understand from where is parameter <code>str</code> and <code>ph</code> come?</p>
<p>Here is the screenshot tutorial i read that do this at <strong>line 19</strong></p>
<p><img src="http://i.stack.imgur.com/NtrX3.png" alt="enter image description here"></p>
<p>Thank you.</p>
| javascript | [3] |
1,535,041 | 1,535,042 | Help with google maps link for Iphone | <p>i have a google maps link which will open the google map application...@"http://maps.google.com/maps?q=cupertino"...instead of a specific location i want it to open with the current longitude and latitude..would the link be like @"http://maps.google.com/maps?q=ll" like that...or is there a different way to do it?</p>
<p>i am using CLocation framework</p>
| iphone | [8] |
2,954,806 | 2,954,807 | Remove tags that created after page load with jQuery | <p>I have small application:
<a href="http://jsfiddle.net/Bwdf6/4/" rel="nofollow">http://jsfiddle.net/Bwdf6/4/</a></p>
<p>But with click on delete, tags that created after page load doesnt remove.
Is there any way to remove tags that created after page load?</p>
<p>Thanks in advance</p>
| jquery | [5] |
1,490,892 | 1,490,893 | webview : how to handle javascript code from multiple web pages | <p>In a WebView, how do you access the JavaScriptInterface from multiple web
pages, and not just from the page that you load via mWebView.loadUrl("http://10.241.139.45:9081/amexco/login.html")</p>
<p>e.g.</p>
<p>In my project's assets folder, I have:</p>
<pre><code>login.html
page1.html
page2.html
</code></pre>
<p>... and here is the relevant WebView code:</p>
<pre><code>webView.addJavascriptInterface(new JavaScriptInterface(), "android");
webView.loadUrl("file:///android_asset/index.html");
</code></pre>
<p>So at different points in time, a user may look at index.html, page1.html, etc. From what I can tell, only the JavaScript in index.html has access to the JavaScriptInterface via "window.android.someMethodName()". When I try to make a call to "window.android.someMethodName()" from page1.html, it says that "window.android" is not defined.</p>
<p>so the user starts the webview from
login.html page and navigates through different pages..
my requirement is in the last page of my webpage i have a button saying return to android activity. so when user clicks on the last page of my navigation the user has to come back to the android activity.</p>
<p>window.android.someMethodName()" can be called in html page which works fine. but this method will work if i call this method only from the first page which i loaded ie from the login.html page only this method will work.. if i call this method from the last page of the webview naviagation this is not working.</p>
<p>Can any one help me out in this.</p>
| android | [4] |
251,700 | 251,701 | Using RandomFileAccess to temporarly cache audio data | <p>I'm currently using a simple byte array buffer to cache live audio data and than playback this data. So it's constant reads and writes on this buffer. My problem is that I sometimes need this buffer to be atleast 1MB and I know that allocating that much memory is most likely not a good idea. So therefore I'm looking into caching data temporarily under the cache folder.</p>
<p>Are there any pitfalls when using RandomFileAccess to continuously seek->read and seek->write? </p>
<p>Are there perhaps better methods to cache temporarily data?</p>
<p>My main concerns are to maximize performance and battery life.</p>
| android | [4] |
3,740,367 | 3,740,368 | why private value of the obj can be changed by class instance? | <pre><code>#include<iostream>
using namespace std;
class A
{
private:
int value;
public:
A(int init):value(init){}
void changevalue(A &a){a.value = 100;}//why a's value can be changed?
void printvalue(){cout << value << endl;}
};
int main(int argc , char *argv[])
{
A a(2);
A b(3);
a.changevalue(b);
b.printvalue();
return 0;
}
</code></pre>
<p><strong>a</strong> is an instance of <strong>A</strong> class,with a private value named <strong>value</strong>,but why this private value can be changed? Is that the parameter list included in the scope of class? </p>
| c++ | [6] |
5,386,784 | 5,386,785 | JavaScript typewriter script not working | <p>Well basically I tried to make a typewriter script from scratch, for my little terminal web app junkie xD</p>
<p>Well, I've got this JavaScript thingy:</p>
<pre><code>var str = "dude";
var num = 1000;
for (var i = 0, len = str.length; i < len; i++) {
var num = num + 100;
var dude = str[i];
setTimeout('document.getElementById("guide").innerHTML +=dude;', num);
}
</code></pre>
<p>which obviously writes to a <code>div</code> with the <code>ID</code> <code>guide</code>, "d" "u" "d" "e" in 100 milisecond intervals, but guess what ?</p>
<p>It doesn't do that !! </p>
<p>NOW what it DOES do it print "e" as many times as they are characters in the string, dude!!</p>
<p>:|</p>
<p>Thank you,</p>
<p>I'm probably super stupid</p>
<p>but I'd love a fix!</p>
<p>Thanks in advance!</p>
| javascript | [3] |
1,719,765 | 1,719,766 | how different between & new class and new class in php | <p>hello i need ask from different between </p>
<pre><code>$var=new class;
$var= & new class;
</code></pre>
<p>and if different in stack and speed code </p>
<p>thank you</p>
| php | [2] |
4,411,553 | 4,411,554 | com.google.android.maps not available | <p>I'm new to Android and I'm using IntelliJ to develop. I'm going through various tutorials, etc and now I'm trying to run/compile Wrox project that uses com.google.android.maps</p>
<p>IntelliJ wouldn't compile, it complains that this package does not exist.</p>
<p>How do I add it to project? I have everything downloaded in ADT. I was able to run all other projects no problem. What should I look for?</p>
| android | [4] |
4,690,027 | 4,690,028 | DataGridView of C#.net | <p>How to set event when we change the value of DataGridView1. That means when I changed the value of cell, I want to display the text in another cell. </p>
<p>Example : Old Cell value = Nepal
I am typing on this cell : N
NE
NEP
Every changed of cell value, I need to occur event. When I type N then NE then NEP every changed of cell value I need event. </p>
| c# | [0] |
4,174,836 | 4,174,837 | Function to generate alpha numeric sequence number based on input number | <p>I am trying to develope a routine in C# that will take a given input integer and return a 6 character alpha numeric string based on a predefined possible set of characters.</p>
<p>The possible characters to use are: </p>
<p>"0123456789ABCDEFGHJKLMNPQRSTUVWXYZ" (note that the letter "I" and "O" are not in the set.)</p>
<p>Therefore given the input of 1, the output should be "000001", input of 9 would output "000009", input of 10 would output "00000A", input of 12345 would output "000AP3", and so on.</p>
<p>I am having a hard time coming up with an elegant solution to this problem. I know I must be approaching this the hard way so I'm looking for some help.</p>
<p>Thanks!</p>
| c# | [0] |
6,033,694 | 6,033,695 | How to set background dynamically for an imageView from SD card? | <p>I have the path of the image that is present in my SD card .i want to set this as the background for an imageview. Is that possible to use the same method as from URl?
Please help..</p>
| android | [4] |
5,986,980 | 5,986,981 | Where can I get a good study guide for java? | <p>Please suggest me some good website to collect java materials for more specific.</p>
<p>Thanks in Advance.</p>
| java | [1] |
1,492,088 | 1,492,089 | set the position for pop up | <p>Im new to jquery.
I'm loading the pop up in my asp.net application.
I want set the postion for pop up.
Now its opening at center postion.
please let me know how can I show the pop up on top.
Can I mention the pixels for top postion?
Please let me know how to do it.</p>
<p>here is my code</p>
<p><code>var popup = 0;
$("#modalRightCenterContent").dialog({
minHeight: 48,
minWidth: 470,
resizable: false,
modal: true,
autoOpen: false,
title: "Add Widgets"
})
</code></p>
| jquery | [5] |
3,887,208 | 3,887,209 | Android 3.2 remove title from action bar | <p>I'm working with eclipse, android 3.2. and a virtual machine running android x86. (v3.2)</p>
<p>I use the Holo theme and I want to remove the action bar title and icon. So I do </p>
<pre><code>@Override
public void onCreate(Bundle savedInstanceState)
{
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
super.onCreate(savedInstanceState);
setContentView(R.layout.test);
}
</code></pre>
<p>It's working fine but ...</p>
<p>When the application start, I first show the title and icon and only after I see them disappearing. So it's not very beautiful.</p>
<p>If I use debug, I can see It's only when I leave the onCreate that the setDisplayShowTitleEnabled takes effect.</p>
<p>So is there a way to hide title and icon before the activity is shown ?</p>
<p>Thanks.</p>
| android | [4] |
1,152,122 | 1,152,123 | Why cant I step into this loop in Visual Studio | <p>For some reason, Visual studio will not step into this code and I cant see the contents of the variable k and p</p>
<pre><code> for(int k=0; k<6; k++)
{
for(int p=0; p<6; p++)
{
if(k=0)
{
levelToDraw[k][p] = LevelOne[k][p];
}
else
{
levelToDraw[k][p] = LevelOne[k-1][p];
}
}
}
</code></pre>
| c++ | [6] |
5,703,236 | 5,703,237 | javascript undefined variable - doesn't seem like it? | <p>Sorry for the long code, but my environment does not support script tags.</p>
<p><a href="http://pastebin.ca/2105293" rel="nofollow">http://pastebin.ca/2105293</a></p>
<p>I try to call loadbang (line 976) and get</p>
<pre><code>_r.Multistrokes[z].name is undefined
</code></pre>
<p>I thought I defined it right there in the function, no?</p>
<p>Thanks much in advance</p>
<p>Joe</p>
| javascript | [3] |
4,695,571 | 4,695,572 | C# - Error Using Code Previously Posted Here | <p>I am attempting to use the code found in the answer here: <a href="http://stackoverflow.com/questions/2553008/directory-move-doesnt-work-file-already-exist">Directory.Move doesn't work (file already exist)</a></p>
<p>This is exactly the method I need, but when I try to add it to my code, the line</p>
<p><code>Directory.CreateDirectory(folders.Target);</code></p>
<p>has the word "Target" underlined in red, and the error is "'object' does not contain a definition for 'Target' and no extension method 'Target' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)"</p>
<p>Can anyone help me get rid of that error?</p>
| c# | [0] |
5,838,922 | 5,838,923 | Layout for android | <p>I need to have a layout for my widget, but I don't know how to arrage my images on widget screen.</p>
<p>I need to have 4 small Images on first row</p>
<p>then 2 Images on 2nd row</p>
<p>1 Image on 3rd row</p>
<p>and 1 Image on 4th row</p>
<p>Could you please someone create the xml file ?</p>
| android | [4] |
3,947,129 | 3,947,130 | PHP output buffer is not empty? | <p>I have this peculiar problem. I am making an AJAX call to a PHP page. In case of error I am returning the string "error" to success: <code>function(msg)</code> i.e. msg will have the value "error". But for some reason it is sending back "error" but with a line break preceding it. And this fails the condition when i check <code>if (msg=="error")</code>. I have to put <code>ob_clean()</code> to clear out the output buffer. Then it returns "error" without line break. I checked but my PHP function is not outputting anything before the "error". What can be the issue that the output buffer is not empty?</p>
| php | [2] |
2,050,792 | 2,050,793 | Value gets passed to function without me clicking the button | <p>When I try to pass a value when a button is clicked the value gets passed anyway (even without me clicking the button). This is not supposed to happen because I want to hide an image only when the button is clicked
Why is this happening? </p>
<pre><code>for ( i = 0; i < divs.length;i++){
knopdiv[i] = document.createElement('div');
divs[i].appendChild(knopdiv[i]);
knopdiv[i].innerHTML = '<button id="knop' +i+'">Afbeelding verbergen</button>';
knopdiv[i].onclick = hideMe(i, afb[i]);
function hideMe(nummer, afb){
console.log (nummer);
}
</code></pre>
<p>output without clicking: </p>
<pre><code>0
1
2
3
4
5
6
7
8
</code></pre>
<p>Why isn't console just passing the number of the clicked button? </p>
| javascript | [3] |
5,853,377 | 5,853,378 | how to test a string for letters only | <p>how could I test a string against only valid characters like letters a-z?...</p>
<pre><code>string name;
cout << "Enter your name"
cin >> name;
string letters = "qwertyuiopasdfghjklzxcvbnm";
string::iterator it;
for(it = name.begin(); it = name.end(); it++)
{
size_t found = letters.find(it);
}
</code></pre>
| c++ | [6] |
4,560,319 | 4,560,320 | document.createElement('img') vs. new image() | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6241716/is-there-a-difference-between-new-image-and-document-createelementimg">Is there a difference between <code>new Image()</code> and <code>document.createElement("img")</code>?</a> </p>
</blockquote>
<p>On a bookmarking site, when a user inserts a bookmark, an image is created to display the favicon, should I use <code>new image()</code> or <code>document.createElement('img')</code> to do this?</p>
| javascript | [3] |
2,677,240 | 2,677,241 | Killing COM object from C# | <p>I have a COM object that we are calling from C#. This works great, and I have my own pool of objects that I can use whenever I want. Now I need to kill the object. I've tried releasing the COM object explicitly and then garbage collecting from another thread, but that does nothing. Does anyone have any other ideas to kill this object? Thanks for the help.</p>
<p>I've tried </p>
<pre><code>System.Runtime.InteropServices.Marshal.ReleaseComObject(myApp);
GC.Collect();
GC.WaitForPendingFinalizers ();
myApp = null;
</code></pre>
<p>and I create it by</p>
<pre><code>myApplication.ApplicationClass myApp = new myApplication.ApplicationClass();
</code></pre>
<p>this is the full code
this com object is written in vb6, below is the C# code calling vb6 component</p>
<pre><code> myApplication.ApplicationClass myApp = new myApplication.ApplicationClass();
string user = this._User;
string pass = this._Pass;
string company = this.companyNumber;
try
{
if (myApp.Login(ref user, ref pass, ref company))
</code></pre>
<p>{
//Perform some action
}
else
{
throw new System.Exception(MESSAGE_LOGINERROR);
}
}
Finally
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(myApp);</p>
<pre><code> GC.Collect();
GC.WaitForPendingFinalizers();
M2MApp = null;
</code></pre>
<p>}</p>
<p>Thanks,
Pradeep</p>
| c# | [0] |
5,043,035 | 5,043,036 | auto complete jquery | <p>how do I make the auto complete jquery (multiple) start with the char (not any chars contained)? so if the user types 'j, it only list word starts with 'j' not all words containing j</p>
<p>thanks</p>
| jquery | [5] |
5,367,978 | 5,367,979 | Can anyone tell me how to download whole project in android? | <p>I want to download the whole project from this link:</p>
<p><a href="http://www.netmite.com/android/mydroid/packages/apps/Contacts/" rel="nofollow">http://www.netmite.com/android/mydroid/packages/apps/Contacts/</a></p>
<p>Can anyone guide me?</p>
| android | [4] |
1,755,952 | 1,755,953 | PHP CLI stopped working | <p>On my dedicated CentOS linux server my PHP CLI has stopped working. I have scripts written by a developer that require CLI and these scripts were working until yesterday. Another oddity that happened at the same time was that the symbolic link in /usr/local/bin/ to php was lost. I recreated that but it's still not working.</p>
<p>My developer says its not working because when we run this script from the command line;</p>
<pre><code><?php
echo 'php_sapi_name()='. php_sapi_name() .'<br />';
if(php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
echo "ENVIRONMENT IS CLI";
} ELSE {
echo "ENVIRONMENT IS NOT CLI";
}
//echo phpinfo();
</code></pre>
<p>From the command line then what is returned is</p>
<pre><code>php_sapi_name()=cgi-fcgi<br />ENVIRONMENT IS NOT CLI
</code></pre>
<p>Running php -v gives me the following output</p>
<pre><code>PHP 5.3.8 (cgi-fcgi) (built: Feb 2 2012 14:48:13)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
</code></pre>
<p>Ended up changing our script to work around this problem but it's still odd how it just changed</p>
| php | [2] |
3,858,444 | 3,858,445 | alter some attributes of an html/xml string | <p>I have some strings that are a sequence of html paragraphs:</p>
<pre><code><p style="text-align: justify;"><strong> strong text> <a href=\"skhf\">alink</a></p>
<p> another par </p>
</code></pre>
<p>I want to change paragraph and link style, so adding/removing attributes. Moreover I'd like to remove some paragraphs also, according to their content.
I guess I have first to convert this string in an xml structure and then revert it back to string right? Any ideas?</p>
| android | [4] |
2,803,769 | 2,803,770 | Turning on error reporting for a JavaScript segment? | <p>I haven't worked in JS since 1999, so I'm quite rusty. I remember working in it in the past, and I was able to enable some kind of error reporting. Right now, when I have a syntax error in a script, no error is reported in the browser. Is there a directive or something to enable error reporting in a JS file?</p>
| javascript | [3] |
5,530 | 5,531 | How can I manage the location of my application icon in android | <p>After installing my application, I want to locate the application icon into my folder, not directly appear at the main menu .
How can i write to change it after app installed .</p>
| android | [4] |
4,467,014 | 4,467,015 | android: how to read the date & time from system alarm services | <p>for example i setup system alarm to 4:25 and i close the program. (the server is working) </p>
<pre><code>How_Many_Day = 1;
Total_Day = How_Many_Day * 24*60*60*1000;
Intent myIntent = new Intent(AndroidAlarmService.this, MyAlarmService.class);
pendingIntent = PendingIntent.getService(AndroidAlarmService.this, 0, myIntent, 0);
AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
Calendar timeOff9 = Calendar.getInstance();
timeOff9.set(Calendar.HOUR_OF_DAY, 4);
timeOff9.set(Calendar.MINUTE, 25);
timeOff9.set(Calendar.SECOND, 0);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, timeOff9.getTimeInMillis(), Total_Day, pendingIntent);
</code></pre>
<p>how to read the date & time from system alarm services</p>
| android | [4] |
1,100,122 | 1,100,123 | can I know which Keyboard Key has been pressed before hitting Enter | <p>can I know which Keyboard Key has been pressed before hitting Enter.is there any way to capture such key pressed event in c++ ??Please provide a short example of it.
i'm using VC++ on Windows 32bit.</p>
| c++ | [6] |
1,546,954 | 1,546,955 | Custom Sorting Python Dictionary | <p>So I have a dictionary that looks like this when I print it:</p>
<pre><code>{'10': -10, 'ZT21': 14, 'WX21': 12, '2': 15, '5': -3, 'UM': -25}
</code></pre>
<p>I want to sort these in a custom manner, which I define. Let's say the way I want it to be sorted (by key) is <code>ZT21</code>, <code>10</code>, <code>WX21</code>, <code>UM</code>, <code>5</code>, <code>2</code>.</p>
<p>Anyone know how to go about sorting out a dictionary in a predefined/custom manner? What I am doing is getting this dictionary from a database, and it can come out with over 20 keys, all of which have a specific order. The order is always set, but sometimes certain keys/values wouldn't be in the dictionary. So this could happen too:</p>
<pre><code>{'ZT21': 14, 'WX21': 12, '2': 15, '5': -3, 'UM': -25}
</code></pre>
<p>sorted (by key) is <code>ZT21</code>, <code>10</code>, <code>WX21</code>, <code>UM</code>, <code>5</code>, <code>2</code>.</p>
<p>So the 10 isn't there in this example, but the sorting I need is still the same, the 10 would just be absent.</p>
<p>Any ideas?</p>
| python | [7] |
900,333 | 900,334 | why is resource management order important? | <p>In Stroustrup's book The C++ Programming language, He mentions "It is typically important that resources are released in the reverse order of their acquisition"
why the order is important?</p>
<pre><code>void acquire()
{
acquire resource 1;
...
acquire resource n;
use resources;
release resource n;
...
release resource 1;
}
</code></pre>
<p>so what if we change the order as follow? </p>
<pre><code>void acquire()
{
acquire resource 1;
...
acquire resource n;
use resources;
release resource 1;
...
release resource n;
}
</code></pre>
| c++ | [6] |
1,516,240 | 1,516,241 | facebook friend status | <p>how to get status update of user friends from facebook for iphone app</p>
| iphone | [8] |
5,075,687 | 5,075,688 | Draw arrow dynamically ina android | <p>I am developing an app , in which i want to make diff shapes like arrow,rectangles, lines, free draw etc dynamically on finger touch, i am able to draw line, free draw, rectangles but i am not getting the arrow.i also search a lot on google but didn't find anythng relevant.Please suggest if someone has a solution. </p>
| android | [4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.