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 |
---|---|---|---|---|---|
690,161 | 690,162 | Remote Method Invocation in Android | <p>I would like to know about the procedure of Remote Method Invocation in Android. </p>
<p>Thanks</p>
| android | [4] |
3,264,292 | 3,264,293 | ImageObserver Class not found | <p>So i have an image being drawn inside a void method in my main class, and every tutorial i have looked at has told me to just write 'this' in the last field of the drawImage() method.
Unfortunately, obviously since this is inside a void method, 'this' does not work.</p>
<p>How do I deal with this?
Is there a way to create a local ImageObserver variable?
I dont need to use it really.</p>
<p>Code snippets:</p>
<pre><code>URL iurl = new URL("cyn.png");
Image bi = Toolkit.getDefaultToolkit().getImage(iurl);
graphics.drawImage(bi,d.width/2+10,110,128,128,iob);
</code></pre>
<p>i dont know what else i need to show
i imported the Image class and graphics class</p>
| java | [1] |
1,279,242 | 1,279,243 | How can I merge two different package(.apk ) in an android appliation? | <p>I want to implement PDF viewer in my android application. My application has option of reading some document and i want to open those doc in PDF by default. My application .apk is ready and I have PDF viewer apk with me . What I want is to merge these 2 apk into a single project ? Can anyone help me.This will be really helpful.</p>
<p>Thanks in advance.</p>
<p>Regarda,
Praween</p>
| android | [4] |
1,939,524 | 1,939,525 | How to convert base64 byte array to video in ios using objective C | <p>But in ios how to convert a byte stream to video and play in iphone, can anyone help me</p>
<pre><code> stream t = new Filestream ("video.mp4, FileMode.Create);
BinaryWriter b = new Binary_Writer(t);
b.write(videoData);
t.close();
</code></pre>
| iphone | [8] |
2,167,547 | 2,167,548 | jquery empty function and event handlers | <p>In the jquery documentation of the "empty" function (http://api.jquery.com/empty/) there is the following statement:</p>
<pre><code>"To avoid memory leaks, jQuery removes other constructs such as data and event handlers
from the child elements before removing the elements themselves."
</code></pre>
<p>The text says: "... jQuery removes event handlers from the !C H I L D! elements ...". But I want the event handlers also removed from the div tag ($("#mydiv").empty). I know that there is the function "remove", but my intention is to not remove the div tag. What is the best way to get this done?</p>
<p>The other thing is:<br>
When they say "remove event handlers". Do they only remove constructs made with "bind" or do they also remove constructs made with "delegate"?</p>
<p>Thanks alot in advance</p>
| jquery | [5] |
4,644,246 | 4,644,247 | Browser SDcard in android application | <p>Thanks in advance,
How to browser the sd card in android for select a .txt file from any sdcard location..
This feature like selecting a image from media location and set image over image view.
Thanks again..</p>
| android | [4] |
4,771,361 | 4,771,362 | How to shrink a text output in python | <p>Hi
I have a program in python which upon running displays an output on a single page. But when I print the output to an A4 size page the output does not fit on to a page, and gets distorted. Is there a way I could shrink my output or adjust the font size of my output, and print it on to a single page?</p>
| python | [7] |
5,896,590 | 5,896,591 | In JavaScript is there a difference between referencing an object's variable name vs. using `this` when declaring new key:value pairs of the object? | <p>In JavaScript is there a difference between referencing a object's variable name vs. using <code>this</code> when declaring new key:value pairs of the object?</p>
<pre><code> var foo = {
bar: function() {
foo.qux = 'value';
}
};
alert(foo.qux); // undefined
foo.bar();
alert(foo.qux); // 'value'
var foo = {
bar: function() {
this.qux = 'value';
}
};
alert(foo.qux); // undefined
foo.bar();
alert(foo.qux); // value
</code></pre>
<p>Also: <a href="http://jsbin.com/emayub/9/edit" rel="nofollow">http://jsbin.com/emayub/9/edit</a></p>
| javascript | [3] |
4,618,283 | 4,618,284 | Why would it be necessary to subclass from object in Python? | <p>I've been using Python for quite a while now, and I'm still unsure as to why you would subclass from <code>object</code>. What is the difference between this:</p>
<pre><code>class MyClass():
pass
</code></pre>
<p>And this:</p>
<pre><code>class MyClass(object):
pass
</code></pre>
<p>As far as I understand, <code>object</code> is the base class for all classes and the subclassing is implied. Do you get anything from explicitly subclassing from it? What is the most "Pythonic" thing to do?</p>
| python | [7] |
358,573 | 358,574 | What is the significance of 'context' in various constructor of Intent class when starting an activity | <p>I had come across a code snippet which calls for an activity without referring to any context. Before, i was considering that context is used to tell about the calling component. But as i came see that another component can be called without any reference to context, it makes me wonder what purpose it might be serving. please put some light on it.</p>
<p>Here is the code which calls for an activity without referring to 'context'</p>
<pre><code>Intent i=new Intent();
ComponentName cn=new ComponentName("application package name","fully qualified class name");
i.setComponent(cn);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
</code></pre>
| android | [4] |
4,180,496 | 4,180,497 | Replace word phrases, honoring punctuation in php | <p>I have a custom php script that looks through text to find key phrases and replaces them using preg_replace, but I'm having trouble getting a clean regex for the job.</p>
<p>For example this sentence:</p>
<blockquote>
<p>The fox jumped over the gated fence
because it did not have hands to open
the gate.</p>
</blockquote>
<p>I would want to bold all instances of <code>gate</code>, yet respect oddities like <code>gated</code>. And also preserve original capitalization too if possible.</p>
<p>So the end sentence would read like this:</p>
<blockquote>
<p>The fox jumped over the gated fence
because it did not have hands to open
the <strong>gate</strong>.</p>
</blockquote>
<p>Here is the regular expression I've created myself, and you will see that it would not account for gate. because of the period following the word. And also the regex does not respect any original capitalization. </p>
<pre><code>$description = preg_replace("/ $keyphrase /", " <b>$keyphrase</b> ", $description, $limit);
</code></pre>
| php | [2] |
3,764,370 | 3,764,371 | Some packages were found but are not compatible updates | <p>I have trouble in installing the Android SDK to Eclipse at the course of
registering available packages.
What should I do :P</p>
| android | [4] |
5,540,410 | 5,540,411 | Issue with NSDatePicker | <p>I want to show only day and month and not year in my date picker. Not sure how to achieve this. Please suggest.</p>
| iphone | [8] |
4,981,264 | 4,981,265 | Back key not fully killing app, notification persists | <p>Min SDK is 7</p>
<p>I have a little notification on the top of the screen, but when you press the back key on the main activity, it doesn't go away. What do I need to add to my back button override to fix this?</p>
<pre><code>@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if ((keyCode == KeyEvent.KEYCODE_BACK))
{
finish();
}
return super.onKeyDown(keyCode, event);
}
</code></pre>
| android | [4] |
1,389,632 | 1,389,633 | C++ private members accessible? | <p>I have this project in our signals class which uses C++. I was tinkering with our instructors code when I saw this:</p>
<pre><code>ListData::ListData(const ListData& newlist)
: Data(), nbNodes(newlist.nbNodes) {}
</code></pre>
<p>This is a "copy constructor" as he says, and should be roughly equivalent to the following:</p>
<pre><code>ListData::ListData(const ListData& newlist){
Data = "";
//copy nbNodes of newList to current instance
nbNodes = newlist.nbNodes;
}
</code></pre>
<p>But what bothers me is that <code>nbNodes</code> is a private member. <strong>How could this constructor access the <code>nbNodes</code> of the passed <code>newList</code> if it's private?</strong></p>
| c++ | [6] |
5,375,768 | 5,375,769 | How to enable both hardware and virtual keyboards on Android ice cream sandwich | <p>I'm developping a stock management application with Django for a customer's company, and want to use an ice cream sandwich tablet as the end-user device.
I use an USB barcode reader which works fine.</p>
<p>My problem is that once the barcode reader is plugged in, it's recognized as a real keyboard, and I can't access the virtual keyboard anymore. This is a big issue for me, because I only use the barcode reader to encode EAN13 codes, and need the soft keyboard beside...</p>
<p>Is there any way to enable both virtual and real keyboards ?
I really need help on this....</p>
<p>Thank you !</p>
| android | [4] |
375,081 | 375,082 | passing boolean condition as parameter | <p>I have these</p>
<pre><code>def MsgBox1_YesChosen(sender,e):
if e.Key != "A": function0()
else:
function1()
function2()
function3()
def MsgBox1_NoChosen(sender,e):
if e.Key == "A": function0()
else:
function1()
function2()
function3()
</code></pre>
<p>can both def be merged together? The only difference between them is "==" , "!="</p>
| python | [7] |
4,044,423 | 4,044,424 | How to get Lat long of captured image | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6798508/how-to-get-latitude-and-longitude-infromation-from-picture">How to get Latitude and Longitude infromation from picture</a> </p>
</blockquote>
<p>Here i want to perform a task like,when i take photo from camera of my android device,it should show the lat long and address of the captured image.</p>
<p>Please let me know if it is already done.</p>
<p>Thanks in advance,
Trapti Gupta</p>
| android | [4] |
5,441,864 | 5,441,865 | reading the checkbox status in IE using Javascript | <p>I have some javascript that on page load reads a group of check boxes checking their checked status. If the checkbox is checked then a value is added to an array which is later used.</p>
<pre><code>var _chkBoxes = document.getElementsByName("chkProduct");
var _chkBoxesLen = _chkBoxes.length;
var _chkArray = [];
for (var i = 0; i < _chkBoxesLen; i++) {
if (_chkBoxes[i].checked === true) {
_chkArray.push(_chkBoxes[i].id.split("-")[1]);
console.log(_chkArray);
}
}
</code></pre>
<p>This works fine for all browsers when the page is freshly loaded.</p>
<p>However in IE if a user ticks some boxes, navigates to another page then pushes the back button then this work does not recognise that checkboxes have been previously checked, even though on the page they are.</p>
<p>Is this a bug with IE and whats the fix, any opinions appreciated!</p>
| javascript | [3] |
641,872 | 641,873 | What does this C++ code mean? | <p>What does the following C++ code mean?</p>
<pre><code>unsigned char a : 1;
unsigned char b : 7;
</code></pre>
<p>I guess it creates two char a and b, and both of them should be one byte long, but I have no idea what the ": 1" and ": 7" part does. </p>
| c++ | [6] |
2,936,606 | 2,936,607 | How to change this date in PHP? | <p>I have times in this format:</p>
<pre><code>2013-04-10 10:25:00
</code></pre>
<p>I don't need the time part, just this:</p>
<pre><code>2013-04-10
</code></pre>
<p>How to do that properly? I don't want to use string deleting from the end but the right way. </p>
| php | [2] |
5,420,650 | 5,420,651 | Echo content inside foreach only once | <p>I'm trying to echo content inside a foreach once. At the moment, when a form is filled by the user, the message is displayed for every record skipped. If there are 35 records skipped, I will get 35 messages, because of the foreach. I want to avoid this, and be able to display only one echo for the entire results page. How can I do this? I suppose I may have to do this outside the foreach, but I have no clue how to take it out of the foreach.</p>
<pre><code>foreach($allcourses as $course)
{
if(Auth::LoggedIn())
{
if(Auth::$userinfo->rank == 'Student')
{
if($course->aircraft == '1')
{
echo '<div class="msg-red">Some lessons could not be found, because you may not be entitled to view/book them at this stage of your course.</div><br/>';
continue;
}
if($course->aircraft == '2')
{
echo '<div class="msg-red">Some lessons could not be found, because you may not be entitled to view/book them at this stage of your course.</div><br/>';
continue;
}
}
}
}
</code></pre>
| php | [2] |
1,249,770 | 1,249,771 | Object #<Object> has no method 'addEventListener' | <p>I have my canvas saved as an object but it won't let me add an eventListener because it creates this error:</p>
<pre><code>Object #<Object> has no method 'addEventListener'
</code></pre>
<p>This is how i create the canvas:</p>
<pre><code> var i = 1;
document.getElementById("G").innerHTML += '<canvas id="layer'+i+'" class="c" style="z-index:'+i+';"></canvas>';
temp = document.getElementById('layer'+i);
objname = 'canvas'+i;
canvas[objname] = new Object();
canvas[objname].ctx = temp.getContext("2d");
</code></pre>
<p>Then i do:</p>
<pre><code>canvas.canvas1.addEventListener("mousedown", fnc_test, false);
</code></pre>
<p>Any ideas why this is not allowed, or where I am going wrong??</p>
| javascript | [3] |
3,579,643 | 3,579,644 | Imports in python are static, any solution? | <p>foo.py :</p>
<pre><code>i = 10
def fi():
global i
i = 99
</code></pre>
<p>bar.py :</p>
<pre><code>import foo
from foo import i
print i, foo.i
foo.fi()
print i, foo.i
</code></pre>
<p>This is problematic. Why does <code>i</code> not change when <code>foo.i</code> changes?</p>
| python | [7] |
5,305,901 | 5,305,902 | how to create widget in android | <p>how to create widgets in android i dnt know nothing please any boby help me to create this widget and tell me each and every s</p>
| android | [4] |
3,046,586 | 3,046,587 | Autocomplete blocks in C# | <p>Iam used to Eclipse and Java development, but because of my job I need to start coding in C#. I find it a bit annoying that visual studio doesn't autocomplete my blocks. For instance when I write a new function, class or statement am used to that the IDE autocompletes my blocks. So when I type: </p>
<pre><code>private function sendData(String msg, String email) {
</code></pre>
<p>and hit <code>enter</code> the closing bracket appears automatically, is there any settings that enables this function in <code>Microsoft visual C# 2010 express</code> ?</p>
| c# | [0] |
2,074,522 | 2,074,523 | Broadcast receiver not called | <p>I know this a basic problem but it is still driving me crazy. I am setting a repeating alarm but the receiver is never called.</p>
<pre><code>Intent intent = new Intent(NewSchedule.this, RepeatingAlarm.class);
PendingIntent sender = PendingIntent.getBroadcast(NewSchedule.this, 0, intent, 0);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.add(Calendar.SECOND, 10);
AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, calendar.getTimeInMillis(), 5 * 1000, sender);
Log.i("calendar",calendar.getTimeInMillis() + "");
Toast.makeText(NewSchedule.this, "repeating_scheduled", Toast.LENGTH_SHORT).show();
public class RepeatingAlarm extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "repeating_received", Toast.LENGTH_LONG).show();
}
}
<receiver android:name=".RepeatingAlarm" android:process=":remote" />
</code></pre>
<p>I am testing on my phone. The calendar log shows the exact time. I never get the Toast in the receiver class.</p>
| android | [4] |
1,325,325 | 1,325,326 | Converting a string into an array | <p>I have a string - something like</p>
<pre><code>$string = 'key1=value1, key2=value2, key3=value3';
</code></pre>
<p>How can I get an array from the given string like the following?</p>
<pre><code>$array = array(
'key1' => 'value1',
'key2' => 'value2',
'key3' => 'value3',
);
</code></pre>
| php | [2] |
1,232,822 | 1,232,823 | Populate separate arrays in iPhone from data in NSMutableArray | <p>In one of my applications I have a requirement to fetch data from an <code>NSMutableArray</code> and store the data which we got in separate arrays in iPhone. Please provide a solution for me. How do I accomplish this? </p>
<p>Requirements are listed below:</p>
<ol>
<li>Actually total projects are available in one array (this I got from server).</li>
<li>Total number of filters available in another array (this also I got from server).</li>
<li>Based on each filter (each filter is linked with few projects) I have to fetch projects from projects array.</li>
<li><p>I am able to fetch projects related to separate filter, but the problem is that after fetching the projects I have to store those projects in separate new arrays related to each filter (means here I have to create new array in runtime).</p>
<p>It is here that I am having trouble. How do I create arrays dynamically at runtime instead of declaring them in advance? Because the filters count will vary at any point of time at server side, I cannot predict in advance how many arrays I need.</p></li>
</ol>
<p>I’m following this approach, but this is the issue I am facing.</p>
| iphone | [8] |
3,690,793 | 3,690,794 | Remove Selected/Highlighted Text using JQuery | <p>I have this</p>
<pre><code><div id="remove"></div>
<div CONTENTEDITABLE="true"></div>
</code></pre>
<p>If a user highlights text in the contenteditable div and clicks on the remove div, I would like to remove that text. </p>
| jquery | [5] |
331,444 | 331,445 | PHP IF statement error | <p>I keep receiving the follow error message on "Parse error: syntax error, unexpected T_IF on line 152" which is the IF statement on my PHP code. What am I doing wrong?</p>
<pre><code> echo "<td>".
if ($licensed_venue[$i]=1):
echo 'Licensed';
else: echo 'Not Licensed';
endif;."</td>";
</code></pre>
<p>Thanks in advance.</p>
| php | [2] |
1,456,195 | 1,456,196 | Is it possible to manipulate some text with an user-defined I/O manipulator? | <p>Is there a (clean) way to manipulate some text from std::cin before inserting it into a <code>std::string</code>, so that the following would work:</p>
<pre><code>cin >> setw(80) >> Uppercase >> mystring;
</code></pre>
<p>where mystring is <code>std::string</code> (I don't want to use any wrappers for strings).
<code>Uppercase</code> is a manipulator. I think it needs to act on the Chars in the buffer directly (no matter what is considered uppercase rather than lowercase now). Such a manipulator seems difficult to implement in a clean way, as user-defined manipulators, as far as I know, are used to just change or mix some pre-determined format flags easily.</p>
| c++ | [6] |
1,697,961 | 1,697,962 | In ASP.NET, what conditions would cause OnServerClick="foo" to fail, so that "foo()" never gets called? | <p>I've written an ASP.NET application that runs on thousands of sites. But at least at one site, the following code fails: </p>
<pre><code>void foo(Sender o, EventArgs e)
{
....
}
<input runat="server" .... OnServerClick="foo" ...
</code></pre>
<p>Have you ever experienced the OnServer events failing? I experimented at this site and couldn't come up with exactly the magic that makes it fail, but IIS Windows Authentication might be related, or this line of code might be related, based on turning things on and off, commenting things out: </p>
<pre><code>void Page_Init (object sender, EventArgs e) {ViewStateUserKey = Session.SessionID;}
</code></pre>
<p>But how would these things be related? And again, this same code works at thousands of other sites.</p>
<p>So, have you ever encountered OnServer events failing triggered by setttings or conditions that were outside of your code?</p>
| asp.net | [9] |
22,865 | 22,866 | AndroidHttpClient. How do I set KeepAlive strategy? | <p>What would be syntax to do that. It's not DefaultHttpClient, it's AndroidHttpClient.</p>
<p>I noticed some exceptions with broken pipes and I want to set connections to keep alive for 10-20 seconds.</p>
| android | [4] |
4,881,997 | 4,881,998 | Crypto++ Version 5.6.0 | <p>anyone used the latest version of cryptopp. i think its 5.6.0. I have a solution working in unix. but in windows I am stuck. Anyone here already using cryptopp 5.6 in vs2008 could you please give very specific instructions on how you compiled this? i have also posted in the cryptopp user groups for an answer. There are some instructions but for vs 6.0 and not the version i am using. So, I am not sure how to proceed. </p>
<p>The errors are as follows:
error: lnk2005 already defined in cryptlib(iterhash.obj)
(cryptlib.obj) </p>
| c++ | [6] |
1,474,239 | 1,474,240 | Why is a[:]=1 fundamentally different to a[:]='1'? | <p>Please consider the two snippets of code (notice the distinction between string and integer):</p>
<pre><code>a = []
a[:] = '1'
</code></pre>
<p>and</p>
<pre><code>a = []
a[:] = 1
</code></pre>
<p>In the first case <code>a</code> is <code>['1']</code>. In the second, I get the error <code>TypeError: can only assign an iterable</code>. Why would using <code>'1'</code> over <code>1</code> be fundamentally different here?</p>
| python | [7] |
4,483,820 | 4,483,821 | How to convert this string into an array | <p>I have a string being returned from my database that I want to use as an array. It is already in an assoc array form. Here is a sample of what this looks like so far. How would I do this?</p>
<pre><code>'test1' => 'value 1',
'test1' => 'value 1a,
'test2' => 'value 2'
</code></pre>
<hr>
<p>Ok, this is the database code:</p>
<pre><code> SELECT
inventory.invId,
GROUP_CONCAT(CONCAT( '''', inventory.vehicle, ''' => ', '''', inventory.color, '''' )) AS vehicle,
vehicle.vehicle_id
FROM
inventory
Inner Join vehicle ON vehicle.invId = inventory.invId
</code></pre>
<p>This is the print_r from the database results</p>
<pre><code>Array
(
[0] => Array
(
[system] => AR3
[vehicle] => 'geo' => 'red', 'honda' => 'blue', 'ford' => 'black'
[vehicle_id] => 1232132
)
)
</code></pre>
| php | [2] |
5,070,010 | 5,070,011 | How to insert a new line after a text in javascript | <p>i m appending text values in a string and on each iteration i want to move to a new line. my code is :</p>
<pre><code>$lblEmployee.html($lblEmployee.html()+" "+ dataEmployees[i]["FirstName"] +" " + criteriaTestedEmployees[i]["LastName"]);
</code></pre>
<p>I tried putting <code>\n</code> at the end like :</p>
<pre><code>$lblEmployee.html($lblEmployee.html()+" "+ dataEmployees[i]["FirstName"] +" " + criteriaTestedEmployees[i]["LastName"] + "\n");
</code></pre>
<p>But it doesn't work.</p>
<p>May someone pls suggest a way..Thanks in advance..</p>
| javascript | [3] |
24,295 | 24,296 | jQuery Hover question | <p>here:</p>
<p><a href="http://www.jsfiddle.net/JEXru/1/" rel="nofollow">http://www.jsfiddle.net/JEXru/1/</a></p>
<p>i don't know how to make it so if you hover over the slide it stays active ... help?</p>
| jquery | [5] |
908,706 | 908,707 | Monitoring the other Apps from one app in iPhone | <p>I need to create and App that will run in the background and will monitor the user's behavior in term of applications installed, opened and deleted.</p>
<p>i.e Application will save the information in the database that at what time user has installed/opened/deleted an application in iphone.</p>
<p>I wonder if its possible and Apple will allow this??</p>
<p>I tried to google on it but did not get anything, i know if its possible then it would be possible by multiasking only??</p>
<p>Can any one please help me on the same.</p>
<p>Brn</p>
| iphone | [8] |
5,348,688 | 5,348,689 | How to make jQuery work with invalid HTML containing duplicate IDs? | <p>I have an old project that does contain HTML with duplicate IDs. Switching selectors from ids to classes needs a lot of work, Can I do it with the JQuery, specially that I know how many divs I'll hide. </p>
<pre><code><div id="d"></div>
<div id="d"></div>
<div id="d"></div>
</code></pre>
<p>I want to hide them all using a single action : </p>
<pre><code>$('#d').hide();
</code></pre>
<p>but it hides the first div only.</p>
| jquery | [5] |
1,719,312 | 1,719,313 | Exceptions in database model, how do I handle it? | <p>I am creating a model for a small PHP application. This will utilize PDO to communicate with a MySQL-server. I have understood that the recommended error mode is the one which throws exceptions, as this allows for graceful error handling. But I don't understand how I should handle these exceptions?</p>
<p>Technically, it is easy, but let me give you an example:</p>
<pre><code>class Model()
{
private $host = "localhost",
$user = "",
$pass = "",
$DBH;
function __construct()
{
try
{
$DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
$DBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch(PDOException $e)
{
error_log($e->getMessage());
}
}
}
</code></pre>
<p>If I create an object Model in my controller, and it fails, I have no way of handling this in my controller, right? Or what happens when I create that object, "new Model" returns false? </p>
<p>Excuse me for being a newbie, but I want to be able to handle any exceptions also from other functions in the model. How should I go about this? I need to be able to know if something went wrong in my controller and be able to do the appropriate thing there.</p>
| php | [2] |
101,010 | 101,011 | jQuery call on a <div> tag (or any HTML element) - is looping implied? | <p>I'm learning jQuery and had a question about a method call on an HTML element. In this case it's a <code><div></code> tag.</p>
<p>The jQuery call goes like this:</p>
<pre><code><script type="text/javascript">
$(function(){
$('.someClass').myMethod({
value1: 'sometext',
value2: 'someothertext'
});
});
</script>
</code></pre>
<p>The <code><div></code> tag has a CSS class of 'someClass', as you can see below:</p>
<pre><code><div class="someClass" style="display: none;">
<div id="my-content">
<img id="enter" alt="Logo" src="images/logo.png">
</div>
</div>
</code></pre>
<p>My question is, what's happening with that method call in jQuery? Is it looping over all elements contained within the <code><div class='someClass'/></code> and calling myMethod on all of them?</p>
| jquery | [5] |
3,605,342 | 3,605,343 | Multi language support for an Android device | <p>How do I support my Android device for multiple languages? I have created a application in Android that dynamically switches between two languages(namely English and Marathi).Every thing works fine in the emulator. However when I install my application on my Android device the text does not change into the Marathi language. I have included the Shivaji.ttf file required for the Marathi language in the assets folder of the project.</p>
<p>Please help.</p>
| android | [4] |
1,160,464 | 1,160,465 | Quick access to Android for a third person | <p>Recently I was asked if I could help someone to get quick-started to android programming.</p>
<p>What would you suggest to tell this person?
Would you explain everything by hand or just refer to external links?
Which ressources would you recommend?
This whole issue should not take too much time...assuming 2-3 hours</p>
<p>Once my access to this issue was "<a href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-Android-Application-Development.productCd-0470344717.html" rel="nofollow">Professional android application development</a>".
Java basics are already preconditioned, so there's no need to explain ANYTHING.</p>
<p>For avoiding any misconceptions: This shall be just a quick start, no reference or something like this, so I just need some keywords and a hint how deeply go through it.</p>
| android | [4] |
3,899,135 | 3,899,136 | What is better? Static methods OR Instance methods | <p>I found that there are two type of methods called static methods and instance methods and their differences.
But still I couldnt understand the advantages of one over another.</p>
<p>Sometimes i feel that static methods are not 100% object oriented.</p>
<p>Are there any performance differences between this two.</p>
<p>Can someone help?</p>
<p>Thanks n Regards,
Jay...</p>
| c# | [0] |
5,506,046 | 5,506,047 | how to create search engine in asp.net | <p>how to create search engine in asp.net ??</p>
<p>cheers</p>
| asp.net | [9] |
2,517,221 | 2,517,222 | How to output unicode? | <p>Hey guys, I need to export data from database which contains Unicode(like Japanese characters).
While when i trying to export to csv files, it just becomes the garbage.... </p>
<p>First, I need to read data from database and save it to an datatable
Second, I will make a query based on the datatable (Using Linq)
Last, Export the queried results to csv file </p>
<p>Is there any way to solve this problem? </p>
<p>Thanks a lot.</p>
| c# | [0] |
2,860,667 | 2,860,668 | how to make the line ok? | <pre><code>$lc_button.=$lc_button.'<div class="buttonRow forward">'.<?php echo zen_submit(BUTTON_IMAGE_ADD_PRODUCTS_TO_CART, BUTTON_ADD_PRODUCTS_TO_CART_ALT, 'id="submit1" name="submit1"'); ?>.
'</div>';
</code></pre>
<p>it shows an error on it. but i don't know where it is and how to correct it?</p>
| php | [2] |
5,820,650 | 5,820,651 | How to handle 1000+ images in a C# Application? | <p>A winform control for displaying a list of images is currently implemented with a flowlayoutpanel and a collection of pictureboxes. But even at thumbnail scale (64x64) when we when start to approach 1000+ images we get OutOfMemory exceptions - our actual problem lies from the thumbnail generation part and the creation of the Image object. </p>
<p>I haven't been able to find any strategies from the existing image viewing examples on the net regarding a large number of images so does anybody have any links or strategies for solving this problem of displaying a list of 1000+ images?</p>
<p>As a starting point we really only need these image objects around when the thumbnail's picture box is in view. Then we would only have 10 image objects created but is there a smarter way of doing this other than loading and destroying image objects?</p>
<p>Thanks,
Edward</p>
| c# | [0] |
56,599 | 56,600 | How can I setRate for Android MediaPlayer? | <p>How can I implement </p>
<pre><code>setRate(float f)
</code></pre>
<p>for my Android MediaPlayer, and secondly is it posible?</p>
| android | [4] |
5,428,686 | 5,428,687 | Javascript currency formatting | <p>I'm having a pesky issue...</p>
<p>I'm using a small javascript to format currency such as</p>
<p>2990 to 2.990 and 129900 to 129.900 using the current line:</p>
<pre><code>var wdiscount2 = wdiscount.toFixed(3);
</code></pre>
<p>however, when i have a number under 1000 such as 789 it displays like 0.789</p>
<p>Do you have a way for me to get around this easily ?.</p>
| javascript | [3] |
1,953,441 | 1,953,442 | Changing folder name in Python | <p>I need a super simple script that changes the names of the subfolders of the actual folder<br></p>
<p>Here's a little example for better understanding. <br>
Im in the folder <strong>My Music</strong> and I want to change tha name of all the subfolders (<strong>This_Is_A_Example_Subpath</strong>):</p>
<p>C:/My Music/This_Is_A_Example_- Subpath<br>
C:/My Music/This_Is_A_Example_- Subpath1<br>
C:/My Music/This_Is_A_Example_- Subpath2<br></p>
<p>I want to change to:</p>
<p>C:/My Music/This Is - A Example - Subpath<br>
C:/My Music/This Is - A Example - Subpath1<br>
C:/My Music/This Is - A Example - Subpath2<br></p>
| python | [7] |
5,963,309 | 5,963,310 | character set conversion | <p>i wanna convert to original string of “Cool†..Origingal string is <code>cool</code> . (' is backquote)</p>
| php | [2] |
711,294 | 711,295 | JQuery append() | <p>Why the following code only appends the first div i add and not all of them?
(i stripped some code for the sake of argument).</p>
<p>Any tips on how to dynamically construct some nested divs with jquery are welcome.</p>
<pre><code> var divRow;
var nRow = 0;
var i = 0;
$.each(data, function (key, value) {
nRow++;
div.append("<div id='divRow" + nRow + "' style='position: relative; float: left; '></div>");
divRow = $('divRow' + nRow);
divRow.append("<div id='divBox" + i + "' style=position: relative; clear: both; padding: 5px'></div>");
var divBox = $('divBox' + i);
divBox.append("<div style='position: relative; clear: both; padding: 5px'>" + value.Word + "</div>");
divBox.append("<div style='position: relative; clear: both; padding: 5px'>" + value.Description + "</div>");
i++;
});
</code></pre>
| jquery | [5] |
3,186,754 | 3,186,755 | Placing one relative layout beside another relative layout programatically | <p>I have two relative layouts that are currently displayed one below the other. I want the second layout to be displayed to right of the first relative layout programatically.</p>
<p>following is the code i used.</p>
<p>main.xml</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="620dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/lay1" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello1" />
</RelativeLayout>
<RelativeLayout
android:layout_width="620dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/lay2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello2" />
</RelativeLayout>
</LinearLayout>
</code></pre>
<p>myAct.java</p>
<pre><code>public class myAct extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LinearLayout layoutContainer = new LinearLayout(this);
layoutContainer.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
// Arguments here: width, height, weight
LinearLayout.LayoutParams childLp = new LinearLayout.LayoutParams(0, LayoutParams.WRAP_CONTENT, 1);
RelativeLayout layoutLeft = new RelativeLayout(this);
layoutContainer.addView(layoutLeft, childLp);
RelativeLayout layoutRight = new RelativeLayout(this);
layoutContainer.addView(layoutRight, childLp);
}
}
</code></pre>
<p>Thanks in advance</p>
| android | [4] |
4,970,003 | 4,970,004 | Reopening an existing Android project | <p>I created my first Android project in Eclipse, and when I try to open it, I can't reach the correct file of the project. </p>
<p>Which file should I open to open my project.</p>
| android | [4] |
2,389,535 | 2,389,536 | Python command execution output | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4760215/running-shell-command-from-python-and-capturing-the-output">Running shell command from python and capturing the output</a> </p>
</blockquote>
<p>I want to capture the output of a command into a variable, so later that variable can be used again. I need to change this script so it does that:</p>
<pre><code>#!/usr/bin/python
import os
command = raw_input("Enter command: ")
os.system(command)
</code></pre>
<p>If I enter "ls" when I run this script, I get this output:</p>
<pre><code>Documents Downloads Music Pictures Public Templates Videos
</code></pre>
<p>I want to capture that string (the output of the ls command) into a variable so I can use it again later. How do I do this?</p>
| python | [7] |
1,584,847 | 1,584,848 | Java Sorting User defined Objects | <p>I want to sort Collection of Objects, which does not implement comparable or comparater interface. The problem is I cannot change the class design because I have only .class(no source code) file. How can I achive this?</p>
| java | [1] |
5,656,197 | 5,656,198 | Disable Home Button and Have Application Full Screen with No Title (no status bar, no title) in Android Froyo | <p>First off, yes I know that its not the intended behavior of the OS to disable the home button, but the application I am creating is for use on a collection of devices for use inside of a closed organization only and not public consumption. Secondly, I know that there are many similar questions and spotty answers everywhere, but no solution has been presented as of yet, so I felt it prudent (albeit somewhat self serving) to put the question out there one more time properly.</p>
<p>I am trying to simply create a splash screen that is also a remote network lock screen. When the device is remotely told to do so it will end the activity and the user can begin to use the device.</p>
<p>In the manifest this is set:</p>
<pre><code><activity android:name=".ActivityOne" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
</code></pre>
<p>In the Activity:</p>
<pre><code>@Override
public void onAttachedToWindow()
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
</code></pre>
<p>Combined these stop the home button, but seem to allow the status bar to remain visible. There are several obvious reasons why I would not want the status bar visible, but most importantly once a user 'pulls down' on the status bar to see the notifications area the home button becomes usable again and the whole exercise is circumvented.</p>
<p>I am primarily looking for an answer to this, condoned or a hack via code. If there is not a direct modification that can be done to the code set above, I would certainly appreciate and accept an answer that properly describes (preferably with code samples) any alternative logic that achieves the same goal. The alternatives can be to modify some system files or other lower level techniques.</p>
<p>As a final note, please know that we have SU / Root access for all of the devices.</p>
| android | [4] |
1,910,985 | 1,910,986 | Java variadic function parameters | <p>I have a function that accepts a variable number of parameters:</p>
<pre><code>foo (Class... types);
</code></pre>
<p>In which I get a certain number of class types. Next, I want to have a function</p>
<pre><code>bar( ?? )
</code></pre>
<p>That will accepts a variable number of parameters as well, and be able to verify that the variables are the same number (that's easy) and of the same types (the hard part) as was specified in <code>foo</code>. </p>
<p>How can I do that?</p>
<p><strong>Edit:</strong> to clarify, a call could be:</p>
<pre><code>foo (String.class, Int.class);
bar ("aaa", 32); // OK!
bar (3); // ERROR!
bar ("aa" , "bb"); //ERROR!
</code></pre>
<p>Also, foo and bar are methods of the same class.</p>
| java | [1] |
4,395,826 | 4,395,827 | Element should remain opened on hover | <p>I try to show an element X on <code>mouseenter</code> element Y and to hide it on <code>mouseleave</code> element Y. </p>
<p>So far it works OK. </p>
<p>In addition to that I would like element X after hovering over it, to stay opened.<br>
After hovering out of element X, it should be hidden. </p>
<p>Can you please help me to find out where is problem in the code?<br>
(I use jquery 1.3.2)</p>
<pre><code>$(document).ready(function () {
$('.kukuk').mouseenter(showBox).mouseleave(hideBox);
function showBox(e) {
$('.kuk-blok').fadeIn().css(({
left: 0,
top: 30
}));
}
function hideBox() {
$('.kuk-blok').fadeOut();
}
$(".kuk-blok").hover(function () {
$(this).css('display:block');
}, function () {
$(this).css('display:none');
});
});
</code></pre>
| jquery | [5] |
5,202,345 | 5,202,346 | Implementing GPS into an Android Application | <p>I've been working on a piece of code for an Android application. I don't understand how to implement GPS into my code so that I can access features such as speed and location.</p>
<p>Can someone help me with this or guide me in the right direction? Most of the things I've found online are Maps only based...and not using maps as a side part of the application. The tough part is doing all of this with Android :\</p>
| android | [4] |
1,419,919 | 1,419,920 | PHP: MoveUploadedFile -> name.jpg = imagecreatefromjpeg() ... is not a valid JPEG file in | <p>I do have a problem: On my website, I allow user to upload an image in every format. Then, on the server I run MoveUploadedFile() and as param I give it a name with '.jpg' in the end. It gets saved and on Windows, I can properly open the image. But if I want to open it with 'imagecreatefromjpeg()' then the function returns "image.jpg is not a valid JPEG file in ...."</p>
<p>What do I have to do so this does not happen anymore?</p>
<p>Thanks for answers ;)</p>
<p>Regz, Flo</p>
| php | [2] |
4,401,731 | 4,401,732 | inserting a row in gridview but reflecting in database? | <p>I am having a task that, i need to insert a row in gridview but it should not effect in to database immideately. I am having a submit button in the form, whenever i click that submit button all the data in the form should be inserted into the database in their respective tables. If you can please help me.</p>
<p>Thanking you,
Anil kumar.</p>
| asp.net | [9] |
3,157,701 | 3,157,702 | How to display "" itself as a string | <p>Is there any way "" (double quotes itself) can be displayed as a string in c++</p>
<p>I tried <code>cout << " "" ";</code> which obviously does not work.</p>
| c++ | [6] |
167,336 | 167,337 | Searching for an object | <p>This is how I have been searching for objects in python. Is there any more efficient (faster, simpler) way of doing it?</p>
<p>Obs: A is a known object.</p>
<pre><code>for i in Very_Long_List_Of_Names:
if A == My_Dictionary[i]:
print: "The object you are looking for is ", i
break
</code></pre>
| python | [7] |
5,170,122 | 5,170,123 | moving values between listbox in JQUERY | <p>I have a listbox which has 1,2,3,A,B,C where if user selects 1,2 for the first time and moves it to 2nd listbox.Again When he selects A and sends i should alert him saying you have selected numeric please select the same and vice versa.</p>
<p>I need this in JQUERY not javascript.</p>
<p>Sorry if i am wrong here.</p>
<p>Please help me to solve this..</p>
| jquery | [5] |
5,563,819 | 5,563,820 | activity in background | <p>Is there a way to 'preload' a user interfaces but to not display it until I am ready? </p>
<p>I have a service which has a receiver to listen for action_screen_on to occur. When that occurs, I would like to load an activity. However, as it is now, it takes about 1 second to load. I would like to preload the layout in advance so that when the screen is turned on the layout loads as soon as possible.</p>
| android | [4] |
5,758,697 | 5,758,698 | Addition turns into concatenation | <pre><code>var Height= (rowData.length * 30) + PPPP.top + 10 ;
</code></pre>
<p>When i print this i get 9013510... instead of 90 +135+10 = 235. Why does mine turns into concatentaion instead of Addition. </p>
| javascript | [3] |
2,669,265 | 2,669,266 | how to use span to call in android? | <p>i have a textview whose text i am setting as a big string.</p>
<p>this string has several parts like telphone no, mail , browsing address.</p>
<p>i have found how to use the browsing address in a span to open up the link in a browser?
here is the code</p>
<pre><code> TextView tv = (TextView) findViewById(R.id.infotest);
SpannableString ss = new SpannableString(getResources().getString(R.string.clientaddress));
ss.setSpan(new URLSpan("http://"+getResources().getString(R.string.clientaddress)), 0, 23,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
</code></pre>
<p>how do i do the same for telephone text.
i mean how do i span the telephone text to call a the number when the user presses that specific part of the textview string.</p>
| android | [4] |
4,552,375 | 4,552,376 | Jquery programmatically click in a specific X Y position in DIV | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3277369/simulate-a-click-by-using-x-y-coordinates-javascript">Simulate a click by using x,y coordinates? - Javascript</a> </p>
</blockquote>
<p>Would anyone know how to programmatically click in a div to a specific X,Y location? Using JQueryor plain javascript.</p>
<p>I'd like to click a button, which would simulate a click in a div via X,Y position.</p>
<p>Thanks!</p>
| jquery | [5] |
5,463,702 | 5,463,703 | Convert Forever Changing Randomly Generated Integers Into Strings | <p>[Solved]</p>
<p>I've searched many forums as well as Stack Overflow's questions for converting an ever changing random number to a string but I couldn't find a solution to my specific problem.</p>
<p>How do I go about converting customerID to a string?</p>
<pre><code> public class UniqueCustomerNumber {
private int customerID;
public void setCustNum(int cNumber) {
Random x = new Random();
cNumber = x.nextInt(800000001) + 100000000;
customerID = cNumber;
}
public int getCustNum() {
return customerID;
}
}
</code></pre>
| java | [1] |
13,708 | 13,709 | proper way of using output of one class in another class | <p>I am using the following code to produce an array:</p>
<pre><code>// Create new customer object
$customers = new customers;
// Array of user ids
$customers->ids = array(34,23,78);
// Process customers
$customers->processCustomers();
</code></pre>
<p>The above code will output an array full of needed user information based on the users passed to it.</p>
<p>Now I need to take further action to this new customer array in the following code:</p>
<pre><code>// Create new parsing object
$parseCustomers = new parse;
// Array of customer data
$parseCustomers->customers = ???????????
// Finalize new transaction
$parseCustomers->finalizeTransaction();
</code></pre>
<p><strong>I need to pass the array from the first class output into the second and I'm wondering what best practice is.</strong></p>
<p>This customer array can be very large at times, so ideally I wouldn't have 2 variables containing the same array at any time.</p>
| php | [2] |
4,656,991 | 4,656,992 | getting data out of a txt file | <p>I'm only just beginning my journey into Python. I want to build a little program that will calculate shim sizes for when I do the valve clearances on my motorbike. I will have a file that will have the target clearances, and I will query the user to enter the current shim sizes, and the current clearances. The program will then spit out the target shim size. Looks simple enough, I have built a spread-sheet that does it, but I want to learn python, and this seems like a simple enough project...</p>
<p>Anyway, so far I have this:</p>
<pre><code>def print_target_exhaust(f):
print f.read()
#current_file = open("clearances.txt")
print print_target_exhaust(open("clearances.txt"))
</code></pre>
<p>Now, I've got it reading the whole file, but how do I make it ONLY get the value on, for example, line 4. I've tried <code>print f.readline(4)</code> in the function, but that seems to just spit out the first four characters... What am I doing wrong?</p>
<p>I'm brand new, please be easy on me!
-d</p>
| python | [7] |
2,135,835 | 2,135,836 | JavaScript Script Taking Too Long to Execute. Getting the Script Taking Too Long Prompt | <p>I have a JavaScript function buildTable which builds a very long HTML table. </p>
<pre><code> function buildTable() {
for (var i = 0; i < rowCount; i++) {
.. code to create table
}
</code></pre>
<p>}</p>
<p>The buildToolsetTable takes too much time and after few seconds IE 7 shows the prompt that if I want to keep running the script. I read that I can use window.setTimeout to make another call and refresh the execution but if someone has implementation then it will be super helpful.</p>
| javascript | [3] |
1,541,592 | 1,541,593 | How to Create your own print Function PHP | <p>Is there any way we can create our own print function in PHP so when using it we can do the following</p>
<pre><code>my_print_function "My Content";
</code></pre>
<p>rather than </p>
<pre><code>my_print_function("My Content");
</code></pre>
| php | [2] |
4,844,413 | 4,844,414 | Layout Drawer doesn't add new view in a new line | <p>Hy!!</p>
<p>If i want to add a textview and a textedit, both are in the same line</p>
<p>I have a Linear Layout</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:text="@+id/TextView01"
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:text="@+id/EditText01"
android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</code></pre>
<p>What i have made wrong?</p>
| android | [4] |
1,779,002 | 1,779,003 | Create a new image file from a drawable | <p>I have a problem.
I am selecting an image from the gallery in android and showing it in an imageview.
What I want to do is create another file with another name and copy this image to this file inside a directory in my applications resources.
Can anyone help me please.</p>
| android | [4] |
1,216,505 | 1,216,506 | Drawing app in Android | <p>Can any one Help me how to make drawing app in android in which i can draw line,square etc....?</p>
| android | [4] |
3,200,327 | 3,200,328 | insert two kinds of array in the same table | <p>i have an example here of two arrays from the form,</p>
<pre><code><input type="text" name="children[]" />
<input type="text" name="age[]" />
</code></pre>
<p>my problem is to insert the value above in the same table like</p>
<pre><code>insert into childTable(children,age) values('children[]','age[]')
</code></pre>
<p>it's in the form of array coz i don't know how many children to input..
can u help me to solve this????
any answers will be highly appreciated...thank you!!!</p>
| php | [2] |
4,537,287 | 4,537,288 | Create Globally Unique ID in JavaScript | <p>I have a script that, when a user loads, creates a unique id. Which is then saved in <code>localStorage</code> and used for tracking transactions. Sort of like using a cookie, except since the browser is generating the unique id there might be collisions when sent to the server. Right now I'm using the following code:</p>
<pre class="lang-js prettyprint-override"><code>function genID() {
return Math.random().toString(36).substr(2)
+ Math.random().toString(36).substr(2)
+ Math.random().toString(36).substr(2)
+ Math.random().toString(36).substr(2);
}
</code></pre>
<p>I realize this is a super basic implementation, and want some feedback on better ways to create a "more random" id that will prevent collisions on the server. Any ideas?</p>
| javascript | [3] |
4,623,428 | 4,623,429 | How to make single from multiple element? | <pre><code>l = [{'name': 'abc', 'marks': 50}, {'name': 'abc', 'marks': 50}]
</code></pre>
<p>I want to uniqify the dictionary result.</p>
<pre><code> result = [{'name': 'abc', 'marks': 50}]
</code></pre>
| python | [7] |
4,004,030 | 4,004,031 | JavaScript Max unsigned int 32? | <p>I failed to find any constant in JS language which represents MAX UINT 32
Does it exists? I can have hardcoded the number itself, but i prefer to go in the more appropriate path of coding</p>
| javascript | [3] |
4,583,366 | 4,583,367 | ASP.NET How to use WebConfigurationManager to get section from Specific config file? | <p>I am trying to get sections from specific .config file such like "my.config".
WebConfigurationManager.OpenWebConfiguration can get the web.config in specific path.
Maybe WebConfigurationManager.OpenMappedWebConfiguration can reach my purpose.</p>
<p>Can anyone share experience?</p>
| asp.net | [9] |
2,510,968 | 2,510,969 | WebForms view engine documentation? | <p>I have maybe very very Simple Question:</p>
<p>Where i can find documentation about expressions and syntax of WebForms view engine?</p>
<p>And what is the difference between </p>
<pre><code><%: expression %>
</code></pre>
<p>and </p>
<pre><code><%= expression %>
</code></pre>
<p>?</p>
<p>in advance thanks for reply</p>
| asp.net | [9] |
3,323,159 | 3,323,160 | how to detect tower changes in Android? | <p>Just wanted to know whether its possible to get cell tower changes in Android?
I have seen a event called onCellLocationChanged in PhoneStateListener. Can I use this to detect cell tower changes ? </p>
| android | [4] |
4,027,921 | 4,027,922 | get the servername + foldername (without script name) | <p>how to get the servername + foldername without containing the script name?</p>
<pre><code>string filePath = Request.QueryString.Get("filepath");
string serverPath = Request.ServerVariables["SERVER_NAME"] + "/";
string fullUrl = "http://" + serverPath + filePath;
Response.Write(fullUrl);
</code></pre>
<p>the above code is missing folder name. </p>
| asp.net | [9] |
243,766 | 243,767 | how can I use internal resource (e.g. R.id.myImage01) as an email attachment? | <p>how can I use internal resource (e.g. R.drawable.myImage01) as an email attachment?
I tried the following code. It shows the file is attach but actually the email gets send without any attachment.</p>
<pre><code>Context context = getApplicationContext();
String imagePath = context.getFilesDir() + "/" + "myImage01.png";
emailIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse(imagePath));
</code></pre>
<p>Thanks
Azam</p>
| android | [4] |
1,402,075 | 1,402,076 | java: Error:Could not find or load main class dailyreport.Add_employee | <p>I am working on java.I am getting an error while running a form named '<code>Add_employee</code>' as '<code>Could not find or load main class dailyreport.Add_employee</code>'.I dont know why this error is coming.</p>
<p>Plz can anyone help me to solve the error?</p>
| java | [1] |
213,963 | 213,964 | primitives as function arguments in javascript | <p>I'm learning JS here, and have a question regarding primitive values when passed in as arguments. Say I have a simple function: </p>
<pre><code>var first= 5;
var second= 6;
function func(){
first+=second;
}
func();
alert(first);//outputs 11
</code></pre>
<p>So in this case the value of first becomes 11.. But if I try it by passing in first as an argument to the function, first remains 5..</p>
<pre><code>var first= 5;
var second= 6;
function func(first){
first+=second;
}
func(first);
alert(first);//outputs 5
</code></pre>
<p>wondering if someone could explain this to me.</p>
| javascript | [3] |
3,567,753 | 3,567,754 | How to set multiple PHP classes intoa Debug mode? | <p>What would be the best way to set 10+ PHP classes into Debug mode easily but still keeping the classes non-dependent of other stuff?</p>
<p>If I set a Global Constant then check for it's value inside every class then every class is reliant on this constant being set. Meaning if I try to use the class in another project it is relying on a Constant from another file.</p>
| php | [2] |
4,951,471 | 4,951,472 | PHP URL Generation | <p>I have a set of data being returned to a table using PHP and MySQL and I would like to put a link at the end of this data using elements from the row to build the link with some static elements.</p>
<p>i.e. $urlStart/name-installer-date-email-gno$urlEnd</p>
<pre><code><tr>
<th>Installer Ref:</th>
<th>Fitter</th>
<th>Guarantee</th>
<th>Equipment</th>
<th>Installed</th>
<th>Options</th>
</tr>
</thead>
<?php
$i=0;
while ($i < $num) {
/* $f1=mysql_result($result,$i,"installer"); */
$f2=mysql_result($result,$i,"fitter");
$f3=mysql_result($result,$i,"guarantee_no");
$f4=mysql_result($result,$i,"equipment");
$f5=mysql_result($result,$i,"certificate_no");
$f6=mysql_result($result,$i,"install_date");
?>
<tbody>
<tr>
<td><?php echo $f5; ?></td>
<td><?php echo $f2; ?></td>
<td><?php echo $f3; ?></td>
<td><?php echo $f4; ?></td>
<!-- <td><?php echo $f5; ?></td> -->
<td><?php echo $f6; ?></td>
</code></pre>
| php | [2] |
1,425,940 | 1,425,941 | Iphone URL loading in tableview doubts | <p>My requirement is, I have a main url. It contains multiple urls. I have to display multiple url in a tableview, with the main contents in it including a image. Like facebook status button. If we entered a link in the status textfiled it displays main content of that url.</p>
| iphone | [8] |
5,853,415 | 5,853,416 | .cmd program to read txt file as input and pass the contents as parameters | <p>Please help me on this. I already have a .cmd program that takes input from user( manual entry) as parameters and applies some logic to it.</p>
<p>I would like to automate it, hence take inputs from user into a txt file and need to pass each row of data as parameter to the existing program.</p>
<p>For eg: the first row of data in the .txt file will be like : 10 20 30 2013 10 20 40 2013..</p>
<p>Now each number is a parameter to the program. eg. param1-10 param2-20 and so on...</p>
<p>Is this achievable? Please advise. also please let me know if you need more details on the same.</p>
<p>Thanks.</p>
| c# | [0] |
1,652,556 | 1,652,557 | A random generator for array indices..? | <p>i know this for normal integers, but is there for such a thing as indices</p>
<pre><code>Random Dice = new Random();
int n = Dice.nextInt(6);
System.out.println(n);
</code></pre>
| java | [1] |
3,860,868 | 3,860,869 | How do you get the HTTP status code for a remote domain in php? | <p>I would like to create a batch script, to go through 20,000 links in a DB, and weed out all the 404s and such. How would I get the HTTP status code for a remote url?</p>
<p>Preferably not using curl, since I dont have it installed. </p>
| php | [2] |
1,892,918 | 1,892,919 | Javascript new object reference | <p>what is the correct syntax to create a new instance of the object as opposed to a pointer to the original? Here is my example:</p>
<pre><code>var oItem = { element: null, colIndex: 0 };
var oInputs = { Qty: oItem, Tare: oItem, Rate: oItem, Total: oItem };
for (var oTitle in oInputs) {
oInputs[oTitle].element = ...
</code></pre>
<p>when I set the value of <code>oInputs[oTitle].element</code> for any <code>oTitle</code> it sets the value of them all. I know that javascript passes objects by reference, so I am assuming it's because they are all referring to the same object. I tried this but it is obviously wrong.</p>
<pre><code>var oInputs = { Qty: new oItem, Tare: new oItem, Rate: new oItem, Total: new oItem };
</code></pre>
<p>Thanks in advance.</p>
| javascript | [3] |
2,792,634 | 2,792,635 | Slicing a string repeatedly | <p>Repeated slicing works on tuples and lists just fine:</p>
<pre><code>>>> tuple = ("nav", "yad")
>>> tuple[0]
'nav'
>>> tuple[0][0]
'n'
</code></pre>
<p>But with strings: </p>
<pre><code>>>> name="university"
>>> name[0]
'u'
</code></pre>
<p>The weird thing here is, when I try repeated slicing over string name variable,
there is nothing at <code>name[0][0]</code> or <code>name[0][-1]</code>, so why does it show <code>"u"</code>?</p>
<pre><code>>>> name[0][0]
'u'
>>> name[0][-1]
'u'
</code></pre>
<p>And if something is at <code>name[0][0]</code> then why not on other indexes?</p>
<pre><code>>>> name[0][1]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: string index out of range
</code></pre>
| python | [7] |
3,096,138 | 3,096,139 | Eclipse logcat input interrogation mark | <p>My phone is SAMSUNG galaxyIII with android 4.1*.</p>
<p>I connect pc to check the phone log .</p>
<p>In Eclipse the Input content all be interrogation mark '????'</p>
<p>why this happen?Could someone help me please.</p>
<p>thank you.</p>
<p><img src="http://i.stack.imgur.com/ZJx1I.png" alt="enter image description here"></p>
| android | [4] |
Subsets and Splits