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 |
|---|---|---|---|---|---|
2,280,005 | 2,280,006 | Bind selected record to grid fro xml sheet | <p>I have a xml sheet in the form of</p>
<pre><code><markers>
<marker name="abc1" label="xyz" place="mno">
<marker name="pqr2" label="lmn" place="mno">
<marker name="abc3" label="xyz" place="mno">
<marker name="pqr4" label="lmn" place="mno">
<marker name="abc5" label="xyz" place="mno">
<marker name="pqr6" label="lmn" place="mno">
</markers>
</code></pre>
<ol>
<li>I have to bind this xml file to a grid view and with "name" field as linkbutton.</li>
<li>Clicking on the linkbutton should display a separate grid displaying only that particular record with edit/delete options.</li>
</ol>
<p>first part I am able to do successfully with the help of google. But I am unable to do second part. I am very new to programing. Please help me in codding. Thanks a lot.</p>
| asp.net | [9] |
1,631,347 | 1,631,348 | Using wxwidgets to create a gui | <p>I need to create a cross platform GUI mainly targetting Windows and Linux. I finally decided that I would use the wxWidgets library to get it done since it has a less restrictive license and has a python binding. However I just wanted to know if I would have to install wxPython on every computer that needs to run my GUI. Because I really cant ask the user to go to the site and install wxPython in order to get my software working. Is there any way around this? IS there any other good cross platform GUI toolkit apart from Java,Qt and wxWidgets?</p>
| python | [7] |
517,498 | 517,499 | compare between stored database rows and exact post | <p>I'm going to store some words inside db <code>my_table (id,word)</code> as follow</p>
<p><img src="http://i.stack.imgur.com/ZVLSg.png" alt="my_table"></p>
<p>Now i've input post </p>
<pre><code>$comment = $_POST[comment]; // "blab blah shit blah" have banned word (shit)
</code></pre>
<p>i want to do the following
if the comment contains any of the stored words inside <code>my_table</code> then it gives <code>echo "banned"; exit;</code> and if not then go on <code>echo "passed";</code></p>
<p>how then to compare it ?</p>
<p>is this could be right</p>
<pre><code>SELECT 1
FROM my_table
WHERE $comment LIKE CONCAT('%', my_table.word , '%')
LIMIT 1
</code></pre>
<p>then if gives results then echo <code>"banned";</code> and if not then <code>echo "passed"</code>; !</p>
| php | [2] |
894,755 | 894,756 | track the data usage of each application | <p>I found many functions which can track the entire data usage on android phone. But, is there any function which can track the data usage of each application? </p>
| android | [4] |
726,860 | 726,861 | Sorting my JSON response | <pre><code>{
"JsonResult": {
"List": [{
"Subject": "Something",
"Type": 0,
"TypeDescription": "Referral"
}],
}
}
</code></pre>
<p>This is my sample json response i get while hitting my service, after that i have a button which carries option like <code>Subject, Type and TypeDescription</code>. </p>
<p>How can i sort the Json Response based on the parameter i send. </p>
<pre><code>function sortItems(jsonResponse,paramater){
var sorted = jsonResponse.List.sort( function(a, b) {
var nameA = a.paramater.toLowerCase(),
nameB = b.paramater.toLowerCase();
return nameA.localeCompare(nameB);
}
</code></pre>
<p>Here is the sort function i am using, but its not working. I already have my JSON response and i need to sort at runtime based on the argument i send.</p>
| javascript | [3] |
4,271,672 | 4,271,673 | iPhone SDK: How to get 4.0 on a device? | <p>This is a question about installing 4.0 on an 3rd gen iPod Touch. I already have a developer account. I have also downloaded the 4.0 SDK with XCode. I can test the new functionality in the simulator but I want to also try it on my device hence my question. I am looking for instructions on how to get it on my new third gen iPod Touch. Could someone suggest a link that has worked well for them? thanks.</p>
| iphone | [8] |
3,475,540 | 3,475,541 | My app runs too fast on some Android devices | <p>I just released an app, Avoid The Spikes! on the android market.
Some friends of mine have downloaded the apps on their phones/tablets, and I am told it runs too fast. It runs just fine on my android (HTC Dream). Is there any way to tell how much faster it would run on certain androids, and how to adjust it accordingly? I have searched low and high and have yet to find an answer.</p>
| android | [4] |
524,447 | 524,448 | Iphone - The executable was signed with invalid entitlements | <p>I am trying to load an application on my iphone and this is the error I am receiving. Does anyone know how to fix this. I have searched the forums and S.O. and I cannot find the answer. </p>
<p>The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.</p>
| iphone | [8] |
3,646,671 | 3,646,672 | How to increase text height and width with respect to its div | <p>Below code is to add div with text and call back fuction to increase text size but it is not working properly.I want to resize my div and with that respect text should increase with its height and width.</p>
<pre><code> $("<div>", { 'id' : "dyndiv" + count })
.text($input.val()).addClass("draggable ui-widget-content HandleTopRowBorder").draggable({
containment: '#containment-wrapper',
cursor: 'move',
delay: 200,
distance: 30,
opacity: 0.35
}).resizable({containment: '#containment-wrapper'},
start : function(event, ui)
{ ini_text_size_width = $(this).width(); },
resize: function (event,ui)
{ fin_text_size_width = ($(this).width() / ini_text_size_width);
$(this).css("font-size" ,( parseInt($(this).css("font-size")) + (fin_text_size_width )) + "pt") } });
);
</code></pre>
| jquery | [5] |
5,106,436 | 5,106,437 | mail parsing subject encoding | <p>i am using this class <a href="https://code.google.com/p/php-mime-mail-parser" rel="nofollow">https://code.google.com/p/php-mime-mail-parser</a></p>
<p>to parse emails</p>
<p>class is fully of problems</p>
<p>today i found big one</p>
<p>i have just recieved message from gmail now</p>
<p>message subject is encoded, and i can't decode it!</p>
<pre><code>Subject: =?windows-1256?B?4+XjIMzPx/AgyO3kx8ogys7VIMfhz+bj7eQ=?=
From: Some One <someone@gmail.com>
</code></pre>
<p>i can't decode the subject..</p>
<p>any one know a better mail parsing class?</p>
<p>IF NO: How can i decode this subject?</p>
| php | [2] |
2,155,773 | 2,155,774 | Parsing a string | <p>I want to parse a string to long the value is 1.0010412473392E+15.But it gives a exception input string was not in a correct format.how to do this.</p>
<p>Both these answers work how to select both of them as answer.</p>
| c# | [0] |
3,811,325 | 3,811,326 | uiview CGAffineTransform animates backwards | <p>I have a <code>UIView</code> subclass which I am able to successfully use <code>UIView</code> animations on.</p>
<p>This <code>UIView</code> also has subviews, which I also want to be able to <code>UIView</code> animate.</p>
<p>However, it seems that whenever I create an animation and apply it to the parent view it works fine, but if I apply the animation to the child view it animates backwards.</p>
<p>For example, if I scale my <code>UIView</code> parent(self) by a factor of 2 (to double the width and height):</p>
<pre><code>[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate: self];
[UIView setAnimationDuration:2];
[UIView setAnimationDelay:2];
CGAffineTransform scaleTransform = CGAffineTransformScale( self.transform, 2, 2 );
self.transform = scaleTransform;
[UIView commitAnimations];
</code></pre>
<p>then this works fine.</p>
<p>But if I do the same on the child:</p>
<pre><code>UIView *myObj = [[self subviews] objectAtIndex:0];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate: self];
[UIView setAnimationDuration:2];
[UIView setAnimationDelay:2];
CGAffineTransform scaleTransform = CGAffineTransformScale( myObj.transform, 2, 2 );
myObj.transform = scaleTransform;
[UIView commitAnimations];
</code></pre>
<p>It doesn't work. What happens visually is that the child view immediately shrinks down and then after the delay scales back up to it's original size.</p>
<p>If I log the transform parameters it looks the same for both parent and child and I have tried setting <code>CGAffineTransformIdentity</code>.</p>
<p>Any ideas what might be the problem?</p>
| iphone | [8] |
1,715,629 | 1,715,630 | code format mess up in Netbeans IDE | <p>I did few PHP coding on Dreamweaver.But the code format is completly messed up when open the code in Netbeans IDE.</p>
<p>Is there anyone can help me?</p>
<p>Many thanks</p>
| php | [2] |
99,401 | 99,402 | Setting up a download of data already in the Javascript data model | <p>Some Javascript on a page gets a large wad of data from a server. At some point, I'd like to allow the user to click to download this data in, say, a format digestible to Excel.</p>
<p>My belief is that this will require the data to be on the server and re-fetched by the browser, but I am hoping that there's something I'm missing, and that there's some way for Javascript to get the browser to offer the 'save as' dialog to save away some content generated righ there.</p>
| javascript | [3] |
5,390,752 | 5,390,753 | retrieved upload images in php | <p>i want to retrieve image from client (ipod) programmed in objective c i use the following code</p>
<pre><code>$TARGET_PATH = "pics/";
$image = $_FILES['photo'];
$TARGET_PATH =$TARGET_PATH . basename( $_FILES['photo']['name']);
$TARGET_PATH =$TARGET_PATH.".jpg";
if(file_exists($TARGET_PATH))
{
$TARGET_PATH =$TARGET_PATH .uniqid() . ".jpg";
}
if (move_uploaded_file($image['tmp_name'], $TARGET_PATH))
{
$TARGET_PATH="http://www.".$_SERVER["SERVER_NAME"]."/abc/".$TARGET_PATH;
echo $TARGET_PATH;
echo "image upload successfully";}
else{
echo "could not upload image";
}</code></pre>
<p>this code upload five to six images successfully and after that it gives me error i.e</p>
<pre><b>Notice</b>: Undefined index: photo in <b>/home/abc/public_html/abc.com/fish/mycatch_post.php</b> on line <b>42</b><br />
<b>Notice</b>: Undefined index: photo in <b>/home/abc/public_html/abc.com/fish/mycatch_post.php</b> on line <b>53</b><br/>
could not upload image</pre>
| php | [2] |
147,104 | 147,105 | Change code to list comprehension | <p>I have wrote following code for a simple problem in Python - </p>
<pre><code>def Peu1(numbers):
"Sum of all the multiples of 3 or 5 below 1000."
for num in range(numbers):
if num%3 == 0 or num%5 == 0:
test = sum(range(numbers),0)
return test
print Peu1(1000)
</code></pre>
<p>I want to change it to List comprehension, I wrote following - </p>
<pre><code>test = [sum(range(numbers),0) for num in range(numbers) if num%3 == 0 or num%5 == 0]
print test
</code></pre>
<p>but my list comprehension is printing result in a loop, I mean I am getting result n times(mod 3 or 5). Please pinpoint the mistake and guide.</p>
| python | [7] |
4,374,811 | 4,374,812 | What is acceptable memory usage for a PHP page? | <p>I'm building a webpage that queries a MySQL database and (currently) produces a text-only list of the findings. The queries to complete a single record are similar to:</p>
<ul>
<li>movie (title, description, etc)
<ul>
<li>actors in the movie (name, gender)</li>
<li>related movies</li>
</ul></li>
</ul>
<p>Out of curiosity I've used <code>memory_get_peak_usage()</code> and <code>memory_get_usage()</code>:</p>
<pre>
start 110,440 bytes
peak 656,056 bytes
end 637,976 bytes
time 0.008 seconds
</pre>
<p>The above is with no records found!</p>
<p>With 40 records I'm reaching approximately 2MB, though the time remains the same.</p>
<p>I know that premature optimization is evil and all, but I have to ask: </p>
<p>Do I need to do some reworking? Is this memory usage normal? What is considered excessive?</p>
| php | [2] |
506,363 | 506,364 | php banner rotater problem | <p>i want to create dynamic banner rotater wih php ajax i want to pass the mysql_fetch_array() to an array to create a new array() to create xml response..........</p>
<p>here is my code</p>
<pre><code>$sql = mysql_query("SELECT * FROM ads");
header('Content-type: text/xml');
echo '<?xml version="1.0" ?>';
while($row = mysql_fetch_array($sql)){
$title = $row['title'];
$img = $row['file'];
$body = $row['body'];
$ban = '<b>'.$title.'</b><br><br><img src="ads/'.$img.'"><br><br>'.$body;
$banners = array(
$ban,
);
$html = $banners[array_rand($banners)];
}
<banner>
<content><?php echo htmlentities($html); ?></content>
<reload>3000</reload>
</banner>
</code></pre>
<p>but it is return only one ad not return multiple ads how can i fix that</p>
| php | [2] |
1,797,706 | 1,797,707 | Valums file uploader: how to start with ID other than 0? | <p>I'm using <a href="http://valums.com/ajax-upload/" rel="nofollow">Andrew Valums' Ajax Upload plugin</a> (<a href="https://github.com/valums/file-uploader" rel="nofollow">GitHub link</a>). Here is some code from it:</p>
<pre><code>qq.getUniqueId = (function(){
var id = 0;
return function(){ return id++; };
})();
</code></pre>
<p>It's kind of a long story, but I'm in a situation where, under certain circumstances, I'd like the <code>qq.getUniqueId</code> function to start with an ID other than 0. It can still increment by one; it just has to start with something other than 0. What's the best way to do that?</p>
<p>Here are the steps to create a test environment:</p>
<ol>
<li><p>Download the plugin: <a href="http://github.com/valums/file-uploader/zipball/master" rel="nofollow">http://github.com/valums/file-uploader/zipball/master</a></p></li>
<li><p>Unzip it and move the "client" folder onto a web server.</p></li>
<li><p>Open the "demo.htm" file in a text editor, search for <code>action: 'do-nothing.htm',</code> and add <code>onComplete: function(id, fileName, responseJSON) {alert(id)},</code> right after that.</p></li>
<li><p>Open the "demo.htm" file in a web browser. Be sure to access it through a web server (as opposed to just opening the local file) or else it won't work.</p></li>
<li><p>Upload a file. It should alert a "0" after the upload finishes. See if you can modify it so that I can pass in a different starting number.</p></li>
</ol>
<p>Thanks!</p>
| javascript | [3] |
5,161,346 | 5,161,347 | Conditional Stack Variables | <p>Given the following function, will each of the local variables be declared on the stack?</p>
<pre><code>std::string reallyCoolFunction(unsigned int a)
{
if( a < 20 )
{
std::string result1 = "This function is really cool";
return result1;
}
if( a >=20 && a <= 40 )
{
std::string result2 = "This function is kind of cool";
return result2;
}
if( a > 40 )
{
std::string result3 = "This function is moderately cool";
return result3;
}
std::string result4 = "This function really isn't that cool";
return result4; // remove warning
}
</code></pre>
<p>In this situation, only one <code>std::string</code> is actually required, do all 4 get allocated on the stack, or does only 1 get allocated?</p>
| c++ | [6] |
5,083,556 | 5,083,557 | What are the ways to minimize page wait from external javascript callouts? | <p>What tricks can be used to stop javascript callouts to various online services from slowing down page loading?</p>
<p>The obvious solution is to do all the javascript calls at the bottom of the page, but some calls need to happen at the top and in the middle. Another idea that comes to mind is using iframes. </p>
<p>Have you ever had to untangle a site full of externally loading javascript that is so slow that it does not release apache and causes outages on high load? Any tips and tricks?</p>
| javascript | [3] |
3,026,016 | 3,026,017 | Pass on variable to set in C# | <p>I want a pass several variables to a function to and set them to something else instead of reading from them. I am planning to use this in a scenario where i can create a object, and add it to a execution queue. Would a pointer be right for this?</p>
<p>I am aware my question has a poor explanation, but I don't know a better way to explain it.</p>
| c# | [0] |
506,915 | 506,916 | What Does '6k views' mean and how can I format the number in PHP | <p>What does "6k views" mean and how can I format this number in PHP?</p>
| php | [2] |
1,801,682 | 1,801,683 | Read binary data from Console.In | <p>Is there any way to read binary data from stdin in C#?</p>
<p>In my problem I have a program which is started and receives binary data on stdin.
Basically:
<code>C:>myImageReader < someImage.jpg</code></p>
<p>And I would like to write a program like:</p>
<pre><code>static class Program
{
static void Main()
{
Image img = new Bitmap(Console.In);
ShowImage(img);
}
}
</code></pre>
<p>However Console.In is not a Stream, it's a TextReader.
(And if I attempt to read to char[], the TextReader interprets the data, not allowing me to get access to the raw bytes.)</p>
<p>Anyone got a good idea on how get access to the actual binary input?</p>
<p>Cheers,
Leif</p>
| c# | [0] |
3,831,752 | 3,831,753 | Android: MessageBox not working | <p>I am trying to do some data verification. In short, when an add button is pressed, if certain fields are not filled in then I want to display a message box and return from further processing.</p>
<p>This is the flow of my code without the messageBox code:</p>
<pre><code> Button add = (Button) findViewById(R.id.addButton);
add.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
//local vars
String access;
String gender;
String avail;
String availCode;
// getting values from selected editItems
String name = textName.getText().toString();
String street = textStreet.getText().toString();
String city = textCity.getText().toString();
String state = textState.getText().toString();
String postal = textPostal.getText().toString();
String country = textCountry.getText().toString();
String directions = textDirections.getText().toString();
String comments = textComments.getText().toString();
//verify miniminal data
if((name.equals("")) || (street.equals(""))|| (city.equals("")) || (state.equals("")) || (postal.equals("")) || (country.equals("")))
{
}
</code></pre>
<p>I tried pasting in this code:</p>
<pre><code> //verify miniminal data
if((name.equals("")) || (street.equals(""))|| (city.equals("")) || (state.equals("")) || (postal.equals("")) || (country.equals("")))
{
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setCancelable(false);
builder.setTitle("Title");
builder.setInverseBackgroundForced(true);
builder.setMessage("Must enter minimal data.");
builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
return;
}
});
AlertDialog alert = builder.create();
alert.show();
}
</code></pre>
<p>But...I cannot get this line to build:</p>
<pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(context);
</code></pre>
<p>Eclipse is saying context cannot be resolved to a variable.</p>
<p>I am confused as to what to do. Can someone help?</p>
| android | [4] |
4,931,535 | 4,931,536 | Get the vtable address in C#? | <p>I'm willing to use <code>unsafe</code>. How can I get a class virtual table address and convert it to an int?</p>
| c# | [0] |
689,306 | 689,307 | Listing photos with php | <p>I have a problem and did not solve.</p>
<pre><code>What i want is that listing photos side to side
</code></pre>
<p>like that:</p>
<p><img src="http://i.stack.imgur.com/lfPIX.png" alt="enter image description here"></p>
<pre><code>The problem is that when i have 50 photos , this happens
</code></pre>
<p><img src="http://i.stack.imgur.com/vixqh.png" alt="enter image description here"></p>
<p>What i want is that listing ten photos per columns. How can i do that ? </p>
| php | [2] |
457,396 | 457,397 | A problem with java Object Streams via sockets | <p>Hi
I want to send an array of double as an object via ObjectOutputStream that uses a socket for outputStream. In the receiving side I read repetitious objects all the same! Maybe the assignment of method readObject doesn't perform it's task.
I'm trying to update dobArray and write it to the socket output stream. dobArray is updated by another thread. It does it's task well, because I tested it. here is my code:</p>
<p>sending side:</p>
<pre><code> objectStream = new ObjectOutputStream(dataFlow.getOutputStream());
while(busy){
try {
// dobArray is updated in another thread
objectStream.writeObject( dobArray);
} catch (IOException e) {
e.printStackTrace();
}
}
</code></pre>
<p>receiving side:</p>
<pre><code> objectInputStream = new ObjectInputStream(
mainServer.dataFlow.getInputStream());
while (busy){
try {
DobArray dobarray =
(DobArray) objectInputStream.readObject()
writeToFile(dobarray);
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
</code></pre>
<p>regards
sajad</p>
| java | [1] |
1,927,645 | 1,927,646 | How to bring dialogbox on top all open form | <p>I have three forms Main, Sales and Login.</p>
<p>In Main form I have a timer, example after 5 minutes Login form will be fire up.</p>
<p>I can Open a Sales form the Main form whitout closing the Main form, so Login form will be fire up.</p>
<p>The problem is the Login form does not focus on top of the Sales form, so that the user must login to use the sales form. </p>
<p>Some code on Main form :</p>
<pre><code>public void timer_Tick(object sender, EventArgs e)
{
timer.Stop();
LoginDialog loginForm = new LoginDialog();
loginForm.TopLevel = true;
loginForm.ShowDialog();
timer.Start()
}
private void pbSales_Click(object sender, EventArgs e)
{
Sales salesForm = new Sales();
salesForm .ShowDialog(this);
}
</code></pre>
| c# | [0] |
1,760,512 | 1,760,513 | Share my app to another installed app in android | <p>i'm a new android developer. I have an application installed in phone. This application has a Save button to save info after input... When user click Save button, it displays a dialog to choose where to save (in Contact, in gmail contact). I wish to create an application to add to this save dialog to save info from that application to my own application. Is it possible to do that? How? </p>
| android | [4] |
550,402 | 550,403 | How to create blue horizontal line in EditText Android | <p>As in my question title, is it a default theme in Android or I need to do it manually? I want to have it from Froyo devices and above. Any guideline or hint to achieve it?</p>
| android | [4] |
1,586,804 | 1,586,805 | how to change ExpandableListview left icon to others (android ExpandableListView) | <p>Now i want to use a ExpandableListView display my data , i want to change the itme left icon or let it disappear. can some on give me a suggestion . thx.</p>
| android | [4] |
527,996 | 527,997 | Android,Coding an app and want to know how to indicate the to be install in SD card | <p>I am building an heavy app (20mb) so i would like to know how to make as default installation to install in SD card i try few tutorial but not success the version of my android code is 2.2.</p>
<p>I add in the manifest the line: </p>
<pre><code> android:installLocation="preferExternal"
</code></pre>
<p>but nothing happen</p>
<pre><code> <?xml version="1.0" encoding="utf-8"?>
</code></pre>
<p>
</p>
<pre><code><application android:icon="@drawable/icon" android:label="@string/app_name">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:resizeable="true"
android:anyDensity="true"/>
<activity android:name=".Toto"
android:label="@string/app_name" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</code></pre>
<p></p>
<p>I will appreciate Help!!!</p>
| android | [4] |
3,923,440 | 3,923,441 | Draw circle inside a label | <p>I am trying to draw a circle using Windows Form at runtime inside a label control. I am trying to display green or red circle and display the text('L1' or 'L2') on top of it. Could you please help. </p>
| c# | [0] |
5,257,835 | 5,257,836 | function pointer - ambiguous symbol error | <p>MyClass is a singleton class (There will only ever be one of these in my whole program).</p>
<p>What I want to do is follows.</p>
<ol>
<li>Add data to my class using AddData, get a function pointer returned that I can then pass to 'another' function in a dll.</li>
<li>Then this 'other' function calls my call back function</li>
</ol>
<p>My class is like so.</p>
<pre><code>typedef void (*DataReceivedCallback)(int, int);
class MyClass
{
MyClass();
~MyClass();
void AddData(int sourceId, DataReceivedCallback &callback);
static void MyCallBackFunction(int var1, int var2);
};
void MyClass::AddData(int sourceId, DataReceivedCallback &callback)
{
callback = &MyCallBackFunction;
}
void MyClass::MyCallBackFunction(int var1, int var2 )
{
//do something blah blah
}
</code></pre>
<p>I can then do:</p>
<pre><code>int main()
{
DataReceivedCallback callback;
MyClass->GetInstance()->AddData(1, callback);
callback(1,100);
}
</code></pre>
<p>When I step through this I see that I do actually step into the callback MyCallBackFunction which is what I want :)</p>
<p>What I then want to do now is pass this 'callback' defined in main to a dll function that will call back into my callback function.</p>
<p>I have the code for the dll so I want to modify one if its functions so that it accepts my callback function parameter.</p>
<p>I am doing this in the dll function signature:</p>
<pre><code>void * someDllFunction( int var1, int var2, DataReceivedCallback& callback)
{
callback(2, 200);
}
</code></pre>
<p>But I get the error:
<strong>error C2872: 'DataReceivedCallback' : ambiguous symbol</strong></p>
<p>How can I solve this?
Does this have to do with only being allowed to use c-style parameters across dll boundaries??</p>
| c++ | [6] |
3,884,261 | 3,884,262 | Checking to see if a URL is Google | <p>I want to check a URL to see if it is a Google url or not.</p>
<p>I've got this function</p>
<pre><code>function isValidURL($url)
{
return preg_match('|^http(s)?://google.com|i', $url);
}
</code></pre>
<p>If i try</p>
<pre><code>if ( isValidURL('http://google.com/') ){
echo 'yes its google url';
}
</code></pre>
<p>It works fine. But if I try</p>
<pre><code>if ( isValidURL('http://www.google.com/') ){
echo 'yes its google url';
}
</code></pre>
<p>(with <code>www</code>) I get an error!</p>
| php | [2] |
3,645,340 | 3,645,341 | How to display "fixed postion" overlay in mapview? | <p>I simply would like to display icon that is in fixed location in MapView. Overlay will do if it's fixed, but the problem with overlay that it's move as user moves the map. But I need to have this icon fixed.</p>
| android | [4] |
3,757,819 | 3,757,820 | opencv and projection value | <p>hi i would like to use height projection to choose between some area detection the area that i like to show her ,what i can add to my code to showing only the binary image that have two peaks of white color?links of picture : </p>
| c++ | [6] |
2,490,327 | 2,490,328 | How to remove listview all items | <p>In my app, if you click on the button then i want to remove the all the listview items .
Here i am using the base adapter for adding the items to the list view. </p>
<p>How to remove the list view items dynamically. </p>
| android | [4] |
1,658,279 | 1,658,280 | Not able to clicked on item | <p>I have facing very strange issue. I m opeing the default contact form my app. but sometimes i m not able to clicked or select the particular contact from it, but able to scroll it. anybody can give to solution ?</p>
| iphone | [8] |
4,018,817 | 4,018,818 | Proc_open read and parse output - real-time | <p>When I run proc_open with a file.txt path for the stderr output, that file is constantly updated every couple seconds with output of the proc_open program I am running which is ffmpeg. I just want to redirect that output to a phpfile where it can be read and parsed but while the process is running (so send info every couple seconds) so I can update a database. IS this possible? <strong>I have been googling for hours so if there are any experts out there who actually know how to use this function of have experience in this I would greatly appreciate any help.</strong></p>
<p>this puts output in a text doc. If I change to 2 => array("pipe","w") and the echo the output only comes on my screen at the end of the process</p>
<pre><code>$descriptorspec = array(
0 => array("pipe","r"),
1 => array("pipe","w"),
2 => array("file","/home/g/Desktop/test.txt","a")
) ;
$cwd = './' ;
// open process /bin/sh
$process = proc_open("/usr/local/bin/ffmpeg -i /home/g/Desktop/vid.wmv /home/g/Desktop/vid.flv", $descriptorspec, $pipes, $cwd) ;
</code></pre>
| php | [2] |
966,965 | 966,966 | Is there a way to automatically call all the getter methods on an object graph? | <p>I have a collection of java bean objects and each object can have another collection of java bean objects (ie object graph). Is there an easy way to traverse the graph and call all the getter methods? Is there a library already doing something similar like that.</p>
| java | [1] |
4,620,159 | 4,620,160 | onListItemClick didn't fired when implemented OnScrollListener (Android) | <p>I implemented OnScrollListener to paging the listview!</p>
<p>The paging is ok! i scrolled the list and after i selected the item on listview onListItemClick didn't work!</p>
<p>Here is my onListItemClick and i extended ListActivity.</p>
| android | [4] |
5,849,594 | 5,849,595 | get sender in href javascript code | <p>I have an anchor with a href tag of <code>javascript:someFunc()</code>. How can I get the tag that called the javascript code? in the <code>onclick</code> attribute i know you can pass <code>this</code>, but <code>this</code> references the <code>DOMWindow</code> when called from the href tag. I HAVE to use the href tag as the code i'm working with limits me to using it only. Anyone have an idea on what I can do?</p>
| javascript | [3] |
3,231,313 | 3,231,314 | Java iterating through all the files and only the unique RAR archives in a directory | <p>How can I iterate over over all the RAR archives in a directory. I know how to iterate over the files in a directory but I'm only interested in RAR archives. If they were simple RAR archives with the extension <code>.rar</code> it wouldn't be an issue but my directories can have multiple spanned archives and I only want the first/main volume in the set. I also would like to have the other files in the directory:</p>
<p>Here are the contents of a sample directory:</p>
<ul>
<li><code>file.txt</code></li>
<li><code>somefile.zip</code></li>
<li><code>hello.rar</code></li>
<li><code>test.part1.rar</code></li>
<li><code>test.part2.rar</code></li>
<li><code>example.rar</code></li>
<li><code>example.r00</code></li>
</ul>
<p>Result:</p>
<ul>
<li><code>file.txt</code></li>
<li><code>somefile.zip</code></li>
<li><code>hello.rar</code></li>
<li><code>test.part1.rar</code></li>
<li><code>example.rar</code></li>
</ul>
<p>This is what I'm using ti iterate over the directory:</p>
<pre><code> import java.io.File;
...
for (File child : (new File(myDirectoryPath)).listFiles()) {
if (!child.isDirectory()) {
//Do something with the file
}
}
</code></pre>
<p>How can I do this? I need to detect whether it is a RAR archive or not. If it isn't, use it. If it is, I'd need to check whether it is the first part of an archive. if yes, do whatever, else ignore it.</p>
<p>Thanks</p>
| java | [1] |
2,848,001 | 2,848,002 | Download image using jquery | <p>in my form load i download a image using jquery and when user click on any button then i am showing that image in my div. but only first time image is taking time to visible. if image is downloaded at form load so when i am showing that image through jquery then i think it should not download again and it should be visible very quickly.</p>
<h2>here is my code</h2>
<pre><code> var _images = ['/Images/ajax-loader.gif'];
$.each(_images, function (e) {
$(new Image()).load(function () {
//alert($(this).attr('src') + 'has loaded!');
}).attr('src', this);
});
</code></pre>
<p>through the above routine i am downloading image at form load with the help of jquery.</p>
<p>so when i am showing that image when user click on button like below one</p>
<pre><code> $('#loader').html('<table border="0" style="width:auto"><tr><td valign="middle">Wait...</td><td valign="top"><img height="20px" width="20px" src="/images/ajax-loader.gif" border="0" /></td></tr></table>');
</code></pre>
<p>loader is my div</p>
<p>so the image should not download again rather it should show from the client machine.
so please guide me what is wrong in my code that image is download at form load and inspite of that it is again loading for the first time. please help...thanks</p>
| jquery | [5] |
2,611,793 | 2,611,794 | Write row to a CSV file without it adding quotation marks | <p>My first problem:</p>
<pre><code>writer.writerow(['Name,' 'Street,,' 'Address,,,'])
</code></pre>
<p>The above example returns "Name,Street,,Address,,,"</p>
<p>I need it to return Name,Street,,Address,,, without the quotation marks.</p>
<p>What should I do?</p>
| python | [7] |
1,487,252 | 1,487,253 | Get mouse coords relative to other window | <p>I would like to get the mouse coords relative to another window (window client area), the window is not part of my application. </p>
<p>I would prefer to do this without delving into the Win32 API and dll imports, but I'm not sure if it's possible.</p>
<p>The basic idea is: My C# WPF app will have the users focus, when the user presses a hot key(CTRL + C) the app will get the coords relative to the client area of an earlier specified window. It's just a quick app I need to make for in-house development assistance.</p>
| c# | [0] |
3,734,461 | 3,734,462 | Optimizing Live Wallpaper app for efficient battery use (Reduce the battery usage) | <p>I am developing live wallpaper application.</p>
<p>for the one hour and 15 minutes my phone has
been on, live wallpaper has accounted for 26 percent of battery use,
which seems high for changing the wallpaper once per minute?</p>
<p>what i have to do for this problem?</p>
<p>How can i reduce the battery usage. and the application use low battery for the application ?</p>
| android | [4] |
4,670,650 | 4,670,651 | &new MyClass() vs new MyClass() in PHP | <p>Is there any difference between the following?</p>
<pre><code>$myVar=&new MyClass();
$myVar=new MyClass();
</code></pre>
<p>I am coding in PHP</p>
| php | [2] |
5,189,490 | 5,189,491 | resize field and resize back outside click | <p>I'm new to jquery and I kinda don't get around this. So I have a searchbox (.search) which I want to resize when it's clicked. That does work, the searchfield get's "bigger". But, when I click outside the searchfield I want it to grow back again. I tried doing it with a "body"-click-method. But it doesn't work.</p>
<p>So here's my code:</p>
<pre><code>$(function() {
$('.search').click(function() {
$('.search').css('width', '450px');
});});
</code></pre>
<p>Another question: How can I combine this change with an animation?</p>
| jquery | [5] |
3,525,735 | 3,525,736 | How to make my class enabled to cast for Integer | <p>I have a doubt on how to cast my class to <code>Integer</code>. Example:</p>
<pre><code>public class IntegerField extends Field {
private Integer value;
public IntegerField(Integer value) {
super();
this.value = value;
}
public int intValue() {
return value;
}
}
</code></pre>
<p>How can I make:</p>
<pre><code>IntegerField a = new IntegerField(8);
Integer b = (Integer) a;
</code></pre>
<p>Thanks! </p>
| java | [1] |
3,777,040 | 3,777,041 | how to get iphone 4.1 HDR frames | <p>Is there way to problematically get individual bracketed shots from iphone 4.1 HDR photo instead of a single HDR'ed photo?</p>
| iphone | [8] |
5,443,476 | 5,443,477 | Android: Detect if PVPlayer or AwesomePlayer? | <p>How can I detect if a device is equipped with the "PVPlayer" components or "AwesomePlayer" components?</p>
<p>I noticed that the Droid X, despite being on Android 2.2, still uses the PVPlayer component rather than AwesomePlayer. in other words, the Droid X has difficulty playing certain types of media.</p>
<p>Let me know if you need any clarification.</p>
<p>Thanks!</p>
| android | [4] |
2,692,268 | 2,692,269 | jquery load between two urls | <p>I am trying to load content from 2 different URLS but at different intervals. Ideally I would like to load one url wait 10 seconds load the other and repeat the over and over. This is what I have but its not working correctly. Its constantly loading the urls rapidly back and forth so fast I cant read the content</p>
<pre><code>setInterval(function(){
$('#ticker').load('misc.php?users=10');
}, 10000);
setInterval(function(){
$('#ticker').load('misc.php?news=10');
}, 20000);
</code></pre>
| jquery | [5] |
2,950,349 | 2,950,350 | Calling a function with explicit parameters vs. call_user_func_array() | <p>I saw a piece of code earlier this week (which, unfortunately, I am unable to retrieve) and I am curious about the way the author went about implementing the <code>__call()</code> magic method. The code looked something like the following:</p>
<pre><code>class Sample
{
protected function test()
{
var_dump(func_get_args());
}
public function __call($func, $args)
{
if(!method_exists($this, $func))
{
return null;
}
switch(count($args))
{
case 0:
return $this->$func();
case 1:
return $this->$func($args[0]);
case 2:
return $this->$func($args[0], $args[1]);
case 3:
return $this->$func($args[0], $args[1], $args[2]);
case 4:
return $this->$func($args[0], $args[1], $args[2], $args[3]);
case 5:
return $this->$func($args[0], $args[1], $args[2], $args[3], $args[4]);
default:
return call_user_func_array($this->$func, $args);
}
}
}
</code></pre>
<pre><code>$obj = new Sample();
$obj->test("Hello World"); // Would be called via switch label 1
</code></pre>
<p>As you can see, the author could have just used <a href="http://php.net/call_user_func_array"><code>call_user_func_array()</code></a> and dropped the switch entirely, so that would lead to me to believe there was (hopefully) some intelligent reasoning behind this.</p>
<p>The only reason I could think of would be perhaps some overhead of the function call to <a href="http://php.net/call_user_func_array"><code>call_user_func_array()</code></a>, but that doesn't seem like a good enough reason to use a bunch of case statements. Is there an angle here I don't seem to be getting?</p>
| php | [2] |
341,911 | 341,912 | Use of || {} in Javascript | <p>I saw something like this in Javascript :</p>
<pre><code> function name (secret) {
secret = secret || {};
</code></pre>
<p>i can't find anywhere what exactly means <strong>secret = secret || {};</strong></p>
<p>Is that mean create global variable with value of passed argument or an object?</p>
<p>When do you use it? When there is no argument passed?</p>
| javascript | [3] |
4,026,663 | 4,026,664 | Open and read sequential XML files with unknown files names in Python | <p>I wish to read incoming XML files that have no specific name (e.g. date/time naming) to extract values and perform particular tasks.
I can step through the files but am having trouble opening them and reading them.</p>
<p>What I have that works is:-</p>
<pre><code> import os
path = 'directory/'
listing = os.listdir(path)
for infile in listing:
print infile
</code></pre>
<p>But when I add the following to try and read the files it errors saying No such file or directory.</p>
<pre><code> file = open(infile,'r')
</code></pre>
<p>Thank you.</p>
| python | [7] |
1,979,377 | 1,979,378 | Which of the following is not allowed according to inheritance usage? | <p>From <a href="http://www.geekinterview.com/question_details/71433" rel="nofollow">here</a>,</p>
<p>Using inheritance, which of the following is not allowed</p>
<p>a) Changing implementation of operation in parent by the subclass</p>
<p>b) Using implementation of operation in parent class by the subclass</p>
<p>c) Using attributes in parent class by the subclass</p>
<p>d) Having operations is subclass which do not exist in parent class</p>
<p>e) None</p>
<p>Am not convinced with the answers in the above link, so trying to clarify here. Pls answer.</p>
| c++ | [6] |
814,331 | 814,332 | Mount Windows drive in Eclipse from Linux | <p>I am trying to mount a windows drive in Eclipse from Linux. Is that even possible?This is my approach</p>
<pre><code>String cmd = "MOUNTVOL " + volumeToMount + " " + mountPoint;
Process proc = Runtime.getRuntime().exec(cmdStr);
</code></pre>
<p>If I am going wrong anywhere,please let me know if there is any other way of achieving this.</p>
| java | [1] |
1,560,419 | 1,560,420 | Delete old files - an hour ago or more than an hour ago | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6411451/how-can-i-delete-files-older-than-1-hour">How can I delete files older than 1 hour?</a> </p>
</blockquote>
<p>the code down below delete all files inside a folder called " Images ". No complains everything works as it should, but is there a way to <strong>only</strong> delete the file which was created an hour ago or more then hour ago instead? Please show me how, I'm trying to learn by doing, please. Try to re-use the same code down below for better understanding and also to help users PHP programmer around the world</p>
<pre><code><?php
define('PATH', 'Images/');
function destroy($dir) {
$mydir = opendir($dir);
while(false !== ($file = readdir($mydir))) {
if($file != "." && $file != "..") {
chmod($dir.$file, 0777);
if(is_dir($dir.$file)) {
chdir('.');
destroy($dir.$file.'/');
rmdir($dir.$file) or DIE("couldn't delete $dir$file<br />");
}
else
unlink($dir.$file) or DIE("couldn't delete $dir$file<br />");
}
}
closedir($mydir);
}
destroy(PATH);
echo 'all done.';
</code></pre>
| php | [2] |
3,588,499 | 3,588,500 | how we disable dates of calendar from javascript | <p>i have a calendar and in this i want to disable dates for example i want to disable dates 25 to 29</p>
<p>from javascript</p>
| javascript | [3] |
2,813,183 | 2,813,184 | How do I read long lines from a text file in C++? | <p>I am using the following code for reading lines from a text-file. What is the best method for handling the case where the line is greater than the limit SIZE_MAX_LINE?</p>
<pre><code>void TextFileReader::read(string inFilename)
{
ifstream xInFile(inFilename.c_str());
if(!xInFile){
return;
}
char acLine[SIZE_MAX_LINE + 1];
while(xInFile){
xInFile.getline(acLine, SIZE_MAX_LINE);
if(xInFile){
m_sStream.append(acLine); //Appending read line to string
}
}
xInFile.close();
}
</code></pre>
| c++ | [6] |
3,962,260 | 3,962,261 | Is there a way to find given process is Idle? | <p>I am working in an java application where i want to make sure that a given process in the computer is idle
ex:- if we start a download process in our computer my application should be able to monitor it (process) and tell when it is over, </p>
| java | [1] |
2,896,134 | 2,896,135 | Using Form Validation - Multiple Error Display | <p>I'm sorta new to Javascript and am trying to implement fomr validation for a login form, which consists of first name, surname and age. </p>
<p>The actual validation is working fine, but it keeps printing both errors when none of the validation is satisfied. I want to know if it's possible to only print one error at a time, not both.</p>
<pre><code>function Validation() {
// Basic form validation for the login form (ensures first name is entered ensures age is of required number [5-100])
// Declare the textfields as three seperate variables x, y, z
var x = document.forms["loginform"]["age"].value;
var y = document.forms["loginform"]["firstname"].value;
var z = document.forms["loginform"]["surname"].value;
// Call an error if an input has no entered value (empty)
if (x == null || x == "" || y == null || y == "" || z == null || z == "")
{
alert("Please enter all required information!");
}
// Call an error if x (age) contains a non-numeral character or if the number is less than 5/more than 100
if (x < 5 || x > 100 || !x.match(/^\d+$/))
{
alert("Age must be between 5-100 and only contain numerical value(s).");
}
}
</code></pre>
<p>Any help is appreciated, thanks in advance.</p>
| javascript | [3] |
4,747,467 | 4,747,468 | How to access Session in .ashx file? | <p>I want to access some value(which is already set in.aspx file) in .ashx file. I tried to get that value using querystring, session etc but each time it failed. Can anyone suggest me how can we access session value in .ashx file?</p>
| c# | [0] |
4,731,933 | 4,731,934 | Is CodeIgniter PHP Framework suitable for large ERP or Business Application? | <p>Is CodeIgniter is recommended for a large web based ERP or Business Application? I want to use CodeIgniter for my future Project and I'm so confused whether to use it or not. Im so worried about in the long term process or lifetime of the application that it may crashed or produce a bug or error. I also worried about the performance of the framework when the data becomes larger and containing millions of records. I searched on the internet the answer but there is no exactly answer that will satisfy me. I think this question is important for the programmers like me who wanted to use PHP Framework for their large business application. I need an advice from you guys in order to decide whether to use it or not. thank you very much!</p>
| php | [2] |
1,405,059 | 1,405,060 | avoid rounding error (floating specifically) c++ | <p><a href="http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/" rel="nofollow">http://www.learncpp.com/cpp-tutorial/25-floating-point-numbers/</a>
I have been about this lately to review C++.</p>
<p>In general computing class professors tend not to cover these small things, although we knew what rounding errors meant. </p>
<p>Can someone please help me with how to avoid rounding error?</p>
<p>The tutorial shows a sample code</p>
<pre><code>#include <iomanip>
int main()
{
using namespace std;
cout << setprecision(17);
double dValue = 0.1;
cout << dValue << endl;
}
</code></pre>
<p>This outputs</p>
<blockquote>
<p>0.10000000000000001</p>
</blockquote>
<p>By default float is kept 6-digits of precisions. Therefore, when we override the default, and asks for more (n this case, 17!!), we may encounter truncation (as explained by the tutorial as well).
For double, the highest is 16. </p>
<p>In general, how do good C++ programmers avoid rounding error?
Do you guys always look at the binary representation of the number?</p>
<p>Thank you.</p>
| c++ | [6] |
4,253,401 | 4,253,402 | stripslashes issue in php | <p>when i use stripslashes in php but i did not get the exact solution. I have menstion below which i used in my code those are
Example if i have the value in table like <code>suresh\'s kuma\"r</code><br>
i trying to display the value in the following three formats but no one is giving exact value</p>
<pre><code>1) value=<?=stripslashes($row[1])?> //output is suresh's
2) value='<?=stripslashes($row[1])?>' //output is suresh
3) value="<?=stripslashes($row[1])?>" //output is suresh's kuma
</code></pre>
<p>But the exact output i need is <code>suresh's kuma"r</code></p>
<p>let me know how to resolve the this issue?</p>
| php | [2] |
2,238,376 | 2,238,377 | What exactly does "self" do in classes and methods | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2709821/python-self-explained">python 'self' explained</a> </p>
</blockquote>
<p>Ok So programming in python, and just started using classes. Now is it that "self" keeps the information going instead of being passed or taken by the garbage collector?</p>
<p>I searched around and came to some... interesting things, but I'm not sure if I'm understanding it correctly though.</p>
| python | [7] |
4,058,715 | 4,058,716 | Clearing all cached items created by a WebView? | <p>I've got a WebView in my app. When the user logs out of my app, I'd like to delete all cached resources the WebView may have created. Looking at an emulator, I see the following files:</p>
<pre><code>/data
/data
/com.example.myapp
/cache
/webviewCache
bunch of files here..
/databases
webview.db
webviewCache.db
</code></pre>
<p>Is there any system call I can use to clear all the elements in /cache and /databases, or should we do that manually? I'm worried about doing it manually just because I don't know what new files WebView may leave behind in future versions of android so I won't be sure I'm really clearing everything for the user.</p>
| android | [4] |
2,865,757 | 2,865,758 | Dynamically created button | <p>When I click a button I need to create some Textboxes dynamically. The values of the textboxes must be entered in the database by clicking a button which should be enerated dynamically below these textboxes. How do I acheive this?? I need to have a Click event for this newly generated button.</p>
| asp.net | [9] |
5,782,544 | 5,782,545 | jQuery stop animation | <p>So I have a list of news items that have AJAX controls to create, edit, or delete. Upon one of these actions a small message is shown at the top confirming whatever they did. So if they add a new post, it pops up with "Added News: title". It slides down, then after 10 seconds slides up back. The problem is that if multiple actions are done before the 10 seconds is up, it animates multiple times.</p>
<p>For example:
Create news with title "one" - message comes down.</p>
<p>After 4 seconds, Create news with title "two" - message comes down.</p>
<p>After 6 seconds, message for "one" slides up, and then after another 4 seconds the message for "two" slides up.</p>
<p>I want it to only ever slide up once, so you can queue as many actions you want and then 10 seconds after the last action, it slides up.</p>
<p>Here's what I got:</p>
<pre><code>$('#ajax-message').html('Added News: ' + title);
$('#ajax-message').slideDown('1000').delay('10000').slideUp('1000');
</code></pre>
| jquery | [5] |
3,256,159 | 3,256,160 | Is it possible to eliminate name mangling in ASP.NET? | <p>I know I can eliminate ID mangling in ASP.NET 4.0, but can I also eliminate name mangling? This looks like the best I can do:</p>
<pre><code><input name="ctl00$body$txtName" type="text" id="txtName" />
</code></pre>
<p>Is that correct?</p>
| asp.net | [9] |
1,242,823 | 1,242,824 | How does this expression will be calculated | <p>I have an expression with compound assignment as</p>
<p>x += 2*5</p>
<p>so how it will be evaluated is it</p>
<p>x = (x + 2) * 5 </p>
<p>or</p>
<p>x = x + (2 * 5)</p>
<p>and why?</p>
| java | [1] |
3,046,469 | 3,046,470 | how can make the slect element and append options? | <p>I am simply trying to make a selector component with some of the options, i am not get any result it this. really some thing wrong the way what i do.</p>
<p>any one can help me in this?</p>
<pre><code>var object = {
"id":"countries",
"label":"Country",
"name":"countries",
"type":"select",
"options":[
{
"value":"",
"text":"Select Country"
},
{
"value":"in",
"text":"India",
"selected":"true"
},
{
"value":"us",
"text":"United Stated"
},
{
"value":"uk",
"text":"United Kingdom"
},
{
"value":"cn",
"text":"Canada"
}
]
};
var select = "";
var mapInfo = function (element,info) {
$.map(info, function(val,num){
console.log(val);
})
}
var generateSelector = function (info){
select +='<select'+info.id+'></select>'
select +=mapInfo(select,info.options)
$('body').append(select);
}(object);
</code></pre>
<p><a href="http://jsfiddle.net/vYeFS/2/" rel="nofollow">jsfiddle here</a></p>
| jquery | [5] |
2,789,017 | 2,789,018 | What's happens when Java system detects that Exception has been thrown? | <p>a.i.t.(for as in title);</p>
| java | [1] |
609,623 | 609,624 | how to retain the state of activity in android | <p>How to retain state of activity in android.I have two layout for portrait and landscape in layout and layout-land .i am loading value from service at the time i am showing progress dialog .if loaded user rotate device to landscape at the time also loading how to avoid that .user typed content in webview that also refreshed how to avoid that can anybody provide example?</p>
<p>Thanks</p>
| android | [4] |
2,833,065 | 2,833,066 | strange text in localhost url | <p>I am using development server, not IIS (I think) and my url strings are coming out differently when I try to browse to the page I'm working on. </p>
<p>The usual way they looked;
localhost:44044/Account/Register.aspx</p>
<p>Now they look like this;
localhost:44044/(S(rzoxv2lrex3xsh1o1lsfdnpf))/Account/Register.aspx</p>
<p>Does anyone have a clue where that section after localhost comes from? And I'm wondering if that's why I'm getting a specified cast error now when I try to run the page (it was working earlier)</p>
| asp.net | [9] |
1,902,126 | 1,902,127 | how to know which port my Application is using | <p>hi how can i know on which port my application is running</p>
<p>thanks in advance</p>
| java | [1] |
3,556,785 | 3,556,786 | how to slice two images into one image in iphone | <p>Hi
I have one app where i need to slice two or three images into one image can anybody help me in this</p>
| iphone | [8] |
802,727 | 802,728 | .Net adds "__doPostBack" to javaScript onClick event... why? | <p>Typically.NET handles the post back event on a button by making the button a type="submit":</p>
<pre><code><input type="submit" Text="Delete" />
</code></pre>
<p>However, I've recently bumped into a situation where .NET is handling the post back by making the input a type="button" and then adding a javaScript onClick event to do the "__doPostBack()" - so you end up with this: </p>
<pre><code><input type="button" onClick="__doPostBack(...);" />
</code></pre>
<p>The problem with this is trying to add confirmation messages to the click. So with the 2nd scenario, I end up with this:</p>
<pre><code><input type="button" onClick="return confirm('Are you sure?'); __doPostBack(...);" Text="Delete" />
</code></pre>
<p>Of course, in the above scenario the postback will never happen.</p>
<p>What I'm wondering is why .net chooses one scenario over there other and is there a way to prevent the 2nd?</p>
<p>Thanks</p>
| c# | [0] |
2,419,737 | 2,419,738 | Unreachable Code after enum return | <p>Hi I have an emun which is going to run test through and if statement.</p>
<pre><code>public enum Test_Criteria
{
Pass,
Warning,
Fail
}
</code></pre>
<p>After it has run the if statement </p>
<pre><code>if (driver.Url.Contains("Postcode.aspx?type=billing&mode=guest"))
{
return Test_Criteria.Pass;
}
else
{
return Test_Criteria.Fail;
}
</code></pre>
<p>I am getting unreachable code to carry on to the next test straight below here</p>
<pre><code>driver.FindElement(By.Id("Pagecontent_TextBoxPostCode")).SendKeys("#####");
</code></pre>
<p>What would be the most sensible way to allow the program to continue the code after the return. Thanks</p>
| c# | [0] |
4,502,433 | 4,502,434 | button events in android | <p>I want to develop in android a simple application: when the user push a button, an index will be incremented until the button is released. Which button events i have to use?
Thanks</p>
| android | [4] |
3,014,852 | 3,014,853 | How to open a selected file in android? | <p>In windows text files are displayed with notepad icon. When we double click the particular file it open’s the notepad and displays the file.
Like that I need to open the file from the download folder in android. I have used the intent-filter for register my ics file’s mime type. When I select the file in the download folder it just opens my application only. At that time I need to open / read the selected file. How to do this? I am new to android Can anyone help me?</p>
| android | [4] |
4,983,522 | 4,983,523 | C++ platform compatibility | <p>An object <code>foo</code> is written to a new file on platform 1 as:</p>
<pre><code>write( file, &myFoo, sizeof(struct foo) );
</code></pre>
<p>...and then read on platform 2 using:</p>
<pre><code>read(file, &myFoo, filesize(file) );
</code></pre>
<p>The <code>foo</code> object has the following definition: </p>
<pre><code>struct foo
{
char a;
int b;
long c;
char* d;
};
</code></pre>
<p>What kind of issues might arise when loading <code>foo</code> on platform 2?</p>
| c++ | [6] |
5,190,457 | 5,190,458 | grid View footer total in asp.net | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7990661/gridview-with-footer-row-total-in-the-final-page-of-the-grid">gridview with footer row total in the final page of the grid</a> </p>
</blockquote>
<pre><code>protected void inderGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
decimal rowTotal = Convert.ToDecimal
(DataBinder.Eval(e.Row.DataItem, "DC_No_Decimal"));
//grdTotal = grdTotal + rowTotal;
grdTotal += rowTotal;
}
if (e.Row.RowType == DataControlRowType.Footer)
{
Label lbl = (Label)e.Row.FindControl("lblTotal");
e.Row.Cells[3].Text = grdTotal.ToString("c");
//lbl.Text = grdTotal.ToString("c");
}
}
</code></pre>
<p>this is the code i have in row gridview rowdatabound event, Here i m getting total for every page instead of getting total of every page i want to get at the final page of the gridview footer any one Help</p>
| asp.net | [9] |
478,978 | 478,979 | IOS Membership tax file Query | <p>I am located in Australia and would like to post my app on app store so that the whole world can take advantage of it. I have filled out the ABN and GST details for only Australia and I am not sure if this is all we need to do to get the app available on the world scale.</p>
<p>Please answer my query, thanks in advance!</p>
| iphone | [8] |
2,347,781 | 2,347,782 | How to temporary disable click event on a HTML element | <pre><code> $(function(){
$(".first").click(function(){
$(".first ul li").slideUp();
$(this).find("li").slideDown();
});
});
</code></pre>
<p>How can I make the active <code>.first</code> element temporary unclickable until its class siblings are referred as active and of course executing the code above is necessary.</p>
<p>Also no matter what type it is: <code>div</code>, <code>li</code>.</p>
<p>Appreciate your help.</p>
| jquery | [5] |
3,298,157 | 3,298,158 | C++ Arbitrary width container | <p>I have a large lookup table that currently needs 12 bits per entry. Is there a standard class that will give me a memory efficient container for storing odd-sized data? I have about a billion items in the table, so I care more about memory efficiency than speed.</p>
<p>I need to be able to get the underlying data and read/write it to a file as well.</p>
| c++ | [6] |
3,479,892 | 3,479,893 | could some one explane this java loop for me | <pre><code>import java.util.Random;
class arel {
public static void main(String args[]){
Random rand = new Random();
int[] number = new int[7];
for(int roll = 1; roll < 100; roll++){
++number[1+rand.nextInt(6)];
}
System.out.println("Index\tValue");
for(int count = 1; count<number.length; count++){
System.out.println(count+"\t"+number[count]);
}
}
}
</code></pre>
<p><code>++number[1+rand.nextInt(6)];</code> is that line mean insert random number for each index?</p>
| java | [1] |
1,506,683 | 1,506,684 | Accessing files from server | <p>I am doing multimedia application,now i am concentrating on to connect Apache web server. I already uploaded some media files in server.I want to access all media file from the server to android device(to client). can any one suggest me how to do this application. I am new to android. Pls give some useful link to understand how to access data from server. Thanks in andvance. </p>
| android | [4] |
3,482,373 | 3,482,374 | Change text numbers based on user input | <p>I want to be able to change some text numbers based on what the user inputs into a text input.</p>
<p>See mock up below:</p>
<p><img src="http://i.stack.imgur.com/t7kxv.png" alt="enter image description here"></p>
<p>So when the user types in the per hour box I want the per annum figure to change.</p>
<p>Is this possible? If so how?</p>
| javascript | [3] |
5,597,753 | 5,597,754 | Question on Event name of javascript | <p>I want to ask a question about the javascript event. I have a <code><input type="text"></code> box and I have applied the autocomplete function on that box.</p>
<p>I know that when the user types the char like "sta" in the box and the javascript will call the <code>keypress</code> event, which also calls the autocomplete function. </p>
<p>However, I want to know what event of the javascript will be called what I use the mouse to click/click the keybroad "enter" to the wanted item from the autocomplete list. Thank you.</p>
| javascript | [3] |
5,191,942 | 5,191,943 | changing Message for ProgressDialog android | <p>I have an ProgressDialog where in shows while sending mail. The progress dialog works across activities and classes as one of the blog had given an hint showing ProgressDialog across activities.</p>
<p>Below is the code as I am overriding onCreateDialog()</p>
<pre><code>@Override
protected Dialog onCreateDialog(int id) {
if(id == ID_SENDING_MAIL){
ProgressDialog loadingDialog = new ProgressDialog(this);
loadingDialog.setMessage("Sending Email...");
loadingDialog.setIndeterminate(true);
loadingDialog.setCancelable(true);
return loadingDialog;
}
return super.onCreateDialog(id);
}
</code></pre>
<p>then I call the mail sending as below</p>
<pre><code>showDialog(ID_SENDING_MAIL);
new Thread(new Runnable(){
public void run(){`//I am calling Mail Send here
dismissDialog(Email.ID_SENDING_MAIL);
}
}).start();`
</code></pre>
<p>In run method I instantiate mail class and send host of parameters.
This is working fully but I want to set different messages to ProgressDialog.
Like at the time of connecting to Host
Sending Mail then
Mail Sent Successfully</p>
<p>How could we carry out those changes when used with onCreateDialog().
Looking forward to your reply.
thanks.</p>
| android | [4] |
2,806,137 | 2,806,138 | drop down box php | <p>I have stored 6 records in mysql db,when i use this code each of the 6 records getting displayed in seprate drop down box,i want them to be displayed in a single drop down box.Where am i going wrong?
Any help ii be appreciated. Thnx in advance.</p>
<p><a href="http://dpaste.com/hold/180077/" rel="nofollow">http://dpaste.com/hold/180077/</a></p>
| php | [2] |
511,849 | 511,850 | asp.net html page retrieval | <p>How to Get the Content In the Body section of a HTML page in asp.net</p>
<p>like</p>
<blockquote>
<p>this is content</p>
</blockquote>
<p>i just want the content 'this is content'..</p>
<p>and how to find all Images and .swf file in it?</p>
| asp.net | [9] |
5,122,886 | 5,122,887 | how to write T.class in java? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3437897/how-to-get-class-instance-of-generics-type-t">how to get class instance of generics type T</a> </p>
</blockquote>
<p>Template's T
at</p>
<pre><code>JAXBContext jaxbContext = JAXBContext.newInstance(T.class);
</code></pre>
<p>can not compile T.class , do it need reflection and how?</p>
<pre><code> public void ConvertObjectToXML(String path, T bobject)
{
//Convert XML to Object
File file = new File(path);
JAXBContext jaxbContext = JAXBContext.newInstance(T.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
T customer2 = (T) jaxbUnmarshaller.unmarshal(file);
System.out.println(customer2);
}
</code></pre>
| java | [1] |
4,506,115 | 4,506,116 | how to check something eg java, php, program etc installed with python? | <p>im makeing something like a check system before run so it meets the requirements with python.
heres my code so far;</p>
<pre><code>def checksystem():
installednode = os.popen('node ' + srctocoffeecompiler + ' -v')
// version 1.1.1
print installednode.read()
</code></pre>
<p>i can print the version but <strong>is there a better way to check its installed with a version higher then 1.0.x</strong> ? heres my code so far to do this.</p>
<pre><code>version = installednode.read()
if installednode.read() == 'CoffeeScript version 1.1.1':
// the code
// or split the string with space then get the last array
// check if its more then 1.1.1 or 111 ( dots removed )
</code></pre>
<p>*edit ive read the docs about useing subprocess.Popen, that is maybe better, not sure. im still geting errors <em>no such file exist</em>.</p>
<p>*edit2</p>
<pre><code>pn = subprocess.Popen(['node','-v'], stdout = subprocess.PIPE, stdin = subprocess.PIPE, stderr = subprocess.PIPE)
print "NodeJS version: " + pn.read()
</code></pre>
<p>ok, somehow i can call it, but i cant read its output return, same with java</p>
<pre><code>pj = subprocess.Popen(['java','-version'], stdout = subprocess.PIPE, stdin = subprocess.PIPE, stderr = subprocess.PIPE)
print "JAVA: " + pj.read()
</code></pre>
<p>thanks!</p>
| python | [7] |
4,117,457 | 4,117,458 | Print multiple lines output in java without using a new line character | <p>this is one of the interview question. I am supposed to print multiple lines of output on command line, without using the newline(<code>\n</code>) character in java. I tried googling for this, didn't find appropriate answers. If i am printing 5 numbers, then it should print in the following fashion. But I am not supposed to use the newline character nor loops either. I have to print this using a <strong>single</strong> <code>println()</code> statement. Can you give me some ideas ? Thanks !</p>
<pre><code>1
2
3
4
5
</code></pre>
| java | [1] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.