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,846,772 | 2,846,773 | Why JavaScript returns [object Object] from valueOf() instead of [object]? | <p>Is there a specific reason that JavaScript returns [object Object] as a return value from valueOf() method? </p>
<p>Why not only [object] but [object Object] ? </p>
| javascript | [3] |
2,351,591 | 2,351,592 | Is it possible to run a socket server and socket client on the same machine? | <p>In java it is possible to create a socket server and a socket client, is it possible to have an instance of the socket server running and a socket/server client that is receiving data from the socket server on the same machine?</p>
<p>e.g the socket server runs on port 60010
and the socket client is running on the ... | java | [1] |
2,739,877 | 2,739,878 | How to write \t to file using Python | <p>I build one web and user can enter directory path in form.</p>
<p>My program will extract the path and write into one file.</p>
<p>My question is when the path include some special word such as \t \n, the program can't write file correctly.</p>
<p>For example:
C:\abc\test will become C:\abc[TAB]est</p>
<p>How ca... | python | [7] |
4,589,364 | 4,589,365 | What does @Override mean in this java code? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/94361/when-do-you-use-javas-override-annotation-and-why">When do you use Java's @Override annotation and why?</a><br>
<a href="http://stackoverflow.com/questions/4341432/java-what-does-override-mean">Java, Wha... | java | [1] |
533,041 | 533,042 | C# - Protect the App to no abort | <p>My App receives a string from serial port in the format "・99,99999,99999,99999,AAAAAA,AAAAAA" every 6 seconds.
I use these statements to treat the string:</p>
<pre><code> stringOut=stringOut.Replace("-",",");
string[] valor_1=stringOut.Split(',');
int i_C_AR=Convert.ToInt32(lbl_co... | c# | [0] |
821,454 | 821,455 | android code for distancebetween() method | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5845357/distancebetween-two-locations">DistanceBetween() two locations</a> </p>
</blockquote>
<p>I need the code for the android method public static void distanceBetween (double startLatitude, double startLongi... | android | [4] |
5,470,333 | 5,470,334 | Iphone creates symbolic file during crash | <pre><code> Any one help to locate symbolic file.Thanks in advance.
</code></pre>
<p>Regards,
Arunkumar.P</p>
| iphone | [8] |
5,292,705 | 5,292,706 | Getting javascript src location/hostname | <p>Is there any recommended solutions when an embedding a script that will make a callback to the originating source but the js resides in a different domain. Sometimes other clients would be in a different domain and I can't rely on getting the document or window location.</p>
<p>Currently, I've been using this but ... | javascript | [3] |
3,911,930 | 3,911,931 | Modal dialog options | <p>I am opening a window as a modal.
window.showModalDialog("http://www.google.com","","dialogWidth:500px;dialogHeight:500px") </p>
<p>as I set height, what are other options available?
Like option buttons, menus etc. where I can find tutorials?</p>
<p><strong>EDIT</strong></p>
<p><em>It works in Mozilla firefox... | javascript | [3] |
5,438,817 | 5,438,818 | Using PDO for Data Management | <p>This question is more a design oriented question than a code specific question. I am new to PHP and I am planning to use PDO as a data access layer. Say for instance I have a class called CITY. Now if I need to create an instance of this class, what is the best technique. </p>
<ul>
<li>Should have a singleton DB ac... | php | [2] |
3,902,620 | 3,902,621 | shell_exec("start C:\program.exe") does not work | <p>I'm trying to run a .exe file from PHP script. Here is my code:</p>
<pre><code>shell_exec("start C:\program.exe");
</code></pre>
<p>It does not work. PHP is still sleeping, and in the task manager I found the process running but not displayed.</p>
<p>Thanks</p>
| php | [2] |
5,964,989 | 5,964,990 | Custom listview with image in android | <p>I am new in android and i want to do parsing through api and then load the data in the background and then displaying the data of image and text in custom listview, please help</p>
| android | [4] |
5,824,525 | 5,824,526 | How to set my app as default home android? | <p>I'm developing a Android application, and I would like that when it first starts it set itself as default action for Home button.</p>
<p>Currently this option is given to the user by the Android system only when he first press the Home button after running my app.</p>
<p><img src="http://i.stack.imgur.com/EJCB0.pn... | android | [4] |
3,399,521 | 3,399,522 | How to trim extra spaces after the last character in PHP using anyscript | <p>Can u guys help me with a code that eliminates white spaces form the front as well as the back when inserting into my sql back of characters</p>
<p>For Eg: lets say that the word <code>" hello "</code>. Now i want to remove all these space when i enter my data in MySQL so when it gets inserted there are no more... | php | [2] |
5,576,157 | 5,576,158 | softkeyboard doesn't show in landscape mode in android 2.2 and above | <p>i have made app which worked 2.2 and above version.
Softkeyboard is showing in portrait mode.
but Softkeyboard doesn't show in landscape mode.</p>
<p>i can only test it on emulator. </p>
<p>it is showing just like the below link.<br>
<a href="http://stackoverflow.com/questions/4242985/softkeyboard-not-displaying-i... | android | [4] |
1,826,078 | 1,826,079 | Is it possible to access member name from parameter | <p>Please consider this class:</p>
<pre><code>class A
{
public: //public in this example
string a1;
string a2;
string a3;
string a4;
int a5;
double a6;
(...) plus other 50 member names
multiset<string> getAttrib(const vector(A)& va, string attr)
{
for (vector<string>::const... | c++ | [6] |
5,434,696 | 5,434,697 | Create an array from 2 other arrays | <pre><code>$arrayA = Array (
[0] => 1,
[1] => 2,
[2] => 4
)
$arrayB = Array (
[1] => Dog,
[2] => Cat,
[3] => Cow,
[4] => Duck
)
</code></p... | php | [2] |
3,104,050 | 3,104,051 | Execute an .exe from ASP.NET Page using c# | <p>I am working on a web based application. I want to call an .exe from a page. I have added some line of code for this
But when button clicked the Console windows appears and displays an exception saying that -- Unhanded Exception : System.NUllRefrenceException : Object reference not set to an instance of the object.... | asp.net | [9] |
5,770,065 | 5,770,066 | PHP system specific line endings behaviour | <p>I was wondering what does it mean in layman's terms:</p>
<blockquote>
<p>pay attention to line endings - PHP uses a native function to parse the input, so a Mac file won't work on Unix</p>
</blockquote>
<p>An example of what this means will help.</p>
<p>The text can be found here at <a href="http://php.net/get_... | php | [2] |
2,578,934 | 2,578,935 | Can't install Google USB Driver for Windows, r4 | <p>When I try to install the USB driver r4, I get the following error.</p>
<pre><code>Failed to fetch URL http://www.echobykyocera.com/download/echo_repository.xml/addon.xml,
reason: Server returned HTTP response code: 403 for URL:
http://www.echobykyocera.com/download/echo_repository.xml/addon.xml
</code></pre>
<p... | android | [4] |
2,593,979 | 2,593,980 | Variables in Classes | <p>I stumbled across a very wired error in php:</p>
<pre><code>class A {
public $var = "test";
public function __construct() {
$this->var = "test2";
$b = new B;
$b->method();
}
}
class B extends A {
public function method() {
$c = new C;
$c->method();... | php | [2] |
1,506,377 | 1,506,378 | Full Screen Mode of Android Gallery | <p>Do Android Gallery have full screen mode(I mean after clicking on the image of galley I will get the full screen gallery)?</p>
| android | [4] |
1,383,461 | 1,383,462 | How to open a link in a new window with javascript? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1794674/basic-javascript-question-how-to-open-a-new-window">Basic Javascript question: How to open a new window?</a> </p>
</blockquote>
<p>I have such a link wrapped in a div:</p>
<pre><code><div class="spon... | javascript | [3] |
3,419,185 | 3,419,186 | show activity indicator while loading ViewController | <p>I have a ViewController that takes time to load its views. When I run Instruments, I see from the home screen, if I tap on the icon that pushes that view controller onto the stack, it's half laying out the views, and half getting the data for the views. I tried adding an activity indicator to display on the home s... | iphone | [8] |
5,630,886 | 5,630,887 | jquery form submit problem | <p>in some reason if I use this code it sends the form in normal way not with jquery? What could be the problem? thanks</p>
<pre><code><script>
$(document).ready(function(){
$("form#formi").submit(function() {
$(":text, textarea").each(function() {
... | jquery | [5] |
1,820,577 | 1,820,578 | Exploding an array | <p>If I have the string:</p>
<blockquote>
<p>123+0,456+1,789+2,</p>
</blockquote>
<p>I understand I can do the following:</p>
<pre><code>$test = 123+0,456+1,789+2,;
$test = explode(",", $test);
</code></pre>
<p>This creates an array of each section between ','. </p>
<p>How can I then explode the '+' in each part... | php | [2] |
3,343,464 | 3,343,465 | Android - How to convert KeyEvent KeyCode to Char? | <p>I want to get the char value of the KeyCode Event when pressing an Android keyboard.</p>
<pre><code>public void KeyCodeEventAsChar(int keyCode, KeyEvent event) {
char pressedKey;
// TODO: convert key Code Event into char
syslog.d ("TEST", "The pressed key in Android keyboard was char: " + pressedKey);
}
<... | android | [4] |
1,301,972 | 1,301,973 | ASP.NET [Horizontal scroll fro GridView] | <p>how to make an horizontal scroll for my large GridView ?</p>
<p>...exquestion here : <a href="http://stackoverflow.com/questions/2091684/asp-net-fix-gridview-or-detailview">http://stackoverflow.com/questions/2091684/asp-net-fix-gridview-or-detailview</a></p>
| asp.net | [9] |
798,744 | 798,745 | How to read and write to a text file in C++? | <p>Hey everyone, I have just started to learn C++ and I wanted to know how to read and write to a text file. I have seen many examples but they have all been hard to understand/follow and they have all varied. I was hoping that someone here could help. I am a total beginner so I need clear instructions. Here is an exam... | c++ | [6] |
4,729,912 | 4,729,913 | How to send part of a YUV image to a server? | <p>My application grabs a preview frame from the camera in YUV and sends it to a server. I'm trying to change it so it will only send part of the image (a crop) to the server. However I want to loop through the byte array and directly send the cropped image to the server, rather than creating a Bitmap class and cropp... | android | [4] |
3,571,553 | 3,571,554 | Double negation (!!) in javascript - what is the purpose? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/784929/what-is-the-not-not-operator-in-javascript">What is the !! (not not) operator in JavaScript?</a> </p>
</blockquote>
<p>I have encountered this piece of code </p>
<pre><code>function printStackTrace(optio... | javascript | [3] |
5,809,588 | 5,809,589 | add radio button Dynamically : android | <p>i need to add radio button Dynamically , means radio button may be 3 , 4, 5 or 6 and it would be Added Horizontally and one row contains maximum 3 radio button , if there are more then 3 then it would come below of above row of radio button as in grid view , i am stukking here from 2 days but not get yet any solutio... | android | [4] |
5,349,408 | 5,349,409 | Problem with setting activity's theme | <p>I want to display a picture full screen without an action bar in Android tablet, but when I write <code>android:theme="@android:style/Theme_NoTitleBar_Fullscreen"</code> in Android Manifest, it says there is no such resource. How is it possible since it is on the list of themes? Full code of Manifest: <a href="http:... | android | [4] |
3,374,279 | 3,374,280 | How to turn on/off my Android device with an APP | <p>Is there a way to create an Android application to turn on/off the device? The "turn on" part based, for example, on a timer. I would like to know if exists some functions to do this. Thanks for every reply.</p>
<p>Matteo </p>
| android | [4] |
4,834,039 | 4,834,040 | Modifying a form object created by application.run(form1) | <p>I'm new to C# and trying to figure out how to edit a form from another class. The form is created by the default VS approach, as so:</p>
<pre><code>static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
</code></pre>
<p>I'v... | c# | [0] |
3,906,861 | 3,906,862 | Making visible object hidden and hidden object visible | <p>I have a javascript function that is supposed to make visible objects hidden and hidden objects visible. since I lack of basic javascript knowlegde, I came here to ask help from you :/ Can someone help me out with my code so that I can learn a little?</p>
<pre><code>function DisplayMenu(obj) {
if (obj.s... | javascript | [3] |
5,371,247 | 5,371,248 | Replacing window.setTimeout | <p>Guys,
I'm thinking of replacing window.setTimeout with a function of my own (for example we could have a generic error handler for exceptions thrown in callbacks). </p>
<p>The code will be along these lines:</p>
<pre><code>var nativeSetTimeout = window.setTimeout;
window.setTimeout = function(fn, interval){
... | javascript | [3] |
3,396,811 | 3,396,812 | Use cached version of jQuery if recent enough, otherwise download the latest | <p>Can I do the following to shave milliseconds of loading for some users?</p>
<p>Fix a suitable version <code>x</code> of jQuery, say <code>x = 1.4.1</code>, and find the most recent version <code>y</code> of jQuery cached by the user. Then,</p>
<pre><code>if (y > x === true) {
/* Use the cached version y of... | jquery | [5] |
5,857,399 | 5,857,400 | Session variables unset between page content changes | <p>i am using 1 index.php page and using navigation links to send values $_GET values which are used to retrieve page content from mysql database to effectively change the page which is working fine.
On one of the nav links a session variable is set when clicked which i want to use later, but when i click another nav l... | php | [2] |
5,004,748 | 5,004,749 | How to using again string when has explode | <p>I have a sample code:</p>
<pre><code>$string = 'abc def ghi abc des abc xyz';
$arr = explode('abc', $string);
print_r(arr);
</code></pre>
<p>result is </p>
<pre><code>Array (
[0] =>
[1] => def ghi
[2] => des
[3] => xyz
)
</code></pre>
<p>But i want to keep "abc" in ... | php | [2] |
3,993,054 | 3,993,055 | Hover image and show it next to the cursor | <p>I would like to know if there is a way to show the same image as you are hovering, with a different size, next to the cursor? And on mouseout, it should disappear. </p>
| jquery | [5] |
3,706,508 | 3,706,509 | find which view was clicked | <p>I have a view controller where there are several uiview object. I need to know on which uiview user have tapped. how is this possible? any guidance will help a lot....</p>
<p>Thanks<br>
Pankaj</p>
| iphone | [8] |
4,996,914 | 4,996,915 | Unique items in python array | <p>Is the below if condition correct.I am trying to make a uniques list of dates in the array.So if the date is not present in the array then add it to the array</p>
<pre><code>timestamps= []
timestamps = ['2011-02-22', '2011-02-05', '2011-02-04', '2010-12-14', '2010-12-13', '2010-12-12', '2010-12-11', '2010-12-07', ... | python | [7] |
2,072,210 | 2,072,211 | How to condense multiple for loops with different initial values | <p>In a function, I have several consecutive for loops with the same code but different initial values for the control variable. The initial values are obtained from inputs to the function. Ie,</p>
<pre><code>void thisFunction( class A a){
//some other code
for (int i = a.x; i != 0; --i){
code
}
for (int... | c++ | [6] |
1,828,680 | 1,828,681 | how to add multiple css classes to a html element usin javascript | <p>I want to add multiple classes to an html element </p>
<p>I know the following code is possible.</p>
<pre><code>$("ul#List").find("li.template")
.removeClass("template")
.addClass("entry")
</code></pre>
<p>But i want to know if the following code is also possible.?</p>
<pre><code>$("ul#Li... | javascript | [3] |
2,072,890 | 2,072,891 | Which website I should develop for learning asp.net? | <p>I have worked with window based application in .net. But I want to learn asp.net. So I want to develop one website such that developing that website I can get best and better knowledge of asp.net. And developing that website all most important concepts and controls are covered in that website. And in that website al... | asp.net | [9] |
4,692,509 | 4,692,510 | showing DateTime in simple format? | <p>i have a column in my database that stores DateTime, now i want to show time in simple format,
you know it will appear like : <code>12/26/2011 9:39:55 PM</code></p>
<p>but i want to show it in persian.</p>
| asp.net | [9] |
4,329,718 | 4,329,719 | Keyevent callback only gets called after inserting . (dot) or space , custom keyboard usage | <p>I have the following problem with a custom keyboard in my application</p>
<p>the callback</p>
<pre><code>public boolean onKey(View v, int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
char receivedChar = ' ';
if (event.getAction() == 0) {
// Load keyboard device dependent map
... | android | [4] |
3,976,608 | 3,976,609 | I need a function to display only numbers AND insert dot after three digits | <p>I am building a form, and I need a function to: display <code>###.###.###-##</code> I also need one to display <code>##.###.###-#</code> and another to display <code>#####-###</code></p>
<p>I managed to add a mask onkeypress to display the format I need, but still I cant figure out how to allow numbers only AND add... | javascript | [3] |
4,674,633 | 4,674,634 | Confused on which one to to use - Linq to SQL, Datasets or Ado.Net Data entity model? | <p>I'm a pretty descent old school ASPNET developer i.e I still use Visual studio 2005 & webforms to build websites.</p>
<p>But with all the recent MVC hype I decided to get a copy of VS 2010 express and get aquainted with 'New school' ASPNET development.</p>
<p>I have always relied on datasets to build my n-tier... | asp.net | [9] |
455,265 | 455,266 | Testing to see if a text string is part of a variable | <p>I'm setting a variable to the contents of a h1 tag on my site. I want to write an if statement which tests to see if there is a specific word inside that h1 tag. I need to set a dropdown based on the title of the form.</p>
<p>So, I have this html.</p>
<pre><code><div id="booking-details"><h1>This is Lo... | jquery | [5] |
3,971,465 | 3,971,466 | How to workaround same origin problem | <p>The following JS will fail if the URL in mainFrame from <strong>a.abc.com to b.abc.com</strong>.</p>
<p>top.frames["mainFrame"].location.href = "/Users/xuenn.aspx?backUrl=" + top.frames["mainFrame"].location.href.split("?")[0];</p>
<p>This is the error message:
Permission denied for <a href="http://a.abc.com" rel=... | javascript | [3] |
761,536 | 761,537 | Detect pic taken in Android using Tasker app | <p>I am trying to detect when a picture is taken, as a trigger (to also make a picture of the photographer)</p>
<p>Tasker has a trigger for the Hardware Camera button, but my phone (Galaxy Nexus) has only software buttons.</p>
<p>Any ideas? I was thinking of using the trigger Action -> File modified, and then point t... | android | [4] |
5,295,069 | 5,295,070 | PHP file writing problem | <p>I'm trying to write to a file in PHP to cache the output of a small portion of code.</p>
<pre><code> ob_start();
echo "Hello";
$fp = fopen("cache/ttcache.php", 'w');
fwrite($fp, ob_get_contents());
fclose($fp);
ob_end_flush();
</code></pre>
<p>The file exists and is blan... | php | [2] |
1,935,265 | 1,935,266 | mina2.0.4 NioSocketConnector in android | <p>There is no problem when I use the mina in java project.But in android, when I want to use it to connect the server
IoConnector connector = new NioSocketConnector();
it shows "Could not find class 'org.apache.mina.transport.socket.nio.NioSocketConnector', referenced from method com.mina.client.MinaClient.connect"<... | android | [4] |
2,380,653 | 2,380,654 | add value to array in for loop will not work, why? | <p>Take a look:</p>
<pre><code>for ($i=1; $i<=$nr_of_pics; $i++) {
${'image_src' . $i} = $image_id.'_'.$i;
$img_array = imageSize(${'image_src' . $i}, $i, $category);
}
</code></pre>
<p>and here is the imageSize function (simplified):</p>
<pre><code>$myarr = array();
$myarr['thumb_image_' . $n... | php | [2] |
4,026,058 | 4,026,059 | Increase in number of requests form server cause website slow? | <p>In My office website,webpage has 3css files ,2 javascript files ,11images and 1page request total 17 requests from server, If 10000 people visit my office site ...
This may slow the website due to more requests??
And any issues to the server due to huge traffic ??</p>
<p>I remember My tiny office server has</p>
<... | asp.net | [9] |
3,133,433 | 3,133,434 | How to use the multiplication symbol | <p>I have a JavaScript code and I am blanking out right now. I can't remember how to use the multiplication symbol "X". This code here is an example, but is using the addition symbol. Can anyone show me how to replace the addition symbol with the multiplication symbol? I know it's probably a real easy fix.</p>
<pre><c... | javascript | [3] |
2,715,996 | 2,715,997 | finding dynamic control | <p>I have Telerik grid control, there I have an edit control like update and cancel buttons and so on.</p>
<p>The edit controls are shown automatically when I edit image click, no manual coding used to invoke the controls. Therefore my problem is I have to validate the input control when I update button click. The con... | jquery | [5] |
3,695,862 | 3,695,863 | Array initialization problem | <p>I have the following code:</p>
<pre><code>var intrebari = new Array();
var i = 0;
intrebari[i]['enunt'] = 'test';
alert(intrebari[i]['enunt']);
</code></pre>
<p>The problem is that when I run it it says that <code>intrebari</code> is undefined. Why?</p>
| javascript | [3] |
2,333,523 | 2,333,524 | How to create dir on interenal storage if external is unavailable | <p>I am creating a DIR from my app when app first time run.Here is the code for this</p>
<pre><code> if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
Log.d("MyApp", "No SDCARD");
} else {
File directory = new File(Environment.getExternalStorageDirectory()+File.separator+"MyCon... | android | [4] |
2,630,225 | 2,630,226 | Dynamically set value of onClientClick | <p>I have a DataGrid template that correctly outputs a picture of a phone in each of my rows. When the user clicks the phone, I would like to display the phone number to the user, either through an alert box or through a jquery dialog. </p>
<p>I currently have:</p>
<pre><code><asp:ImageButton runat="server" ImageU... | asp.net | [9] |
5,964,874 | 5,964,875 | JavaScript -recommended testable pattern | <p>I read about 2 JavaScript testable patterns, but I am not sure how they differ and which one should I use.</p>
<p>Pattern 1:</p>
<pre><code>function class () {
this.propertyA = null;
this.methodA = function() {
alert('');
}
}
var object = new class();
object.methodA();
</code></pre>
<p>Patter... | javascript | [3] |
3,348,350 | 3,348,351 | how does a php application actually run? | <p>Fairly new to web-programming and programming in genral.</p>
<p>In c/c++, the code is all compiled into an exe and run once. The user(s) interact with it and according decisions made by the compiled code that is running, it outputs relevant information.</p>
<p>But in web(php), the users cannot point and click or u... | php | [2] |
3,626,626 | 3,626,627 | java implementations? | <p>i've been looking at shoootout alioth benchmarks <a href="http://shootout.alioth.debian.org/" rel="nofollow">http://shootout.alioth.debian.org/</a>,
there is mention of two different "java"'s what is the difference between them?</p>
<p>(java xint and java server)</p>
<p>i know a little bit of java (learned in a su... | java | [1] |
4,880,662 | 4,880,663 | Android API Version programmatically | <p>I am trying to retrieve the current API Version of the device my Application is Running. Is there a way i can get that and Store it on a String. This needs to Work on 1.5 Version and Up. Examples would be greatly appreciated. Thank you.</p>
| android | [4] |
4,698,028 | 4,698,029 | Tap event with only javascript | <p>Do you know a an JS event/function for taping without using any plugins? I have to style my menu when is tapped.</p>
| javascript | [3] |
3,839,254 | 3,839,255 | Hiding TR's - Borders Being Included | <p>Simply doing something along the lines of</p>
<pre><code>$("tr.myclass").hide();
</code></pre>
<p>will hide the relevant rows. However, if I have a border against the td's contained within that tr, then they still show after the tr has been hidden. Therefore, the original table has a 1px border on the bottom of ... | jquery | [5] |
1,243,834 | 1,243,835 | javascript ternary statement equivilance | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5817578/javascript-is-z-xy-same-as-z-xxy-for-non-boolean">JavaScript: Is “z=(x||y)” same as “z=x?x:y” for non-boolean?</a> </p>
</blockquote>
<p>Are the following two lines of code equivalent in javascript?</p>
... | javascript | [3] |
4,012,817 | 4,012,818 | iPhone code forUIImageViewControllerPickerSourceTypeCamera | <pre><code>- (IBAction)pickAndDecode:(id) sender {
UIImagePickerControllerSourceType sourceType;
int i = [sender tag];
switch (i) {
case 0: sourceType = UIImagePickerControllerSourceTypeCamera; break;
case 1: sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; break;
case 2: sourceType = ... | iphone | [8] |
843,554 | 843,555 | How to keep looping till a function returns? | <p>I am using a C++ graphics library which has functions <code>void WaitForMouseDown()</code> and <code>void WaitForMouseUp()</code>. The WaitForMouseDown function waits until the mouse button is pressed and then returns. WaitForMouseUp waits for the button to be released.
There is another function in the library <cod... | c++ | [6] |
4,674,553 | 4,674,554 | Executing java code given in a text file | <p>I have a set of java code in a text file. Is it possible for me to read line by line from the text file and execute the commands as in eval function of javascript? Thanks in advance</p>
| java | [1] |
2,984,648 | 2,984,649 | PHP "Enter code to win" Solution reading a simple .txt file | <p>I want to create a competition. I'm not good with php but can see this could be the only way to do it. I would like to create a script using a simple one field form where the customer enters a code and when they click submit it will look at a text file and any matching results will be returned with a congratulations... | php | [2] |
4,936,162 | 4,936,163 | What does this code do? | <pre><code>#ifndef INFINITY
#ifdef _MSC_VER
union MSVC_EVIL_FLOAT_HACK
{
unsigned __int8 Bytes[4];
float Value;
};
static union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}};
#define INFINITY (INFINITY_HACK.Value)
#endif
</code></pre>
<p>I'm currently getting start... | c++ | [6] |
4,978,255 | 4,978,256 | Webview duplicate HTML problem | <p>I load a url over the web containing images (their source is another
url).
when then view loads the html, it loads it without the images. after
few milliseconds, the images come along but then the html is redrawn,
and it does so over the previous html, causing it the web view to hold
2 htmls one over the other (very... | android | [4] |
3,032,991 | 3,032,992 | Android: problem sending email with attachment from my application | <p>My application allows users to create and modify files. I would like them to be able to send a file as an email attachment. So, I need to first create and write to a temporary file, which I then attach to the email. And then I would like to delete the temporary file when the email program finishes. Unfortunately... | android | [4] |
4,309,665 | 4,309,666 | Video Encoding Problem | <p>All I want is to put some video to my server and play it in my application. I tried many of 3rd party applications to change video encoding. None of them works. Please, any ideas?</p>
| android | [4] |
2,651,575 | 2,651,576 | simple java, using substring | <p>i was practicing some java problems and this one got me stuck. </p>
<blockquote>
<p>given an "out" string length 4, such as "<<>>", and a word, return a
new string where the word is in the middle of the out string, e.g.
"<>". Note: use str.substring(i, j) to extract the String
starting at index i a... | java | [1] |
3,456,751 | 3,456,752 | Image resize with jquery | <p>need jquery image resize, like if image width > 400 then use resize width:50%, other images that is smaller size like 100X100 dont need to be resized. </p>
<p>I use this code</p>
<pre><code>var max_size = 400;
$(".comment p.message a.fancy img").each(function(i) {
if ($(this).height() > $(this).width()) {
... | jquery | [5] |
5,344,594 | 5,344,595 | "PHP Style" development with ASP.NET? | <p>I'm learning ASP.NET (slowly), trying to avoid WebForms entirely, but I'm finding MVC, ORMs, EF, and all the rest a little bit overwhelming. I am quite solid with HTML, HTTP, CSS, C# and the BCL.</p>
<p>I have a tiny bit of experience with PHP (ewww), but I've found it to have the deployment and convenience advanta... | asp.net | [9] |
430,680 | 430,681 | How to use JQuery .each( ) to iterate through 47 divs? | <p>I have a basic understanding of how .each() works based on whats in the jquery docs, but I dont really understand how I can apply it to something that has a large amount of elements. I have a map I made using SVG. currently each section of the map lights up on a onmouseover function. </p>
<pre><code> $('.shape... | jquery | [5] |
199,448 | 199,449 | Where to put the external JAR files? | <p>I am working with the Eclipse IDE and I know how to use an external JAR. I know how to add them in to build path. I am getting the perfect output in eclipse but when I navigate to the bin folder of eclipse where <code>.class</code> file is located in the command prompt, when I use the command </p>
<pre><code>java M... | java | [1] |
57,308 | 57,309 | idictionary help filtering items | <p>Is there a better way to code the <strong>Where</strong> this:</p>
<pre><code> IDictionary<string, string> p = new Dictionary<string, string>();
p.Add("Apple", "1");
p.Add("Orange", "2");
p.Add("Pear", "3");
p.Add("Grape", "4");
p.Add("Pineapple", "5");
//This is a unique list... | c# | [0] |
3,854,792 | 3,854,793 | footer View issue in android | <p>Hello
In my android app when the no of items in the list is small the footer sticks to end of the list like the one shown below.
<img src="http://i.stack.imgur.com/ALHtm.png" alt="alt text"></p>
<p>but not to the end of screen.
Is there any way that i can stick it to the bottom of the screen.
I am using a seperate... | android | [4] |
2,108,418 | 2,108,419 | C# foreach only get distinct values | <p>I have the following code:</p>
<pre><code>foreach (Logs log in _logsDutyStatusChange)
{
string driverid = log.did;
}
</code></pre>
<p>How would I only add distinct driver ID's to the driverid string?</p>
<p>Thanks</p>
| c# | [0] |
290,300 | 290,301 | Re-installation failed due to different application signatures - Released app | <p>My app is released and being used. I moved the development folder from my E: drive to C: drive and updated the various links to the libraries. Works great, but when I try and push it to the phone that has the previous version I get the above error.</p>
<p>As this is released I don't want the users to have to unins... | android | [4] |
3,396,597 | 3,396,598 | How can I do take a substring and length of a string in C# if that string might be a null? | <p>I have the following strings:</p>
<pre><code>var temp = null;
var temp = "";
var temp = "12345678";
var temp = "1234567890";
</code></pre>
<p>What I need to do is if have a function that will give me the last four digits of the input variable if the input variable is 8 or 10 characters long. Otherwise I need it to... | c# | [0] |
1,468,056 | 1,468,057 | how to keep zero decimal place for zero? | <p>I used:</p>
<pre><code>Result_TextBox.Text = result.ToString(".#######"); //result is double
</code></pre>
<p>But if the result is 100.0000000, it becomes 100. What should I use in order to keep the accuracy of 7 decimals place? </p>
<p>I tried: </p>
<pre><code>Result_TextBox.Text = Math.round(result, 7); //... | c# | [0] |
5,801,505 | 5,801,506 | display URL Name same as whatever Travels Package selected by user | <p>I am developing a Travels website in asp.ne. for that I need to display URL Name same as whatever Travels Package selected by user.</p>
<p>What I have to do.
I have to design a separate Form for each Travels Package. or i can do another way.</p>
<p>Please give me your advise how to do this</p>
| c# | [0] |
5,589,642 | 5,589,643 | Error in my Java Program '.class' expected | <pre><code>class TwoDimArryAlloc {
public static void main(String[] args) {
int itemno[][] = new int[][] { {2234,2235,2236,2237,2238} , {3334,3335,3336,3337,3338} };
int it;
String itemdesc[][] = new String[][] {{"Womans Item1","Womans Item2","Womans Item3","Womans Item4","Womans Item5"},{"... | java | [1] |
1,185,085 | 1,185,086 | Transform InputStream to FileItem in Java | <p>How can I do to transform from InputStream to FileItem in Java?</p>
<p>Thanks.</p>
| java | [1] |
2,268,859 | 2,268,860 | Difference between new and operator new in C++ | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1885849/difference-between-new-operator-and-operator-new">Difference between 'new operator' and 'operator new'?</a> </p>
</blockquote>
<p>What is the difference between using new and operator new... | c++ | [6] |
4,151,283 | 4,151,284 | How are prototype functions different than normal functions in javascript ? | <p>Javascript functions can be declared on a objects prototype like this:</p>
<pre><code><object name>.prototype.<variable name>=function(){
//
//
}
</code></pre>
<p>How it this different than following declaration?</p>
<pre><code><object name>.<variable name>=function(){
//
//
}
</code></pre... | javascript | [3] |
208,454 | 208,455 | Why are objects passed by value modified as if they are passed by reference? | <p>For example,</p>
<pre><code> class Age
{
public int Year
{
get;
set;
}
public Age(int year)
{
Year = year;
}
}
class Person
{
public Age MyAge
{
get;
set;
}
public Person(Age age)
{
age.Year = ( age.Year * 2 );
MyAge = a... | c# | [0] |
2,292,549 | 2,292,550 | Add additional data to array | <p>I have associative array which looks like this.</p>
<pre><code>$arr = array(
"FIRST" => 1,
"SECOND => 2,
"FOURTH => 4
);
</code></pre>
<p>The idea is how to "add" data to this array depending of expression.
Here is what I'm trying to do:</p>
<pre><code>if(3 == 3) {
$str = array("THIRD" => 3... | php | [2] |
3,890,522 | 3,890,523 | setTimeout in a loop and pass variables to use later | <p>Consider the following code:</p>
<pre><code>function func() {
var totalWidths = 0;
for( var i = 0, count = arr.length; i < count; i++ ) {
var image = arr[i];
insertElemInDOM(image);
preloadImage(image,function(){
var w = image.width();
totalWidths += w;
... | javascript | [3] |
3,992,410 | 3,992,411 | click links though javascript | <p>Am looking for how to click links on my page using javascript. In my page i show each record from my database . and a 'show' link to the right clicking it will expand and display the row in detail. i want to expand all the rows at once . Is it possible to click link in Javascript like this?</p>
| javascript | [3] |
3,086,204 | 3,086,205 | How do i fix a unexpected T string? - PHP | <p>My script comes on with an unexpected t string on line five how do i fix this?</p>
<pre><code><?php
include_once("../scripts/config.php");
$url = mysql_real_escape_string('$_POST['url']'); // LINE 5!
preg_match("/id=(\\d+)/", $url, $matches);
$like = $matches[1];
$current_pop = mysql_query("SELECT pop FROM li... | php | [2] |
3,215,800 | 3,215,801 | Thread Handlers stop working on orientation change | <p>I've got a Thread parsing XML in the background of my app. As it does so, it updates a progress bar in the activity's view via a Handler. This works fine until the phone changes orientation (and probably during other destructive actions, like multitasking, though I haven't throughly tested there). After any number o... | android | [4] |
2,627,306 | 2,627,307 | PHP Codeigniter Class model not found | <p>I am trying to connect mssql and codeigniter and the result is:</p>
<p><strong>Fatal error: Class 'Pekerja_model' not found in C:\xampp\htdocs\CodeIgniter\system\core\Loader.php on line 188</strong></p>
<p>This my code<br>
<br>Model</p>
<pre><code>class Pekerja_model extends CI_Model {
function SomeMSSQLMod... | php | [2] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.