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,768,145 | 4,768,146 | windows application can not write to log.txt | <p>This is main program.cs</p>
<pre><code>LogError.WriteError("Application started: " + DateTime.Now + Environment.NewLine);
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new CrawlerApp());
}
catch (Exception e)
{
LogError.WriteError(e);
}
LogError.WriteError("Application closed: " + DateTime.Now + Environment.NewLine);
</code></pre>
<p>and this is LogError class</p>
<pre><code>public static class LogError
{
public static void WriteError(Exception e)
{
WriteError("Message: " + e.Message + Environment.NewLine + "Stack trace: " + e.StackTrace);
}
public static void WriteError(string error)
{
try
{
StreamWriter sw = File.AppendText("log.txt");
sw.WriteLine(DateTime.Now + Environment.NewLine);
sw.WriteLine(error + Environment.NewLine);
sw.WriteLine(Environment.NewLine);
sw.Close();
}
catch (Exception)
{
//
}
}
}
</code></pre>
<p>When i publish application and run it log.txt file is never created. If i run application from bin/debug folder then works. Why when i publish app logging not working. I am using win 2003 OS.</p>
| c# | [0] |
1,488,557 | 1,488,558 | breaking down multidimentional arrays in php | <p>i have the following multidimensional array:</p>
<pre><code>Array ( [0] => stdClass Object ( [array] => Array ( [0] => 6112010651088 [1] => Bill [2] => Choice ) ) [1] => stdClass Object ( [array] => Array ( [0] => 6702015707081 [1] => test [2] => data2 ) ) )
</code></pre>
<p>If you break the first array down using</p>
<pre><code>foreach ($point1 as $val)
{
print_r($val);
}
</code></pre>
<p>you get: </p>
<pre><code>stdClass Object ( [array] => Array ( [0] => 6112010651088 [1] => Bill [2] => Choice ) )
stdClass Object ( [array] => Array ( [0] => 6702015707081 [1] => test [2] => data2 ) )
</code></pre>
<p>so basically u have an array with 2 objects of array with 3 units of data each, how do i access this object stdClass array now, cos if i go $val[0] instead of $val i get </p>
<pre><code>Fatal error: Cannot use object of type stdClass as array
</code></pre>
| php | [2] |
5,005,472 | 5,005,473 | How to insert text into a file using web input forms? | <p>I have a simple text file that needs to be updated on a regular basis. Instead of cutting and pasting the new data, I'd like to have a web input form where I can just enter the new info, and it will update the text file. For example, I may enter a new "Headline", or "URL", and I'd want that string to be inserted into the correct place in the file. </p>
<p>What's the easiest way for me to do this? The file doesn't have to be saved, I can copy and paste the text file after it generates the new text. </p>
<h2>For example, the text that I would want updated looks like this:</h2>
<p>[Headline] </p>
<h2>the above sentence is the headline and this is the [URL]</h2>
<p>There would be 2 web input forms. 1 for Headline, 1 for URL. When I enter text into the input, the javascript would insert it into the correct place in the textarea. Then I can just copy and paste that text into whatever I needed. This is a very simple script, I just have no idea how to build it.</p>
| javascript | [3] |
5,696,008 | 5,696,009 | what is the point of using ternary operators instead of IF THEN? | <p>why make things more complex? why do this:</p>
<pre><code>txtNumerator.Text =
txtNumerator.Text == "" ? "0" : txtNumerator.Text;
</code></pre>
<p>instead of this:</p>
<pre><code>if txtNumerator.Text="" {txtNumerator.Text="0";}
</code></pre>
| c# | [0] |
5,986,393 | 5,986,394 | Javascript onChange event equivalence for non-form-fields? | <p>We know the onChange event only works for form fields. Is there any way to monitor the change of innerHTML of a specific DOM element other than form fields?</p>
| javascript | [3] |
3,967,522 | 3,967,523 | BarCode detection in iPhone | <p>I want to implement read/scan bar code in my iphone application i would like to know how to implement it into our iphone app and also some links and example code and apps to check out how it works..</p>
<p>Regards</p>
<p>Hemant</p>
| iphone | [8] |
3,483,981 | 3,483,982 | java add function,all become one last set of data when added | <p>there are only 3 sets of data in turn1.length,when temp added,there should have three different sets of data.But,after i add,even there is 3 group objects,the date in it upexpectedly is the last group of date,all.
I see three different data in debug mode,current attribute will cover the prev data in temp each cycle.</p>
<p>how can i fix it?</p>
<pre><code> String[] turn1 = idList.split(",");
String[] turn2 = labelList.split(",");
Attribute attribute = new Attribute();
List<Attribute> Temp = new ArrayList<Attribute>();
for(int i=0;i<turn1.length;i++){
long getId;
getId = Integer.parseInt(turn1[i]);
attribute.setId(getId);
attribute.setLabel(turn2[i]);
Temp.add(attribute);
}
for(int i=0;i<3;i++)
System.out.println(Temp.get(i));
</code></pre>
| java | [1] |
3,753,244 | 3,753,245 | Logging out a user from the site | <p>I was adding login and logout functionality to my ASP.NET website. While I am able to make the user log in by checking the username and password but on some pages should be available only if he is logged in. I am doing this by storing the user's value in a session</p>
<p>Secondly, I am using a <code>Link button</code> which changes to <code>Logged in as example</code>. So, how does the user log out?</p>
| asp.net | [9] |
3,004,164 | 3,004,165 | Namespacing (static) member variables | <p>I would like to be able to achieve something like this:</p>
<pre><code>class Zot
{
namespace A
{
static int x;
static int y;
}
}
</code></pre>
<p>I am working with a legacy system that uses code generation heavily off a DB schema, and certain fields are exposed as methods/variables in the class definition. I need to add a few extra static variables to these classes and would like to guarantee no clashes with the existing names.</p>
<p>The best I have come up with is to use another struct to wrap the statics as if it were a namespace:</p>
<pre><code>class Zot
{
struct A
{
static int x;
static int y;
}
}
</code></pre>
<p>Is there a better way?</p>
<p><strong>Update:</strong></p>
<p>An extra requirement is to be able to access these from a template elsewhere</p>
<p>e.g.</p>
<pre><code>template<class T>
class B
{
void foo() { return T::A::x; }
};
</code></pre>
<p>So putting them in a separate class won't work</p>
| c++ | [6] |
248,671 | 248,672 | Java, easiest way to store mixed-data types in a multidimensional array? | <p>Ive got a file with some String and ints I wish to store in a 2D 'array'. What is the best way of doing this? I havent done Java for a while and i've been using VBA (where you have no datatypes), so i'm a little bit rusty.</p>
| java | [1] |
1,338,034 | 1,338,035 | Unable to use shared preference values in class A extends BroadcastReceiver , Android | <p>I am Unable to use shared preference values in a class-say Class A that extends BroadcastReceiver. I do a commit in another class- an activity class, now I want to retrieve those set of values inside Class A that extends BroadcastReceiver.</p>
| android | [4] |
4,490,018 | 4,490,019 | Selecting a class in the same div but not others | <p>I have an app that has red-wines and wines. If something is selected as a red-wine, the corresponding wine in that and only that div, should be set to checked and set to disabled. Here's a fiddle: <a href="http://jsfiddle.net/z5FYR/" rel="nofollow">http://jsfiddle.net/z5FYR/</a></p>
<p>Basically, is there a way for me to limit the scope (and not internal divs - like basically this 'subs' but nothing else)? Or should I make a secondary thing to select off of like a data-id='23' or something?</p>
<p>thx</p>
<p><strong>edit #1</strong>
So there are three instances of 'is-wine' that are demarcated by inclusion in that '.subs' class. I want to select only the one that is in the same div and not the other two. </p>
| jquery | [5] |
5,725,618 | 5,725,619 | How to test if two objects are the same with JavaScript? | <p>I need a function: </p>
<pre><code>function isSame(a, b){
}
</code></pre>
<p>In which, if a and b are the same, it returns true.<br>
, I tried <code>return a === b</code>, but I found that <code>[] === []</code> will return false.<br>
Some results that I expect this function can gave: </p>
<pre><code>isSame(3.14, 3.14); // true
isSame("hello", "hello"); // true
isSame([], []); // true
isSame([1, 2], [1, 2]); // true
isSame({ a : 1, b : 2}, {a : 1, b : 2}); //true
isSame([1, {a:1}], [1, {a:1}]); //true
</code></pre>
| javascript | [3] |
750,547 | 750,548 | process Dialog not Showing immediately in List View | <p>Hi I am new to Android and trying to put process dialog on List View like this way.</p>
<pre><code> lv1.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> a, View v,int position, long id) {
Log.v("data1","Before Dialog");
pd = ProgressDialog.show(DataDiaryDateAndTime.this.getParent(), "",
"Please Wait....", true, true);
Log.v("data1","After Dialog");
MyThreadNew myThread = new MyThreadNew(position);
myThread.start();
}
});
</code></pre>
<p>but I found that the process dialog starting very late but both messages comes immediately
My Activity is child Activity of other Activity.</p>
<p>please give me appropriate solution
Thanks. </p>
| android | [4] |
1,798,681 | 1,798,682 | Can I set up a page that gets its links clicked automatically every 8 hours? | <p>I have a page on one of my sites that generates 10 time and date-stamped links every time the page is loaded for me to click. </p>
<p>What I would like to do, is set this page up so these generated links get clicked AUTOMATICALLY every 8 hours, is this possible? </p>
<p>This is the code I use at the moment:</p>
<pre><code><script type="text/javascript">
<!--
var d = new Date()
month=(d.getUTCMonth()+1).toString();
if(month.length<2) month = "0" + month;
day=(d.getUTCDate()).toString();
if(day.length<2) day = "0" + day;
hour=(d.getUTCHours()).toString();
if(hour.length<2) hour = "0" + hour;
minute=(d.getUTCMinutes()).toString();
if(minute.length<2) minute = "0" + minute;
for (x=1 ; x<=10 ; x++)
{
xx = x.toString();
if (xx.length<2) xx = "0" + xx;
h= "http://xxxxxxxxxxxxxxx/xxxxxxxxxxxx/facebook.xxxxxxxxxx.php?F=xxxxxxxxxxxxxxxxx=" + d.getUTCFullYear() + "." + month + "." + day + "+" + hour + "." + minute + "." + xx + "xxxxxxxxxxxxxxxxxx";
document.writeln("<p>"+("Link "+x).link(h)+"</p>");";
document.writeln("<p>"+("Link "+x).link(h)+"</p>");
}
//-->
</script>
</code></pre>
<p>Is what I am trying to achieve possible with Java? If not is it possible using any other format or programme?</p>
| javascript | [3] |
3,352,087 | 3,352,088 | How to find out that given String is already in Java String pool? | <p>Is there any method or technique how to know that given <code>String s</code> is already in the String pool? How and when is <code>Java String</code> pool creating? What does initial members it contain?</p>
| java | [1] |
1,362,973 | 1,362,974 | Most Instructive Open Source Android Projects? | <p>I'm looking to compile a list of instructive open-source Android projects.</p>
<p>My criteria for instructiveness:</p>
<ul>
<li>High code quality</li>
<li>Good API coverage, demonstrating how various parts of the API interact</li>
<li>Continually improved, showing that the designs are in fact maintainable</li>
<li>Good aesthetic quality</li>
</ul>
<p>In other words, the apps that as <em>intermediate to advanced</em> Android developers we should be looking to for guidance, and not simply tutorials that demo a few concepts.</p>
| android | [4] |
4,114,654 | 4,114,655 | DNS of the server where ASP.NET application is run | <p>How to get to know DNS name of the server where ASP.NET application is run?</p>
<p>I want to get string "www.somehost.com" if my application URL is <a href="http://www.somehost.com/somepath/application.aspx" rel="nofollow">http://www.somehost.com/somepath/application.aspx</a></p>
<p>Is there some property of Server, Contex, Session or Request objects for this?</p>
<p>Thanks!</p>
| asp.net | [9] |
4,591,168 | 4,591,169 | Grabbing specific months first date and lastdate in PHP | <pre><code>function firstOfMonth() {
return date("m/d/Y", strtotime(date('m').'/01/'.date('Y').' 00:00:00'));
}
function lastOfMonth() {
return date("m/d/Y", strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00'))));
}
</code></pre>
<p>is what i have to get the current month's first day date and last day date.</p>
<p>Now i wish to change it alittle, so in both functions they have a param with $month, where $month holds the number of the month I would like to get the first date and last date from.</p>
<p>Example if i do firstOfMonth(1), I would like it to return 2012-01-01 and lastOfMonth(1) it should return 2012-01-31</p>
<p>How can i do this?</p>
| php | [2] |
2,249,163 | 2,249,164 | Converting PixelFormat from RGB565 to RGB888 C# | <p>I am working on a device that is using an image sensor and a USB microcontroller that will continuously stream frames from the sensor to be drawn on a GUI using C#. </p>
<p>My image sensor is outputing data in RGB565, and I am converting this array of bytes to an image using the following function:</p>
<pre><code>public static Bitmap BytesToBmp(byte[] bmpBytes, int w, int h)
{
Bitmap functionReturnValue = default(Bitmap);
Bitmap bmp = new Bitmap(w, h ,System.Drawing.Imaging.PixelFormat.Format16bppRgb565);
System.Drawing.Imaging.BitmapData bdata = bmp.LockBits(new Rectangle(new Point(), bmp.Size), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format16bppRgb565);
Marshal.Copy(bmpBytes, 0, bdata.Scan0, bmpBytes.Length - 1);
bmp.UnlockBits(bdata);
functionReturnValue = bmp;
return functionReturnValue;
}
</code></pre>
<p>Unfortantely I am getting a very pink image and wanted to try and fix this by converting the image from RBG565 to RGB888. Let me know if you have any suggestions.</p>
| c# | [0] |
527,151 | 527,152 | Reference types live on the heap, value types live on the stack | <p>while reading "C# in Depth" I was going through the section "Reference types live on the heap, value types live on the stack."</p>
<p>Now what I could understand is (mainly for ref type) :</p>
<pre><code>class Program
{
int a = 5; // stored in heap
public void Add(int x, int y) // x,y stored in stack
{
int c = x + y; // c stored in stack
}
}
</code></pre>
<p>Just want to clarify if my assumptions are right. Thanks.
EDIT:
I should have used diff variables, i think it created a confusion.so I have modified the code.</p>
<p>EDIT:
Yes, as Jon mentioned - it's a myth, I should have mentioned that.My apologies.</p>
| c# | [0] |
5,460,578 | 5,460,579 | I am having problem with jquery function | <p>I am trying to make small calculator in jquery but don't know where to start, pls help</p>
<pre><code><body>
<script>
$(document).ready(function(){
function show_total(){
document.write('something');
}
$("#form1").submit(function(){
$("#total").append('<p>show total</p>');
});
});
</script>
<form id="form1">
num1 <input type="text" id="in1" size=5 /> +
num2 <input type="text" id="in2" size=5 />
<input type="submit">
</form>
<div id="total"></div>
</code></pre>
| jquery | [5] |
5,006,846 | 5,006,847 | I have to search for a file with extension .txt, but the path is changing every day | <p>I have a problem with file management.
I have to search for a file with extension .txt, but the path is changing every day.</p>
<p>I have an another file which contain the actual path, I can store it in a string, but when I
give the searching algorithm the windows drop an error message.</p>
<p>Here my script: </p>
<pre><code>path= 'c:\..... this is the path what I get back from an another script'
os.chdir(path)
for files in os.listdir("."):``
if files.endswith(".txt"):
print files
</code></pre>
<p>Error message: WindowsError: [Error 3] The system cannot find the path specified: 'c:....'</p>
| python | [7] |
2,523,888 | 2,523,889 | How to append html only if the div is empty in jQuery? | <p>I have this code for displaying content for login and registration in my PHP file:</p>
<pre><code><?php // LOGIN PART ?>
<div class="login-part"></div>
<?php // REGISTRATION PART ?>
<div class="registration-part"></div>
</code></pre>
<p>And this in my js file:</p>
<pre><code>$(document).ready( function() {
// FOR REGISTRATION
$('span.logreg.reg').click(function () {
$('div.registration-part').append('<p>Registration</p>');
});
// FOR LOGIN
$('span.logreg.log').click(function () {
// insert html
$('div.login-part').append('<p>Login</p>');
});
});
</code></pre>
<p>Now, everytime I click on a span it shows the text login or registration, according to which of the span was clicked. </p>
<p>Thats OK, however I need to add it only once, so when the user click more times on the span it will be not adding more text.</p>
<p>Remove() or empty() is not an option, as far as I know, because I need the information inside input boxes (there will be input boxes later for inserting user info) to stay there and not be deleted if the user click accidentally on the span again.</p>
<p>It can however delete the html inside the div, if he clicks on another span. E.g. if span.log is active, after clicking on span.log nothing happens, but if he clicks on span.reg the html inside div.login-part will be removed and registration text will appear.</p>
<p>How to do something like this?</p>
| jquery | [5] |
5,030,892 | 5,030,893 | how to import two same android app in eclipse .. ? either rename package name or what? | <p>Me and my friend started building our first app on android. We started on one laptop and then copied project to another laptop too. Now we started doing our part on android separately.
Now i have to combine the work in one app, So when I tried to import the other project to my workspace, it says "Some projects cannot be imported because they already exist in the workspace" I tried changing my package name too. But even after that, the same warning comes. what to do? thanks</p>
| android | [4] |
2,915,595 | 2,915,596 | Having multiple identical IDs in a loop and using jQuery with them | <p>I have a loop that generates a bunch of these:</p>
<p><code><textarea id="uar"></textarea></code></p>
<p>The same loop generates a submit link next to each textarea.</p>
<p>That link will post this form:</p>
<pre><code><form action="php/unApprovePost.php" method="POST" id="unApprovePost">
<input type="hidden" id="uaid" name="uaid"/>
<input type="hidden" id="uadc" name="uadc"/>
</form>
</code></pre>
<p>I populate <code>#uaid</code> successfully, but when I try to populate <code>#uadc</code>, only the first iteration of the loop has functionality. What I mean is - only the first textarea will properly post what I want. If I try using any textareas other than the first one, they don't submit anything. I think it has something to do with the uniqueness of IDs in HTML. I tried using a class <code>.uar</code> but that doesn't really work either - same behavior. Any help?</p>
<p>Here's my jQuery code:</p>
<pre><code> $('#unApprovePost').submit(function() {
$('#uadc').val($('#uar').val());
});
</code></pre>
<p><b>Edit:</b>
There is a dynamic amount of loop iterations, so I can't really have something like class="uar1". I tried making it class <code>.uar</code> for the textareas and using this jQuery code:</p>
<pre><code>$('#unApprovePost').submit(function() {
$('#uadc').val($('.uar').val());
});
</code></pre>
<p>But the problem persists.</p>
| jquery | [5] |
3,326,479 | 3,326,480 | android not picking up spinners, strings, layout | <p>I've been working on a android project and imported it at home, yet when I try and compile it on my home laptop I get loads of errors which seem to be related to spinners, listviews etc not picking up the relevant layout files under my android project for example I have a spinner named SpinnerDay and in my layout XML file I have an id assigned to this spinner,this is what I have:</p>
<pre><code>android:id="@+id/spinnerDay"
</code></pre>
<p>in my actually class file I have this</p>
<pre><code>Spinner day = (Spinner) findViewById(R.id.spinnerDay);
</code></pre>
<p>yet in eclipse it says do I want to change the spinner to changeTo "button1" etc......</p>
<p>I have the same problem when using an array attached to the spinner which is declared in my strings XML file it just doesn't seem to pick it up.</p>
| android | [4] |
4,358,721 | 4,358,722 | Server Error in Application "SMS1" HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. | <h1>Detailed Error Information</h1>
<p>Module DirectoryListingModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x00000000
Requested URL <a href="http://localhost:4049/" rel="nofollow">http://localhost:4049/</a>
Physical Path C:\inetpub\wwwroot\web\webmob
Logon Method Anonymous
Logon User Anonymous
Most likely causes:</p>
<pre><code>* A default document is not configured for the requested URL, and directory browsing is not enabled on the server
</code></pre>
| asp.net | [9] |
2,563,602 | 2,563,603 | syntax error, unexpected '{' php | <p>My php code gives the following error:</p>
<pre><code>syntax error, unexpected '{' on line 8
</code></pre>
<p>PHP Code:</p>
<pre><code>$data = '<?php
# 1 = ON; 0 = OFF.
$str = '{ //line 8
"name": "10.000000,106.000000",
"Status": {
"code": 200,
"request": "geocode"
},
"Apps": [ {
"App1": 1,
"App2": 0,
"App3": 1,
"App4": 0,
"App5": 0,
"App6": 0
} ]
}';
echo $str;
?>';
</code></pre>
<p>I'm a newbie to php. Can anybody help me finding where I'm wrong? Thanks.</p>
| php | [2] |
1,229,593 | 1,229,594 | JS: Remove everything after nth interation of chacter | <p>Trying to convert RGBA to HEX, discarding the transparency. There are a number of ways to convert RGB to HEX, and it seems the simplest way to get HEX out of RGBA is to simply discard the content of the alpha.</p>
<p>Hoping to turn this:</p>
<p><code>rgba(255,255,255,0.95)</code></p>
<p>Into this:</p>
<p><code>rgb(255,255,255)</code></p>
<p>Then use this:
<a href="http://haacked.com/archive/2009/12/29/convert-rgb-to-hex.aspx" rel="nofollow">http://haacked.com/archive/2009/12/29/convert-rgb-to-hex.aspx</a></p>
<p>to get <code>#FFFFFF</code></p>
<p>Open to a direct conversion as well, this just seems like a simple substring operation which eludes me at the moment.</p>
| javascript | [3] |
4,471,809 | 4,471,810 | java concatenate two strings error | <p>I have one function that returns me String :</p>
<pre><code>public String getString(String password){
......
try {
.......
encodedPassword = Base64.encodeToString(msgDigest,1 );
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return encodedPassword;
}
</code></pre>
<p>I want to add (concatenate) "=" String to returning string from function</p>
<p>I try using this:</p>
<pre><code>encrptdPassword = getString("1234");
encrptdPassword = encrptdPassword+"=";
</code></pre>
<p>Or:</p>
<pre><code>encrptdPassword = encrptdPassword .concat("=");
</code></pre>
<p>but I get result like two different objects (space or brake between)</p>
<p>I think problem is in Base64.encodeToString , but I must use 64 based string </p>
<hr>
<p>Function <code>getString</code> returns me:</p>
<pre><code>A6xnQhbz4Vx2HuGl4lXwZ5U2I8iziLRFnhP5eNfIRvQ
</code></pre>
<p>I want to add <code>=</code> to the returning string as:</p>
<pre><code>A6xnQhbz4Vx2HuGl4lXwZ5U2I8iziLRFnhP5eNfIRvQ=
</code></pre>
<p>but I receive this on output </p>
<pre><code>A6xnQhbz4Vx2HuGl4lXwZ5U2I8iziLRFnhP5eNfIRvQ =
</code></pre>
<p>Or:</p>
<pre><code>A6xnQhbz4Vx2HuGl4lXwZ5U2I8iziLRFnhP5eNfIRvQ
=
</code></pre>
<p>...like 2 different strings.</p>
<p>Where I'm wrong?</p>
| java | [1] |
3,669,162 | 3,669,163 | showing only the filtered column in the datagridview | <p>i am a newbie and a student
i have a windows form in which is have a datadrid view.
i have table in sql server, i have binded with the datagrid,
in the table there is a 3 column and in which one column named date of small-date-time datatype,
i just binded the datagrid view to the table and it is showing all the rows of the three column i want to filter that. i have three column one is "name" second is "surname" and third is "date" date contains smalldatetime datatype and i want to show all the three columns but the columns which has the "date" columns as 30/12/12 if the date is 31/12/12 means the record from the previous date
sorry for the bad explanation i am weak in english
i dont know what to use here
can i achieve this?</p>
| c# | [0] |
1,569,046 | 1,569,047 | How To Use "dmtracedump tool " in Android Application | <p>How to use the <strong>dmtracedump</strong> tool with the Android Application.<br>
Could you please let me know the steps or procedure for running the tool?</p>
| android | [4] |
1,817,897 | 1,817,898 | How to make a upload script in one page only? | <p>Can anyone give a sample of an upload script that will process the upload and the validations in one page? Or the concept/idea on how to make it. Thanks a lot!</p>
| php | [2] |
4,053,782 | 4,053,783 | Putting a closure to JS Closures | <blockquote>
<p>a closure is the local variables for
a function - kept alive after the
function has returned.</p>
</blockquote>
<p>I'm wrapping my head around JS & jQuery Closures. From the definition above my understanding is a closure allows access to variables outside a function without the
need for creating globals, eliminating the inherent risk. Is my interpretation correct?</p>
<p>As always many thanks. </p>
| javascript | [3] |
4,171,602 | 4,171,603 | Class for calculating arbitrarily large numbers? | <p>I was wondering if there might not be a class that would allow as much accuracy as there is memory. With overloaded operators in order to do arithmetic on it as if it was a normal number.</p>
<p>Ex:</p>
<pre><code>BigNumber num;
num = 8;
for(int i = 0; i < 5000000; ++i)
{
num *= num;
}
</code></pre>
<p>Thanks</p>
| c++ | [6] |
3,886,975 | 3,886,976 | Multiple Update panel : How to know which one triggered the postback | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4851694/how-to-know-which-updatepanel-causes-the-partial-postback">How to know which UpdatePanel causes the partial PostBack?</a> </p>
</blockquote>
<p>In case of multiple update panels on page how to know which update panel triggered the post back.</p>
| asp.net | [9] |
1,107,264 | 1,107,265 | How to Delete group name from group fields in crystal reports | <p>How do you delete a group name in Crystal Reports 2010 with Visual Studio 2010?</p>
| asp.net | [9] |
2,130,067 | 2,130,068 | Call JSONArray items in ListView in android | <p>Hi need to call JSONArray
<code>{"questions":{"poll_id":"1","user_id":"110","questions":"Captial of USA?"},"answers":[{"poll_id":"1","answer_id":"1","answer":"New York"},{"poll_id":"1","answer_id":"2","answer":"New Jersy"}]}</code> in to the listview, im new to the android plz.... help me in this.</p>
<p>I got questions part, but i need to show answers part in the listview. </p>
| android | [4] |
3,988,222 | 3,988,223 | Browse through the files in android | <p>I want to develop a code to browse the all folders and files in android emulator including sd card and internal memory storage. In Java there is JFileChooser available, in android how can i implement this functionality...?</p>
| android | [4] |
5,167,499 | 5,167,500 | Replace a link with it's text with jQuery | <pre><code><a href="#">TEST</a>
</code></pre>
<p>I want to remove the anchors and keep the Text i.e TEST</p>
| jquery | [5] |
2,843,169 | 2,843,170 | C# - Events Question | <p>Can any C# object be set up such that an event can be tied to it to fire when it's value changes? If so, how is this done? For example, let's take a very simple example. Say I have a variable declared as follows:</p>
<pre><code>int i;
</code></pre>
<p>Is it possible to create an event that fires any time the value of i changes?</p>
<p>Thanks.</p>
| c# | [0] |
3,663,235 | 3,663,236 | How can I open a Visual Web Developer 2010 Express in Visual Studio 2005 | <p>Can anybody tell me how to open a VWD 2010 Express project in Visual Studio 2005?</p>
| asp.net | [9] |
5,355,698 | 5,355,699 | Is it possible to use Obsolete attribute on only a getter or a setter of a property | <p>Is it possible to use Obsolete attribute on only a getter or a setter of a property?</p>
<p>I would like to be able to do something like this:</p>
<pre><code>public int Id {
get { return _id;}
[Obsolete("Going forward, this property is readonly",true)]
set { _id = value;}
}
</code></pre>
<p>but obviously that will not build. Is there a work around that allows me to apply this attribute to just the setter?</p>
| c# | [0] |
366,384 | 366,385 | Unable to cast object of type 'ASP.masterpage_mpname_master' to type 'ITest' | <p>I am developing a web application. I have created an interface ITest</p>
<pre><code>public interface ITest
{
void Add();
}
</code></pre>
<p>& a usercontrol which implements ITest</p>
<pre><code> public partial class WebUserControl1 : System.Web.UI.UserControl, ITest
{
public void Add()
{
throw new NotImplementedException();
}
}
</code></pre>
<p>On my webpage i have placed usercontrol. but, when i typecast the usercontrol to type IType it throws an Exception(System.InvalidCastException)</p>
<pre><code> protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// WebUserControl11.Add();
foreach (var uCnt in this.Page.FindControlsOfType<UserControl>())
{
if (uCnt.Visible)
{
((ITest)uCnt).Add(); //Error : Casting Exception
}
else
{
}
}
}
}
</code></pre>
<p><strong>I can call Add method directly</strong> but, I want to call it using ITest Interface</p>
| asp.net | [9] |
3,257,442 | 3,257,443 | Cast to pointer from integer of different size in performSelectorOnMainThread:withObject:waitUntilDone | <p>I have:</p>
<pre><code> BOOL someBoolValue = ... //some code returning BOOL
</code></pre>
<p>when I try to invoke:</p>
<pre><code>[self performSelectorOnMainThread:@selector(refreshView:) withObject:someBoolValue waitUntilDone:NO];
</code></pre>
<p>I'm getting a warning:</p>
<blockquote>
<p>cast to pointer from integer of different size</p>
</blockquote>
<p>Any hints on this? </p>
| iphone | [8] |
429,049 | 429,050 | How can I add a C++ DLL file in my .NET application? | <p>How can I add a C++ DLL file in my .NET application?</p>
| c# | [0] |
4,056,589 | 4,056,590 | How to iterate the installed fonts using javascript? | <p>How to iterate the installed fonts using javascript?</p>
| javascript | [3] |
5,438,347 | 5,438,348 | Why does string equality compares characters? | <p>I am just a bit confused with strings, and their comparison.
What I understand is that doing this :</p>
<pre><code>string one = "stackoverflow";
string two = "stackoverflow";
bool equal = one == two;
</code></pre>
<p>This will compare character by character right?</p>
<p>Why is this the case? if string are immutable, and two variables will always refer to the same string if they have equal characters. Why doesn't the compiler just checks the references?
If there is one place where I would think that references equality means value equality I would think that would be for strings. What am I missing?</p>
| c# | [0] |
4,158,158 | 4,158,159 | How do I read one number at a time and store it in an array, skipping duplicates? | <p>I'm trying to read numbers from a file into an array, discarding duplicates. For instance, say the following numbers are in a file:</p>
<pre><code>41 254 14 145 244 220 254 34 135 14 34 25
</code></pre>
<p>Though the number 34 occurs twice in the file, I would only like to store it once in the array. How would I do this?</p>
<p>(fixed, but I guess a better term would be a 64 bit Unsigned int) (was using numbers above 255)</p>
| c++ | [6] |
3,587,127 | 3,587,128 | line of code converting char to string --> foobar(string("text")+anotherString) | <p>I have a line of code that seems to convert a char array to a string</p>
<pre><code>foobar(string("text")+anotherString);
</code></pre>
<p>foobar expects a std::string as an argument</p>
<p>I've never seen a conversion done this way... what function is being called on "text". or is it some tricky way of casting?</p>
| c++ | [6] |
398,080 | 398,081 | Folder filtering in File Explorer | <p>I make an app in which file explorer are used.I want to filter the all files and folders(Global Filtering)...In simple word i want to apply search to file explorer.please help me ...thanx</p>
| android | [4] |
516,478 | 516,479 | Resetting textbox text via javascript | <pre><code>function clickButton(e, buttonid)
var evt = e ? e : window.event;
var bt = document.getElementById(buttonid);
if (bt) {
if (evt.keyCode == 13) {
bt.click();
return false;
}
}
}
txtChatMessage.Attributes.Add("onkeypress", "return clickButton(event,'" + btnSendChat.ClientID + "')");
</code></pre>
<p>this function is an attribute that is set in code behind file. How do I reset the text in textbox after the button click fires</p>
| asp.net | [9] |
4,328,997 | 4,328,998 | how to retrieve the value from text field? | <p>How to retrieve the value from text field?
And how to concanate the value in jquery?</p>
| jquery | [5] |
4,572,665 | 4,572,666 | android multithreading and network on main thread exception; | <p>Consider the scenario where I have get data from server and post it to UI in say list view , but this is an going activity ,it never stops.</p>
<pre><code>taskA{ //fetches data over network
if(!update)
fetch();//network operation
}
taskB{//using this data UI is updated at runtime just like feed.
if(update)
show();//UI operation
}
</code></pre>
<p>taskA starts first after it completes taskB starts by that time A is sleeping and vice versa , goes , now the problems i am facing are:</p>
<ol>
<li>both operations have to be in worker thread</li>
<li>both operations are going in cycle till activity is alive.</li>
<li>if handler is used to post UI operation to the main thread , taskB seems to stop.</li>
</ol>
<p>Can anybody please suggest me a design to get this working?</p>
| android | [4] |
4,132,118 | 4,132,119 | How is exponentiation implemented in Python? | <p>I am able to compute any normally computable fibonnaci number (unless the result becomes to large) in a constant time using Binet's formula ie closed solution formula to compute fibonnaci numbers. Here is my code:</p>
<p>for the non-recursive implementation of fibonnaci:</p>
<pre><code>gr = (1 + 5**0.5) / 2
def gfib(n):
return int(((gr**n - (1-gr)**n) / 5**0.5))
</code></pre>
<p>I understand a^n indicates exponential run time complexity, however this is not the case when the code is run in python, as this computes the nth fibonnaci number instantly. I've done some research on how exponents are implemented in python (maybe exponentiation by squaring?) to give the constant time solution that I get, but haven't found a definitive answer. Any ideas?</p>
| python | [7] |
4,690,984 | 4,690,985 | Android ListPrefrence changes if other ListPrefrence has a different value | <p>I dont know how to implement this this is what i want:</p>
<p>This is a string array in the prefrences menu
Black Eagles Theme
NBB Theme</p>
<pre><code></string-array>
<string-array name="themeValues">
<item c="BlackEagles Theme">1</item>
<item c="nbb theme">2</item>
</string-array>
</code></pre>
<p>then i have a second prefrences item:
2px
4px</p>
<pre><code></string-array>
<string-array name="themeValues">
<item c="2">2</item>
<item c="4">2</item>
</string-array>
</code></pre>
<p>But this i want to change depending the selected theme so i mean when i select blackEagles i want to have 2 and 4 px
and when i select NBB i want to have 3px and 6px
how do i implement this?</p>
<p>gr</p>
| android | [4] |
785,304 | 785,305 | how can we download a file from a server to our document directory in iphone? | <p>i want to download a file from a server using API as i send a request the content on that link comes to my document directory in iphone/ipod touch, and after downloading is it possible to remove them from the document directory. is there any way to do the things like that .</p>
<p>Thanks
Balraj</p>
| iphone | [8] |
1,800,150 | 1,800,151 | C# -Default Keyword | <p>1) What is the use of "Default" keyword in C# ?(Please give me a simple example).<br>
2) Is it introduced in C# 3.0 ?</p>
| c# | [0] |
2,652,999 | 2,653,000 | Mono android : how to call a number with "#" at the end of it by the application? | <p>When i was trying to make a recharge command using this code : </p>
<pre><code>var callIntent = new Intent(Intent.ActionCall);
callIntent.SetData(Android.Net.Uri.Parse("tel:*1400*123456789#"));
StartActivity(callIntent);
</code></pre>
<p>The "#" latter is not dialed , just the *1400*123456789 part is dialed without # ?</p>
<p>i tried to make it by a variable but failing again !
what is the problem and any solution please ?</p>
<p>Thanks you .</p>
<p>Thank you very much , i found the solution here :
<a href="http://code.google.com/p/android/issues/detail?id=1285" rel="nofollow">http://code.google.com/p/android/issues/detail?id=1285</a></p>
<p>Thanks.</p>
| android | [4] |
5,697,404 | 5,697,405 | How to pull string from bundle in onResume()? | <p>I have an activity that is resumed after a user picks a contact. Now before the user picks a contact onSavedInstanceState is called and i put a string in the Bundle. Now, After the user selects the contact and the results are returned. onRestoreInstanceState doesnt get called. only onResume() gets called. So how would i go about pulling my string back out of the bundle once the activity is resumed?</p>
| android | [4] |
5,924,629 | 5,924,630 | Accessing implemented class methods through interface reference without constructor initialization | <p>I have a class <code>CommonDaoImpl</code> that implements an interface <code>CommonDao</code>. Now i am trying to access the <code>getRegisterData()</code> of <code>CommonDaoImpl</code> through interface <code>CommonDao</code> reference like this</p>
<pre><code>public class CommonServiceImpl implements CommonService
{
CommonDao commonDao
public boolean insertRegisterData(CommonBean objCommonBean) {
return commonDao.getRegisterData(objCommonBean);
}
</code></pre>
<p>but it is not working and thow an NullPointerException</p>
<p>So i slightly change my code and initialize interface reference with the constructor of implemented class CommonDao impl like this</p>
<pre><code>public class CommonServiceImpl implements CommonService
{
CommonDao commonDao=new CommonDaoImpl();
public boolean getRegisterData(CommonBean objCommonBean) {
return commonDao.insertRegisterData(objCommonBean);
}
</code></pre>
<p>But i could not understand why it happens.</p>
| java | [1] |
2,310,328 | 2,310,329 | C++ prime number generator is not working | <pre><code>#include <iostream>
using namespace std;
int checkIfPrime(int num) {
for (int i = 1; i < num; i++) {
int result = num / i;
if (num == result * i) {
return 0;
}
}
}
int main() {
int i = 3;
while(1) {
int c = checkIfPrime(i);
if (c != 0) {
cout << c << "\n";
}
i = i + 2;
}
}
</code></pre>
<p>Sorry about posting the wrong code! </p>
<p>When I run this, nothing happens.. Can someone tell me what I am doing wrong?</p>
| c++ | [6] |
1,960,508 | 1,960,509 | jquery, wait for completed | <p>how to run the second function only when the first will be completed in?</p>
<pre><code>$(document).ready(function() {
$("#first").load("first.php?id="+ Math.random());
$("#second").load("second.php?id="+ Math.random());
});
</code></pre>
| jquery | [5] |
3,624,680 | 3,624,681 | Run Function After Delay | <p>I have the below global jQuery function stored, but on page load, I want to execute it after a 1000 delay. Is there something wrong with my syntax? I know the delay always goes before the function. I it is not responding.</p>
<p>Thank you stack gods.</p>
<p>Global function:</p>
<pre><code>function showpanel() {
$(".navigation").hide();
$(".page").children(".panel").fadeIn(1000);
;}
</code></pre>
<p>Executing function:</p>
<pre><code>parallax.about.onload=function(){
$('#about').delay(3000).showpanel();
};
</code></pre>
| jquery | [5] |
3,567,459 | 3,567,460 | object quantity from same class | <pre><code>class a {
}
$obj1 = new a();
$obj2 = new a();
$obj3 = new a();
</code></pre>
<p>May be very trite, but... how many object creates this code?</p>
<p>I think, may be this code greates only 1 object in this line <code>$obj1 = new a();</code> and <code>$obj2</code> and <code>$obj3</code> just indicate on an already created object?</p>
<p>I am wrong?</p>
| php | [2] |
800,106 | 800,107 | Convert a datetime to string | <p>Howsit! </p>
<p>I encounter an error when i get a null value in my datareader. </p>
<pre><code>public List<Complaint> View_all_complaints()
{
csDAL objdal= new csDAL();
List<Complaint> oblcomplist=new List<Complaint>();
using( IDataReader dr=objdal.executespreturndr("View_all_complaints"))
{
while (dr.Read())
{
Complaint objcomp= new Complaint();
populate_reader(dr,objcomp);
oblcomplist.Add(objcomp);
}
}
return oblcomplist;
}
public void populate_reader(IDataReader dr, Complaint objcomp)
{
objcomp.ref_num = dr.GetString(0);
objcomp.type = dr.GetString(1);
objcomp.desc = dr.GetString(2);
objcomp.date = dr.GetDateTime(3);
objcomp.housenum = dr.GetInt32(4);
objcomp.streetnum = dr.GetInt32(5);
objcomp.status = dr.GetString(6);
objcomp.priority = dr.GetString(7);
objcomp.cid = dr.GetInt32(8);
if (!dr.IsDBNull(9))
{
objcomp.resolved_date = dr.GetDateTime(9);
}
}
</code></pre>
<p>in sql resolved date allows null values, this is so because only when a complaint has been resolved , it must reflect that date otherwise it should be null. </p>
<p>if dr.getdatetime(9) is null then it must just set a string saying "Not Resolved"</p>
<p>please help!</p>
| c# | [0] |
150,974 | 150,975 | I'm trying to add percentages to the scrollBar but why is it blinking while progress? | <p>This is the code I'm using:</p>
<pre><code>private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
progressBar1.Value = e.ProgressPercentage;
progressBar1.Refresh();
int percent = (int)(((double)(progressBar1.Value - progressBar1.Minimum) /
(double)(progressBar1.Maximum - progressBar1.Minimum)) * 100);
using (Graphics gr = progressBar1.CreateGraphics())
{
gr.DrawString(percent.ToString() + "%",
SystemFonts.DefaultFont,
Brushes.Black,
new PointF(progressBar1.Width / 2 - (gr.MeasureString(percent.ToString() + "%",
SystemFonts.DefaultFont).Width / 2.0F),
progressBar1.Height / 2 - (gr.MeasureString(percent.ToString() + "%",
SystemFonts.DefaultFont).Height / 2.0F)));
}
listBox1.Items.Add( "Converting File: " + e.UserState.ToString());
textBox1.Text = e.ProgressPercentage.ToString();
}
</code></pre>
<p>While it's processing and moving to the right the percentages are some blinkings it's not smooth enough.</p>
<p>And also when its finishing the process in the end the percentages are gone only the green color is left.</p>
| c# | [0] |
2,550,430 | 2,550,431 | Java - Send Email using Default Email Provider | <p>I have written a Java Code so that if a button is pressed the default email provider would open up automatically to be able to send an email. is there a possibility that i can attach a file to the email automatically and set a subject for the emails?</p>
<p>this is the code so far:</p>
<pre><code> if(role.getValue().equals("1")) {
try {
Desktop.getDesktop().browse(new URI("mailto:username@domain.com?subject=New_Profile&body=see attachment&attachment="PVS_XML.xml""));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
</code></pre>
<p>the code above is for some reason not working: its underlining the whole of mailto method saying : Syntax error, insert ";" to complete BlockStatements. </p>
<p>Any ideas why ?</p>
| java | [1] |
3,885,015 | 3,885,016 | Java initialization | <p>I've been coming across this code several times and I would like to know what it means or what it is equivalent to:</p>
<pre><code>A a = new A() {
// declare some methods and whatever
};
</code></pre>
<p>What does the above mean? What is it equivalent to (if it is equivalent to anything)?</p>
| java | [1] |
3,992,424 | 3,992,425 | hours range and resetting the hours on the new day | <p>I have the following code </p>
<pre><code>$date = new DateTime($json->date);
$hour = $date->format( 'H' );
$range = range($hour, 23, 3); // get the range for the data to be provided;
foreach($json->hourly as $hourlyData){
if(in_array($hourlyData->hour, $range)){
print_r($hourlyData->hour);echo '<br />';
}
}
</code></pre>
<p>the code above looks at current time. If time is 4, then it will add an echo for every 3 hours as the range would be (4,23, 3). This all is good. However, this above is only for current day. But for next day, I want the range to be reset and instead of from 4, it will be from 1 till 23. So the range will reset to (1,23,3) and so on. </p>
| php | [2] |
1,645,941 | 1,645,942 | Swapping element class using jQuery | <p>I have an element :</p>
<pre><code>...
<li class="products active"><a href="" title="Title">test</a></li>
...
</code></pre>
<p>I want to access this "li" tag and swap the "active" class to "past" class
so the final result would be :</p>
<pre><code>...
<li class="products past"><a href="" title="Title">test</a></li>
...
</code></pre>
<p>What is the easiest / efficient way to achieve this using jQuery ?</p>
| jquery | [5] |
2,890,498 | 2,890,499 | How to get from php file the value of a label in asp project | <p>I have a php file with the following code:</p>
<pre><code><form action="">
<label for="Exists"><?php echo $Var; ?></label>
</form>
</code></pre>
<p>How can I get from asp.net webpage in a textbox the value of the lable called Exists ?</p>
| asp.net | [9] |
3,496,032 | 3,496,033 | Strange behaviour with incrementing int when using Action<> delegate | <p>Given the code below:</p>
<pre><code>class Sample
{
public static void Run()
{
int i = 1;
Action<int> change = Increment();
for (int x = 0; x < 5; x++ )
{
change(i);
Console.WriteLine("value=" + i.ToString());
}
}
public static Action<int> Increment()
{
return delegate(int i) { i++; };
}
</code></pre>
<p>} </p>
<p>I get the answer:</p>
<p>value=1
value=1
value=1
value=1
value=1
value=1</p>
<p>Instead of 1, 2, 3 ... 6.</p>
<p>This is from an article on the net with links to clues but I can't work out why this is. Anyone have any ideas?</p>
| c# | [0] |
4,561,230 | 4,561,231 | Developing call/vocie recording app (iphone)? | <p>I want to make an iphone application to record the incoming and outgoing calls. If I can't develop such app , What are the technology and hardware hindrance in doing so ? BTW i was thinking to run my app in background while call, Hence recording the input and output voice through my app .</p>
| iphone | [8] |
5,823,689 | 5,823,690 | Unable to hide TabBar on sub view in iphone | <p>My app flow requires Navigation and TabBar controller. So I decided to use TabBar template. Since my first page is login which do not require TabBar, I used <em>presentModelViewController</em> to show Login screen which have Navigation bar if user Navigate to Forgot password.</p>
<pre><code>LoginView *rootView = [[[LoginView alloc] init] autorelease];
navigationController= [[[UINavigationController alloc] initWithRootViewController:rootView] autorelease];
[tabBarController presentModalViewController:navigationController animated:FALSE];
</code></pre>
<p>Ones the user login I dismiss view controller and show TabBar with 5 Tab and Each Tab contain TabaleView. User select any row and navigate to sub view. </p>
<p>The issue is, on sub view I dont need tab bar. (TabBar is needed ONLY on dashboard). If I hide tabBar a white space remain there. Is there any workaround to solve this issue?</p>
| iphone | [8] |
832,643 | 832,644 | Multiple values in array | <p>Is it possible to use PHP in_array to check for multiple values? For example I can do this to see if 7 is in array. What if I have 7 and 8? </p>
<pre><code>if (in_array(7, $_SESSION[myvalues]) ) {
}
</code></pre>
<p>UPDATE:</p>
<p>I ran the code above. I know it works but it only looks for a single value in an array. I tried </p>
<pre><code>if (in_array(array(7,8), $_SESSION[myvalues]) ) {...}
</code></pre>
<p>but that looks for both. I was looking for at least one. Ended up doing</p>
<pre><code>if (in_array(7, $_SESSION[myvalues]) || in_array(8, $_SESSION[myvalues])) {...}
</code></pre>
| php | [2] |
1,691,790 | 1,691,791 | Image to a Web server | <p>I want to send an Image to web server in Http Post Method.</p>
<p>The request is looking for URL of that image.How can i get the URL of an image in mobile?</p>
| android | [4] |
4,082,686 | 4,082,687 | jquery, attaching objects (instead of string attribute) to an element | <p>I'm trying to build DOM with jQuery and fill it with data that is received with AJAX (data type = json). I'd like to also store this data as an object, attached to a specific DOM element. Does jQuery provide any method for this? The reason I want to do it is because only part of data is initially displayed; other data might be needed later, depending on user actions.</p>
<p>I tried using <code>attr()</code>, but it stores a string "[object Object]" instead of an actual object:</p>
<pre><code>var div = $('<div/>');
div.attr('foo', {bar: 'foobar'});
alert(div.attr('foo')); // gives "[object Object]"
alert(typeof div.attr('foo')); // gives "string"
alert(div.attr('foo').bar); // gives "undefined"
</code></pre>
<p>Another way to do this would be by "bypassing" jQuery (<code>div[0].foo = {bar: 'foobar'};</code>), though this seems to be a "dirty workaround", if jQuery happens to already support attaching objects.</p>
<p>Any ideas? Thanks in advance!</p>
| jquery | [5] |
286,522 | 286,523 | superscript in asp label | <p>i wish to display a single label as "18th january 2011"... where 'th' hs to be in superscript.. how to do in asp.net with label?? </p>
| asp.net | [9] |
2,715,467 | 2,715,468 | How to make jQuery functions sequential | <p>I have the following code:</p>
<pre><code>$(document).ready(function() {
loadStuff(someURL, someID);
showStuff('foo');
});
</code></pre>
<p>showStuff() relies on content generated by loadStuff() but it seems as if showStuff() is jumping the gun before said content is available. How can I force them to run sequentially?</p>
<p>Update: Yes, there are ajax calls in loadStuff but unfortunately they're jsonp so can't be called synchronously.</p>
| jquery | [5] |
3,219,028 | 3,219,029 | How to call onDraw after setContentView(R.layout.main)? | <p>I have something to draw at runtime. I did drawing in onDraw in MyView class.
Because, I already used setContentView(R.layout.main) in onCreate, I cannot use it again.<br>
How to call onDraw after setContentView(R.layout.main)?</p>
<pre><code>public class MyActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main); // I have something to draw in XML also.
MyView myView = new MyView(this);
// setContentView(myView); I cannot use setContentView two times.
}
protected class MyView extends View {
public MyView(Context context) {
super(context);
}
public void onDraw(Canvas canvas) {
// there are some drawing codes and these cannot be done in XML.
}
}
</code></pre>
| android | [4] |
5,115,833 | 5,115,834 | jquery - how to make a dialog box when user clicks a link? | <p>I am new to JQuery. I want to know that how to make a dialog box that popsup when user clicks a link like if i click send then a dialog box popsup to tell that your information has been sent!</p>
<p>Any help would be appreciated!</p>
| jquery | [5] |
2,688,219 | 2,688,220 | Why was I always told "This post does not meet our quality standards."? | <p>I was trying to post a question just now, but I was always told "This post does not meet our quality standards" when I clicked the "Post Your Question" button. Why? The screenshot of my question is here: <a href="http://i41.tinypic.com/ws5lj7.png" rel="nofollow">http://i41.tinypic.com/ws5lj7.png</a></p>
| java | [1] |
1,372,430 | 1,372,431 | Convert paths that start with "content//:" or "/data/.." to URI | <p>I have two types of file paths, one I get from my sqlite db and one I derive locally. </p>
<p>The one that comes from db has the following format "content://mnt/sdcard/data/download/image1"
And the one locally is "/data/data/com.mytestapp/files/image1.png"</p>
<p>I need to convert both to URI without knowing which one i get. Is there a way to do it?</p>
<p>From trial and error it seems that Uri.parse does not work property on the second type as it does not add the prefix file:/// to it.</p>
<p>URI.fromFile does not work on the first type as it as it becomes file:///content:/.....etc</p>
<p>Any help?
Thanks</p>
| android | [4] |
2,567,974 | 2,567,975 | Problem in creating adHoc build | <p>"The app "App Name" was not installed on iphone "iphone name" because it is not signed."</p>
<p>I m getting this error when I try to create an adhoc build. I founds some solutions and tried those but none of them are working for me.
I have created a distribution certificate again and .mobileprovison certificates for 'n' numebr of times, but still i m getting this error. I have added Entitlements.plsit and also creating build for distribution configuration(which is copy of release). In organizer also it shows a valid provision profile. I m cleaning up Targets all the time when I create the build.
Am I missing any steps to create adhoc build. Please some one help me out of this. I m working on this issue from so many days. </p>
| iphone | [8] |
1,460,642 | 1,460,643 | Best method for generating html content to a single web page | <p>Good day everyone!</p>
<p>I have a single page, this page has no dynamic content.</p>
<p>I have a set of links. What I need is to have content placed on the page based on the link the user clicks.</p>
<p>Example: I have pictures of animals. When the user click a Zebra, the Zebra info is placed on the page.</p>
<p>So the page does not change, meaning the content on the page changes but not the page it self.</p>
<p>The idea is instead of creating different html pages for each animal profile, the profile is generated to the page from another source.</p>
<p>Is is this possible?</p>
<p>What will be the best way to get this accomplish?</p>
<p>Thanks everyone!</p>
<p>IC</p>
| php | [2] |
4,753,151 | 4,753,152 | Implementing a Priority Stack with two stacks | <p>This is how I think it's probably intended to work: You have Stack 1 that's sorted based on the priority and every time a new element comes along that should be in the middle of the stack, you pop out all the elements from Stack 1 onto Stack 2, add the element into place, and then pop all the elements from Stack 2 back to Stack 1.</p>
<p>Does anybody know a more efficient solution?</p>
| java | [1] |
4,038,058 | 4,038,059 | Given a window of an iframe, is there easy access to the owning iframe? | <p>I've been playing around with <em>postMessage</em> just to have a better understanding of how it works, with the following example:</p>
<p><a href="http://hashcollision.org/tmp/hello-iframe.html" rel="nofollow">http://hashcollision.org/tmp/hello-iframe.html</a></p>
<p>It's slightly elaborate: for each character in the message, this constructs an iframe sourced to <a href="http://hashcollision.org/tmp/hello-iframe-inner.html" rel="nofollow">http://hashcollision.org/tmp/hello-iframe-inner.html</a>. I then use postMessage to communicate to each individual iframe, telling it what character to show. Also, the iframes communicate the geometry of the iframe back to the parent page via postMessage too. It's all quite useless, but it's a cute test page.</p>
<p>One of the things that's currently awkward is, given the window of an iframe, to find the owning iframe.</p>
<p>I'm doing a <em>for</em> loop to walk all my iframes and check the window with <em>===</em>, but that seems a bit silly. Are there better ways to do this?</p>
| javascript | [3] |
539,851 | 539,852 | How to determine what is the super class or an interface of an object | <p>say one of my object implements X interface but is returning false when checking with 'instanceof'. How to determine what is the super class or an interface of an object. I am looking for something like </p>
<p>for example:</p>
<pre><code>object.getSuperClassORInterface();
</code></pre>
| java | [1] |
665,714 | 665,715 | jquery function is not working as event handler | <p>Can anyone tell me why this function is not working ?</p>
<pre><code>for(var i=1;i<=12;i++)
{
var btn=$('<div>Button</div>').attr('id', 'id_'+i).button();
btn.css('margin','10px').on('click', showId());
btn.appendTo($('#buttons'));
}
function showId(){
alert($(this).attr('id'))
}
</code></pre>
| jquery | [5] |
5,528,824 | 5,528,825 | How to manage more than one UIImageView in iPhone | <p>I wanna to create dynamically <code>UIImageView</code> on every tap on main view and also wanna to move all the created <code>UIImageView</code> by finger movement.I've got success to dynamic creation on every touch my code is below :</p>
<pre><code>-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint pt = [touch locationInView:self.view];
imgView = [[[UIImageView alloc] initWithFrame:CGRectMake(pt.x,pt.y, 100, 100)] autorelease];
imgFilepath = [[NSBundle mainBundle] pathForResource:@"img" ofType:@"png"];
img = [[UIImage alloc] initWithContentsOfFile:imgFilepath];
imgView.tag=i;
[imgView setImage:img];
[img release];
[self.view addSubview:imgView];
}
</code></pre>
<p>Now I wanna to move any of the dynamically created <code>UIImageView</code> by finger movement on it.
Thanks.</p>
| iphone | [8] |
3,638,560 | 3,638,561 | How to Sort an Unordered List inside an Anchor Tag | <p>I have the following DOM structure (unordered list), that I would like to sort on the <code>a href</code> tag name using jQuery.</p>
<p>Structure is as follows:</p>
<pre><code><div id="refmenu">
<ul id="list">
<li><a href="....">Google</a></li>
<li><a href="....">Apple</a></li>
<li><a href="....">IBM</a></li>
<li><a href="....">Yahoo!</a></li>
<li><a href="....">Hotmail</a></li>
</ul>
</div>
</code></pre>
<p>Based on the above, would like to be able to run this through a jQuery function that will sort the unordered list names alphabetically, obviously also keeping the <code>a href</code> link together with the anchor tag names.</p>
<p>Hope someone can assist.</p>
<p>Thanks.</p>
| jquery | [5] |
844,737 | 844,738 | How to make a good profile view | <p>I've created a vue called profile in wich I put labels that I've named (frist name, family name,adress,etc etc) and for each label there is a textield,
so my idea is to display on the textfield by default for example : enter your first name, enter your family name etc etc, so that once we click on the textfield , the keyboard get displayed.
Is there anybody who can help please ??</p>
| iphone | [8] |
3,235,582 | 3,235,583 | getting rid of redundant type parameters | <p>I have a generic class A, and another class B that handles instances of A and contains some additional data. I need to have two separate classes. B can't inherit from A, because A has other derivatives, B needs to contain a reference to an A.</p>
<p>As a simple example, what I would like to write is this (dictionary is A, dicthandler is B):</p>
<pre><code>class dicthandler<T> where T : Dictionary<Tk, Tv>
</code></pre>
<p>But it doesn't compile, I need to specify all type parameters:</p>
<pre><code>class dicthandler<T, Tk, Tv> where T : Dictionary<Tk, Tv>
</code></pre>
<p>But I actually don't care what Tk and Tv is, so they are completely redundant, I just need T. Whenever I want to create a new instance, I need to specify all type parameters for the constructor, which hurts me.</p>
<p>So clearly I need some tricks. Any ideas?</p>
| c# | [0] |
4,418,702 | 4,418,703 | String Literals | <p>I have few doubts about string literals in c++.</p>
<pre><code>char *strPtr ="Hello" ;
char strArray[] ="Hello";
</code></pre>
<p>Now strPtr and strArray are considered to be string literals.</p>
<p>As per my understanding string literals are stored in read only memory so we cannot modify their values.</p>
<p>We cannot do</p>
<pre><code>strPtr[2] ='a';
and strArray[2]='a';
</code></pre>
<p>Both the above statements should be illegal.
compiler should throw errors in both cases.</p>
<p>Compiler keeps string literals in read only memory , so if we try to modify them compiler throws errors.</p>
<p>Also const data is also considered as readonly.</p>
<p>Is it that both string literals and const data are treated same way ?
Can I remove constantness using const_cast from string literal can change its value?</p>
<p>Where exactly do string literals are stored ? (in data section of program)</p>
| c++ | [6] |
4,065,163 | 4,065,164 | Should I use .eq(0) when using the $("body") selector? | <p>Is there any benefit (performance or otherwise) for me to use the .eq(0) filter when I reference the body tag in a jQuery object? For instance: <strong>$("body").eq(0)</strong> as opposed to just <strong>$("body")</strong>.</p>
| jquery | [5] |
5,908,168 | 5,908,169 | what are the core/basic functions in javascript | <p>Does javascript have a set of core functionality. If so where can I find it?</p>
<p>Java for instance has all the java.lang packages which implement basic language functionality like String. Where is the equivalent of such functions (like window.alert()) implemented in javascript? Is there a set of core/basic functions that are shipped with every javascript implementation? What are these functions? </p>
<p>Thank you</p>
| javascript | [3] |
753,392 | 753,393 | How to retrieve the substring with in the string | <p>I am new to iphone.I have small doubt that is I have a path of my audiofile which is placed in the directory in resources folder that path is </p>
<pre><code>/Users/Chary/Library/Application Support/iPhone Simulator/5.0/Applications/B02404E5-52DC-49B6-8DBB-C9946E4331AF/BiblePlayer.app/raj/1.mp3
</code></pre>
<p>My question is how to retrieve the string "1.mp3" from that entire path?</p>
| iphone | [8] |
3,859,881 | 3,859,882 | kSOAP 2 Android | <p>I don't know why am i not able to get this?....maybe i am missing something or am plain dumb</p>
<p>I want trying to call webservice from a Android App</p>
<p>Now to do this came across that kSOAP 2 for Android is the library that would be needed</p>
<p>However, i see many guys in many posts pointing that one would have to <strong>include the jar for ksoap2 for android platform in eclipse</strong></p>
<p>But which jar to include ?</p>
<p>At "http://code.google.com/p/ksoap2-android/" i see a link to git source where entire source is there.....so is it that i take files needed and make a jar out of it.</p>
<p>Also i see many guys saying to include the jar file ending with "-dependencies"....however, downloading such a file seems to be an issue....i just don't get the file with correct size.</p>
<p>So, which is the jar file to include in eclipse for calling webservices w.r.t. kSOAp 2 ?</p>
<p>Thanks
Yogurt</p>
| android | [4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.