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,627,865
2,627,866
The this keyword and double question mark (??) confuse me
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/446835/what-do-two-question-marks-together-mean-in-c">What do two question marks together mean in C#?</a> </p> </blockquote> <p>Is this a new feature added to C# 3.x ?</p> <p>e.g </p> <pre><code>public class H...
c#
[0]
3,401,034
3,401,035
Create an iframe on button click with jquery?
<p>i have the following code</p> <pre><code>var url = "url"; $('&lt;iframe /&gt;', { name: 'frame', id: 'frame', src: url }).appendTo('body'); </code></pre> <p>but when i click the button, nothing seems to happen</p>
jquery
[5]
2,620,933
2,620,934
Noobie Jquery Question
<p>I've been working with Jquery fro a grand total of two hours now. Up until this point I have made this really simple FAQ page.</p> <pre><code>&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#void").click(function(event) ...
jquery
[5]
4,650,901
4,650,902
How to add scroll bar to the Relative Layout?
<p>I am new to the android app development now i am designing an app,in that i have an activity which is containing some content but these content is some what more so the content is out of the screen now i wanna show that content to the user,but i dont knw how to keep scrollers to the activity.Please help me that how ...
android
[4]
341,744
341,745
how to replace ul with new ul
<p>how do i use jquery to replace what I have in the first ul with what I have in the second ul?</p> <pre><code>$('li').each(function() { alert($(this).text()); //so far this is what I have which alerts me with all the li's text. }); </code></pre> <hr> <pre><code>&lt;ul&gt; &lt;li&gt;apple&lt;/li&gt; &lt;li&...
jquery
[5]
853,058
853,059
form validation self study
<p>please help. I'm not asking you to create the program just please tell me what I'm missing. This is for self studying. I am trying to make a javascript program that would do this: 1. alert user if no name or email had been created 2. email data must contain an @ sign and at least one dot (.). Also, the @ mus...
javascript
[3]
3,391,879
3,391,880
How do I display foreign languages in my php file
<p>When I try to display letters of a foreign languages in my php file they show up as "?".</p> <p>Anybody have any ideas how I can display them properly?</p> <p>If I save the file as a HTML it displays the letter properly.</p>
php
[2]
1,647,677
1,647,678
What does tt & 0 stands for in this line?
<p>What does tt &amp; 0 stands for in this line?</p> <pre><code> Time = string.Format("{0:HH:mm:ss tt}", DateTime.Now); </code></pre> <p>I looked here but didn't see anything : <a href="http://msdn.microsoft.com/fr-fr/library/system.string.format.aspx" rel="nofollow">http://msdn.microsoft.com/fr-fr/library/system.str...
c#
[0]
3,848,287
3,848,288
Forward slash in a JavaScript variable
<p>I have the code below.</p> <pre><code>{ var custname= "@1"; var file = "c:/temp/"+ custname + ".txt"; var fso = new ActiveXObject("Scripting.FileSystemObject"); var fh = fso.CreateTextFile(file, true, false); fh.Write(text); fh.Close(); } </code></pre> <p>The @1 is coming from a database a...
javascript
[3]
352,867
352,868
Javascript: Convert a String to Regular Expression
<p>I want to convert a string that looks like a regular expression...into a regular expression.</p> <p>The reason I want to do this is because I am dynamically building a list of keywords to be used in a regular expression. For example, with file extensions I would be supplying a list of acceptable extensions that I w...
javascript
[3]
637,987
637,988
Closed BufferedReader()?
<p>I've written a code that reads web pages and transfers them into a .txt file. The problem is that the output file (something.txt) is LOCKED (I use OS X if that helps). I figured out that there could be a problem with unclosed BufferedReader(), but it seems closed. Thanks.</p> <pre><code>PrintStream ps = new PrintSt...
java
[1]
3,149,055
3,149,056
Declaring a string globally in C#
<p>In the below rough sample code of C# I have to declared a string in condition and I am unable to access it out of that brace</p> <pre><code>if(//some condition) { string value1 = "something"; } //push to database value1 </code></pre> <p>In the above code compiler says <code>The name 'value1' does not exists in the...
c#
[0]
5,238,638
5,238,639
Problem with the innerHTML the content of a DIV
<p>For some reason, I can't change the contents of a DIV in either IE or Firefox. Any ideas where I might be going wrong?</p> <p>JavaScript</p> <pre><code>function displayTable() { document.getElementById('retailerDiv').innerHTML = '&lt;a&gt;HEY!&lt;/a&gt;'; } </code></pre> <p>HTML</p> <pre><code>&lt;input type="...
javascript
[3]
4,477,733
4,477,734
jQuery effect selector now and in the future WITHOUT an event
<p>Here is an example usage, of what I am trying to do:</p> <pre><code> $('img.switchToPng').each(function(){ currentSRC = $(this).attr('src'); $(this).attr('src', currentSRC.substr(0, currentSRC.length -3) + 'png'); }); </code></pre> <p>Later using ajax a new <code>&lt;img src="path/image.jpg" alt="...
jquery
[5]
1,291,741
1,291,742
Alternative for fflush(stdin)?
<p>Is fflush(stdin) is really required in C++ and is it good to do it this way to flush the newline in the buffer?</p>
c++
[6]
5,758,139
5,758,140
How to Play Video on OnCreate Method?
<p>How to Play Video on OnCreate Method? I Used Following code for that.But The Video is Not Played.If i used this Code on Click Event of Button then This is Worked.</p> <p>My OnCreate Method:-</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCo...
android
[4]
1,673,967
1,673,968
Python: libc fallocate returns with failure
<p>I am trying to fallocate a tempfile, but unfortunately the following code returns -1 (failure):</p> <pre><code>import ctypes, tempfile from ctypes import * t_file=tempfile.NamedTemporaryFile(delete=True, dir=".", prefix="temp_file_") libc=cdll.LoadLibrary("libc.so.6") libc.fallocate(t_file.fileno(), c_int(0), c_l...
python
[7]
1,084,344
1,084,345
display number on iphone icon
<p>I want to display numbers on icon of iphone application</p> <p>Please see reference file.<br> <a href="http://c.upanh.com/upload/7/291/VK0.11503211_1_1.jpg" rel="nofollow">http://c.upanh.com/upload/7/291/VK0.11503211_1_1.jpg</a></p> <p>how can I do?</p> <p>Thank you!</p>
iphone
[8]
3,723,687
3,723,688
how do i implement session timeout in iPhone?
<p>example if the user is idle for a predefine period? </p>
iphone
[8]
4,365,928
4,365,929
Number of String objects created
<p>How many String objects will the following code produce?</p> <pre><code>String s1="Hello"; //"Hello" is in String Pool Object #1 String s2 = s1.substring(2,3);//String object #2 String s3 = s1.toString(); String s4 = new StringBuffer(s1).toString(); //String Object #3 </code></pre> <p>This is the question to one p...
java
[1]
451,070
451,071
Why does the sun jdk source code not contain the javax.servlet package?
<p>I tried to find the source code of the javax.servlet package in the jdk source code, but it seems the jdk doesn't contains the package. Where can I download the package?</p>
java
[1]
3,482,232
3,482,233
How to delete values from an array in PHP?
<p>I need to delete the first 29 values of an array. I searched and there doesn't seem to be any built in PHP function that allows for this. How can this be done then?</p>
php
[2]
2,810,093
2,810,094
Compact dictionary key lookup
<p>Is there a way to write this more compact ?</p> <pre><code>return _searchRedirectionMap.ContainsKey(query) ? _searchRedirectionMap[query] : ""; </code></pre> <p>Givent that <code>_searchRedirectionMap</code> is defined as a <code>IDictionary&lt;string,string&gt;</code> </p>
c#
[0]
1,619,714
1,619,715
Message sent using invalid number of digits. Please resend using 10 digit number or valid short code android 9230 in android
<p>I am creating application in which we reply to sender of the text message automatically from our android device. I had check that number has only digits not letters for validation but some times while sending message it gives me error as:</p> <p>Message sent using invalid number of digits. Please resend using 10 di...
android
[4]
3,692,255
3,692,256
Relative URL's/paths in php
<p>Hi this is the first time I am asking a question here.</p> <p>I have a image src as</p> <pre><code>src="images//images/pixel.gif" </code></pre> <p>But I dont understand this double forward slashes (<strong>//</strong>) in the src. </p> <pre><code>src="./images/pixel.gif" src="../images/pixel.gif" </code></pre...
php
[2]
1,040,582
1,040,583
Choerent header-counter on all sub-pages #jQuery
<p>Hi just a general question (don't have any code for this): is it possible to make counter that is effected by actions on different pages? For example, If I have a header with a counter, and on each sub-page there is a button "A", the value will be added when the button is pressed on each page, and the value that is ...
jquery
[5]
4,755,119
4,755,120
creating new python objects seems to be the same object
<p>I have a problem with objects.</p> <p>The following code</p> <pre><code>class Data: def __init__(self,data=[]): self.data = data def add(self,data): self.data.extend(data) class Parent: def testa(self): a = Data() a.add('a') print a.data def testb(self): ...
python
[7]
5,797,440
5,797,441
How to convert timestamp to format "hh:mm:ss"?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/847185/convert-a-unix-timestamp-to-time-in-javascript">Convert a Unix timestamp to time in Javascript</a> </p> </blockquote> <p>I have timestamp "12312312123". How to convert timestamp to format "hh:mm:ss" usin...
javascript
[3]
1,347,929
1,347,930
Why does “$temp = 0; echo ~$temp;” print -1?
<p>Can anybody tell the internal procedure of the below code</p> <pre><code>&lt;? $temp = 0; echo ~$temp; ?&gt; //instead of 1 it displays -1 </code></pre>
php
[2]
5,745,566
5,745,567
java.io.File.toURI() IO bound?
<p>I'm profiling J2EE application responsible for storing binary files on disk. During profiling, we've discovered a great deal of IO bottlenecks, which we have a plane to address. However, we've also seen slowdown on this line of code:</p> <pre><code>// Example URI path String filename = "/path/to/file.txt" // T...
java
[1]
2,298,613
2,298,614
Highlighting text strings on page using getElementById
<p>I am new to JavaScript. I am facing a problem with my javascript code. I am trying to use the string replace method to highlight the searched text. But it's not working. I must be making some mistake. Or may be I am going for the wrong method. Please help. Here is my code:</p> <pre><code>&lt;html&gt;&lt;head&gt; &l...
javascript
[3]
5,108,957
5,108,958
how to insert xml element, serial number automatically
<p>i used the following code to save data in xml,</p> <pre><code>var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "codedata.xml"); XmlDocument doc = new XmlDocument(); if (!System.IO.File.Exists(path)) { Xml...
c#
[0]
2,238,328
2,238,329
File writing is not completed in java
<p>I am trying to write to a text file contentiously, but I am not getting a correct output file.</p> <p>My code is as follows:</p> <pre><code>for (int p = 0; p &lt;= noiter; p++) { long startTime = System.currentTimeMillis(); // Initialization and Usage Checking try { Date dt = new Date(); ...
java
[1]
1,307,178
1,307,179
Simple Java Scanner issue
<p>I haven't been doing Java long. In this script where it says Thread.sleep(10000); you can still type (I use eclipse) I really don't know why it enables you to type in the output when I have no uno.nextLine(); before or after the 10 second waiting. Please help! Thanks</p> <pre><code>import java.util.Scanner; class T...
java
[1]
3,214,875
3,214,876
Return true, return false when using switch
<p>I'm trying to get a switch to return true or false, but I seem to be failing somewhere. I keep getting false. I'm totally lost. This should have worked actually. How do I get this right?</p> <pre><code>if (validNum(1)) {echo 'Ok';}else{echo 'Fail';} function validNum($x) { switch ($x) { case 1: echo "Number 1"; ...
php
[2]
1,048,556
1,048,557
PHP Dynamic Sprite Creation
<p>I've a site where users upload images and I'm displaying lots of images from users back to users. Most of the images are JPG but some are PNG.</p> <p>I use manually created sprites for the images I have created myself but current user images are downloaded individually which adds time to page load.</p> <p>I've don...
php
[2]
1,436,777
1,436,778
Android. How to insert image in text
<p>Actually I have TextView with some text. I need to insert an image insight this text. Please suggest the best way to do that. Should be supported on different display sizes.</p>
android
[4]
4,142,433
4,142,434
pointer return by new check in C++
<p>What is the best way to check the pointer return by a <code>new operator</code> I see following type of code. Assume I have <code>class Test</code></p> <p>Type 1</p> <pre><code>Test *ptr = new Test; if ( ptr == NULL ) { } </code></pre> <p>Type 2</p> <pre><code>Test *ptr = new Test; if ( !ptr ) { } </code></pre> ...
c++
[6]
4,216,093
4,216,094
Add dir to List DirectoryInfo
<p>how to add new directory to List </p> <pre><code>public static List&lt;DirectoryInfo&gt; Directory = new List&lt;DirectoryInfo&gt;(); Directory.Add("C:\\test"); // error 'string' to 'System.IO.DirectoryInfo' </code></pre>
c#
[0]
4,897,852
4,897,853
c# "\xC0\x80" sent as C0 3f ... Odd problem cant figure out the solution
<p>I have a very interesting problem. One to which i have yet to be able to find an answer. the code as follows</p> <pre><code>Console.WriteLine("\xc0\x80"); Console.WriteLine(Encoding.GetEncoding(1252).GetString(new byte[] { 0xC0, 0x80 })); Console.WriteLine( Encoding.GetEncoding(1252).GetString(Encoding.GetEncoding(...
c#
[0]
3,503,437
3,503,438
Javascript regex to replace HTML FONT Tag
<p>I have a html string like <code>&lt;FONT id="test" face="Arial"&gt;&lt;SPAN&gt;&lt;P&gt;This is some content...&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;</code>. Now using javascript regex I want to remove the font tag with id test and the span tag with their associated closing tags.</p> <p>So that the output becomes <co...
javascript
[3]
5,899,241
5,899,242
Cross dependencies without forward declaring all used functions?
<p>I have class A (in A.h) which depends on class B in (B.h) and vice versa. Forward declaring the used functions works, but this means I have to update everywhere where I forward declared those functions in the future, ex, if I remove, or change argument in those functions they must all be updated to reflect change. I...
c++
[6]
1,404,828
1,404,829
How to split my treeview single row into 2 r 3 rows in ASP.NET (Web Application)
<p><strong>EXAMPLE:</strong> some bla bla goes here</p> <p>1.Kalaiselvan(<strong>Parent node</strong>)</p> <p>1.1 kalai is from india and he lives in tamilnadu(1988-2011),klaisewkkladslh kjkhlghjg khkgl.</p> <p>1.2.scales related to single book some thing goes like that and huge text goes here</p> <p>2.kannan(Paren...
asp.net
[9]
3,711,853
3,711,854
How to display the contents of a PDF document using pdfbox in Android
<p>I want to use <code>PDFbox</code> to read and display the contents of a PDF document. I can extract the text from the PDF document using <code>PDFTextStripper</code>.</p> <p>My problem is how can I display all the contents in PDF document as it is? I want to display the PDF document like it is displayed in the appl...
android
[4]
4,161,718
4,161,719
$('img').load() firing too soon
<p>I'm trying to get some images' aspect ratios using their load() methods.</p> <pre><code>$('img').load(function(){ alert(this.src); alert($(this).width()); setAspectRatio(this); }); </code></pre> <p>(this.src) tells me what I expect to hear. ($(this).width()) gives me 0.</p> <p>I found this in the docu...
jquery
[5]
3,331,737
3,331,738
In Java, is new always new?
<p>Is there any way in Java that a statement like</p> <pre><code>Thing thing = new Thing(); </code></pre> <p>could <em>not</em> result in a new object being created (i.e. any way that <code>thing</code> could end up pointing to an already-existing object)? </p>
java
[1]
2,381,257
2,381,258
How to install multiple In-house apps
<p>I'm developing a website to deploy my android applications. Users can select multiple android applications from the android app list from the website and when they click download, all the applications have to install to the phone one by one. Check All the applications at once - Click Download - Then all the applicat...
android
[4]
548,650
548,651
How to wait for particular function to complete for starting next function? Without using thread in C#
<p>I have two functions.</p> <pre><code>Function1(varName); Function2(); </code></pre> <p>called in same sequence. Here String <code>varName</code> is assigned by another function call which is in thread.</p> <p>But here I want Funtion2 to complete before another value is assigned to varName (Funtion1 is called).</p...
c#
[0]
219,478
219,479
How to link a static library conditionally in visual studio
<p>I'd like to link my code to a static library conditionally, that is depending on a compilation flag.</p> <p>Is there anyway I can do that in C++?</p>
c++
[6]
5,698,924
5,698,925
How can i show locaion information without using MapAnnotation pin?
<p>I am new in this Topic.I know map annotation and by clicking on that annotation pin i get the information about that particular place but i want to display all that information without that annotation pin so how it is possible Actually i have searchbar on the top and i will give city name and i get the Detail infor...
iphone
[8]
3,153,795
3,153,796
Resize a DIV based on Mousewheel spin
<p>i am trying to "resize" a called "view" based on the mouse wheel spin.<br> For down spin the size should be decreased and for up spin the size should be increased. I don't have any idea to do it. Please someone help me to achieve it.<br> Here is my HTML code.. </p> <pre><code>&lt;div class="main"&gt;&lt;div cla...
jquery
[5]
4,595,647
4,595,648
Convert array of any type to List<T> (C#)
<p>The function below accepts an object, which can sometimes be an array of a given type. In this case, I suppose the type could be determined with obj[0].GetType(), assuming the array has at least one member. I would like to convert such an array to a generic List&lt;T&gt; of appropriate type, but the code below only ...
c#
[0]
3,877,694
3,877,695
Access level user For Buttons in the forms
<p>I Want Set Access level user For Buttons in the forms. example in the each form i have Add , Edit ,search and Delete button and I want user1 access to delete and update button in the form 1 and user 2 access to all buttons in each forms.</p> <p>i create Table for Save Forms Name and Create other Table for Save Use...
asp.net
[9]
1,371,878
1,371,879
Can't use a class as template type in another class?
<p>I have a class Stack, using template, one of its methods is "push", which is written below:</p> <pre><code>template &lt;class T&gt; void Stack&lt;T&gt;::push(T _data){ Node&lt;T&gt;* temp = new Node&lt;T&gt;; temp-&gt;data = _data; temp-&gt;next = head; head = temp; } </code></pre> <p>The stack wor...
c++
[6]
4,561,087
4,561,088
Android sdk in Eclipse
<p>I installed the Android sdk and Eclipse Indigo on windows 64 bit. But when i started Eclipse to start a new project, i could not see Android Project under Android folder.</p>
android
[4]
5,622,826
5,622,827
When to use AtomicReference in Java?
<p>When do we use AtomicReference. Is it needed to create objects in all multithreaded programs. Can you provide a simple example where AtomicReference should be used.</p>
java
[1]
1,954,520
1,954,521
Finding minimum value in an array of dicts
<p>I have an array like the following:</p> <pre><code>people = [{'node': 'john', 'dist': 3}, {'node': 'mary', 'dist': 5}, {'node': 'alex', 'dist': 4}] </code></pre> <p>I want to compute the minimum of all the 'dist' keys. For instance, in the above example, the answer would be 3.</p> <p>I wrote...
python
[7]
1,084,937
1,084,938
Sending email through Gmail SMTP using PHP
<p>I have following system setup</p> <ul> <li>Windows XP Service pack 2</li> <li>WAMP 2.0 </li> <li>PHP 5.3</li> </ul> <p>I've configured my <code>php.ini</code> file with the following:</p> <pre><code>smtp=smtp.gmail.com smtp_port=25; </code></pre> <p>and my PHP code is</p> <pre><code>&lt;?php mail('alagar.pa...
php
[2]
1,350,168
1,350,169
Unicode File Reading By Bytes in C#
<p>Anybody can help me with the code (in a function, so I will call it) to read an unicode file </p> <p>(ex : I want to read a unicode file starting from 0 bytes, will be read until 500 bytes, putting the characters it on a variable)</p> <p>Please help me! Thank you</p> <p>I'm using Visual C# 2010</p>
c#
[0]
3,710,319
3,710,320
C# method lines program
<p>I need method of lines, so that when you have method call <code>Rows (4)</code>, a method prints four blank lines.</p> <p>This is my code but it wont work, tell me what is wrong?</p> <pre><code>namespace something { class Program { static void Main(string[] args) { Console.Write("give number...
c#
[0]
4,550,346
4,550,347
howto change a value in a TimerTask wichout crashing because of a other thread in android?
<p>i posted a question (<a href="http://stackoverflow.com/questions/10136620/how-to-change-something-in-a-new-timertask-action-in-android/10136688#10136688">here</a>) about how to change UI elements in a timer task, this is fine now.</p> <p>but when i have a code like this:</p> <pre><code> countInt = 0; ...
android
[4]
1,527,938
1,527,939
What does String* mean in C#?
<p>What does <code>String*</code> mean in C#?</p> <p>I've seen this used in code examples but I can't derive from the context, and you can't search on this, due to the * being accepted as a wildcard in every search engine ever.</p> <p><hr /></p> <p>EDIT: Looks like it wasn't C#, which explains it. The specific code...
c#
[0]
2,926,730
2,926,731
How to remove part of a string before a ":" in javascript?
<p>If I have a string "Abc: Lorem ipsum sit amet", how can I use javascript/jQuery to remove the string before the ":" including the ":". For example the above string will become: "Lorem ipsum sit amet".</p> <p>Thanks</p>
javascript
[3]
4,291,763
4,291,764
tracking scrolling offset of a fixed div from top of window
<p>So i have a long scrolling 1page website with a fixed navigation bar.</p> <p>With this navigation bar I would like to track its <code>.offset().top</code> so I may add or remove classes based on the offset from the top of the window.</p> <p><a href="http://www.designobvio.us/para" rel="nofollow">Live code link</a>...
jquery
[5]
4,806,792
4,806,793
khtml2png php no output
<p>I have installed khtml2png and run it via command line and it works great but when I run it from php in the browser it does not. I guess its the a permission issue but not sure? I am not getting any errors.</p>
php
[2]
810,856
810,857
jQuery undocumented function?
<p>right click on an element : ( <strong>no</strong> using plugins)</p> <p>I saw an answer like this :</p> <pre><code>$('#hello').bind("contextmenu",function(e){ //contextmenu ?? alert('Right Clickz'); return false; }); </code></pre> <p>I've searched all jquery site and didnt find the <code>contextmenu</c...
jquery
[5]
5,609,590
5,609,591
how can replace the font style in php using preg_replace
<p>I need help, i was get the value from database that contain html tag also like below</p> <pre><code>&lt;span style="font-size:medium;border:1px solid #e4e4e4"&gt;Test value&lt;/span&gt; </code></pre> <p>also same font family,font style and etc... i need to remove all the <code>font property</code> from that tag us...
php
[2]
2,351,420
2,351,421
When declaring a variable in C++/C
<p>When I declare a variable, such as:</p> <pre><code> int x = 6; </code></pre> <p>What exactly is <code>x</code>? an address in the memory is usually hexadecimal..<br> Also, when I'm calling X</p> <pre><code>x = 2; </code></pre> <p>How does the compiler know where <code>x</code> is? <code>x</code> isn't an address...
c++
[6]
2,378,602
2,378,603
How to apply jquery datepicker on duplicate id's in same form?
<p>I have a complex code where I need to clone same tables on dynamic call and have to apply date picker on them.The problem is that there will be duplicate id's on which I am willing to apply date picker.So, when I apply date picker,it comes and I can select only current date using Enter key.But,when I use mouse it t...
jquery
[5]
4,674,334
4,674,335
Why does Javascript use JSON.stringify instead of JSON.serialize?
<p>I'm just wondering about <em>"stringify"</em> vs <em>"serialize"</em>. To me they're the same thing (though I could be wrong), but in my past experience (mostly with <a href="/questions/tagged/asp.net" class="post-tag" title="show questions tagged 'asp.net'" rel="tag">asp.net</a>) I use <code>Serialize()</code> and ...
javascript
[3]
4,754,427
4,754,428
How to write long IF more prettier?
<p>I have long IF:</p> <pre><code>if(rand(1, 100) == 22 &amp;&amp; $smth &lt; time() &amp;&amp; $smths &gt; 5 &amp;&amp; $sxsxsx &gt; 250 &amp;&amp; !$_SESSION['false']) { echo "wow, big if just happened!"; } </code></pre> <p>How to write it more "prettier"? </p>
php
[2]
593,434
593,435
event target is button clicked true jquery
<p>How can I accomplish something like this:</p> <pre><code>function (e) { if(e.("#this_button_is_clicked").true) {//then do this} }); </code></pre> <p>?</p> <p><strong>EDIT:</strong></p> <pre><code> $("body").click ( function (e) { if (e.target.className !== cls || e.target.click("#bU...
jquery
[5]
3,326,136
3,326,137
Which standard Java collections are remove-safe during iteration?
<p>Using <code>for(Type x:collection){...}</code> which widely used collection types make removing <code>x</code> safe during iteration?</p> <p>And is there a technical term for this to look out for in the JavaDocs?</p> <p><strong>Clarification:</strong></p> <p>I initially only asked about using the for-each syntax ...
java
[1]
5,575,676
5,575,677
MMs code for android
<p>How to Attach video file to my application , and how to show video in videoview ? have any idea about send sms with attached videofile means(mms) in android? if possible , any body give me the Sample code about it??</p>
android
[4]
2,572,796
2,572,797
general javascript
<p>i havent written in js in awhile and am a bit rusty apparently. trying to understand the following problem. the alert in <code>getCurrentPosition successCallback</code> shows the latitude correctly, but the last line alerts <code>undefined</code>. why isnt my client_location function returning the latitude when c...
javascript
[3]
2,784,606
2,784,607
How can I split a string in C++
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/236129/how-to-split-a-string">How to split a string?</a> </p> </blockquote> <p>I have a string like this.</p> <pre><code>a1,b1,a2,b2...... </code></pre> <p>I want a vector of strings like this</p> <pre><code>...
c++
[6]
5,894,340
5,894,341
jQuery hide future matched element
<pre><code>&lt;div class='my_class'&gt;&lt;/div&gt; &lt;div class='my_class'&gt;&lt;/div&gt; &lt;div class='my_class'&gt;&lt;/div&gt; &lt;div class='my_class'&gt;&lt;/div&gt; jQuery('.my_class').hide(); jQuery('.some_other_class').live('click', function(){ // some other stuff that puts in another div with class 'my_cl...
jquery
[5]
1,690,623
1,690,624
'ASP.default_aspx' does not contain a definition for 'DS_Filtering' and no extension method
<p>I'm getting the error below after enabling <code>SqlDataSource</code> filtering event on <em>default.aspx</em>.</p> <blockquote> <p>'ASP.default_aspx' does not contain a definition for 'DS_Filtering' and no extension method</p> </blockquote> <p>Am i missing anything? </p> <p>Please help</p>
asp.net
[9]
5,752,510
5,752,511
How do I disable proguard for building my Android app?
<p>It used to be that proguard was controlled by project.properties, but that's no longer the case, and the Android documentation has not been updated. The project.properties file now clearly states that the it is generated by Android Tools and changes will be erased. I've tried commenting out the proguard.config line,...
android
[4]
4,602,039
4,602,040
I want to remove the row if that row's <td> contains only B in my below code?
<p>Please check the below code. Here i'm deleting the row, if that row td contains the value "B". But bellow code is removing all rows.</p> <p>jQuery</p> <pre><code>$(document).ready(function() { $("#mytable tr td:contains('B')").parent().remove(); }); </code></pre> <p>HTML</p> <pre><code>&lt;table border="0" a...
jquery
[5]
2,952,035
2,952,036
DimensionMismatchError: exp, dimensions were (s^-1)
<p>I writing a program with brian simulator and i get this error :</p> <p><code>DimensionMismatchError</code>: exp, dimensions were (<code>s^-1</code>) </p> <p>The line that I am getting the error is : </p> <pre><code>I=(Vt-El)/ (1-(exp(-(S.spiketimes[0][i-1]_S.spiketimes[0][i])/tau_a))) </code></pre> <p>I can't un...
python
[7]
1,989,485
1,989,486
Emulate Array Objects
<p>Question from Object-Oriented JavaScript book: <strong>Imagine Array() doesn't exist and the array literal notation doesn't exist either. Create a constructor called MyArray() that behaves as close to Array() as possible.</strong></p> <p>I thought it would be a good challenge to test my skills. This is what I came ...
javascript
[3]
989,998
989,999
PHP Strange behaviour of foreach
<p>I've a code:</p> <pre><code>$csv = file('some.csv'); foreach($csv as $value) { echo $value; } </code></pre> <p>Everything is OK until the request method was POST - then the last element of an array is missing (thought it's showing properly by print_r($csv)).</p> <p>What may the problem be? That's the WHOLE C...
php
[2]
5,945,605
5,945,606
Need opinions on variable query build up
<p>I'm trying to build up some functions to variably build up queries from arrays. And i need to know whether i'm actually doing it correctly. Right now i'm wondering if this function to build a variable "WHERE" is okay, or should be improved.</p> <p>Any opinions / tips are appreciated.</p> <pre><code>private functio...
php
[2]
4,922,009
4,922,010
jquery datepicker not working with jsp page without html tags
<p>i am trying to use a jquery datepicker in a jsp page with no html.</p> <p>// all imports using link and script for jquery</p> <pre><code>&lt;h:form id="formid"&gt; &lt;t:div id="datepicker" forceid="true" class="demo"&gt; &lt;f:view&gt; &lt;h:outputText value="Select date" /&gt; &lt;h:inputText id="datepicker"/&gt...
jquery
[5]
5,288,336
5,288,337
jQuery insert link
<p>Trying to append some text in jQuery to convert it into a link for a tree style file browser.</p> <p>jQuery:</p> <pre><code> $(document).ready(function() { var listView = $('div.tree ul'); $('div.tree &gt; ul &gt; li').each( function() { var newLink = document.createElement('a'); ...
jquery
[5]
4,894,792
4,894,793
regarding saving values in database in android
<p>I am creating a sample application using shared preference.I have 3 edittext,2 Buttons,I want to save data in database of android stimulator.How can i do it.Can anybody tell me.Thanks in advance......</p>
android
[4]
1,580,161
1,580,162
jScroll is buggy?
<p>I have implemented <strong>jScroll</strong> plugin from <a href="http://www.wduffy.co.uk/jScroll/" rel="nofollow">here</a> </p> <p>If you go to view <a href="http://projekt6.netboss.dk/" rel="nofollow">my project</a> you will notice that the shopping cart and category section is not entirely shown (or even not show...
jquery
[5]
1,661,268
1,661,269
system property is null even if it is defined in command line
<p>I am debugging a problem in a large system. I was able to locate the problem in a rather basic java feature - the application is started with the -D option to specify some system properties. During run-time though, said properties are not set and their values are null.</p> <p>Trying to reproduce the issue I created...
java
[1]
2,618,095
2,618,096
keybd_event
<p>I need the key code for <code>ctrl+alt+del</code> in c#, for example </p> <pre><code>const int KEYEVENTF_KEYUP = 0x2; const int KEYEVENTF_KEYDOWN = 0x0; keybd_event(0x11, 0, KEYEVENTF_KEYDOWN, 0); keybd_event(0x41, 0, KEYEVENTF_KEYDOWN, 0); keybd_event(0x11, 0, KEYEVENTF_KEYUP, 0); keybd_event(0x41, 0, KEYEVENT...
c#
[0]
4,195,833
4,195,834
Make variable available to other callbacks
<p>I would like to make a variable available to the other callback functions :</p> <pre><code>$(function(){ $("#home_sec_2 img").attr("id", function (arr) { return arr; }); $('#home_sec_2').on('mouseover','img',function(){ position = $(this).position().left; var $ll = $(this).prev()...
jquery
[5]
2,911,345
2,911,346
how to switch activity through animation, consider all activity have separate layout
<p>Actually i have three activities, and i show these activity in tabs.That means i can switch from one activity to another using tabs.</p> <p>Now here if i want to switch activity through animation, then how that can be done, because if i use view flipper then all activity should be in same layout.But in case case al...
android
[4]
3,299,956
3,299,957
How to Enumerate a generic List<T> without know the type
<p>I am passing a generic list to a function , i want to enumerate the objects in the list. If i able to enumerate items in list i will use reflection to the rest.</p> <pre><code> var Items= new List&lt;String&gt;(){"s1","s2"}; Enumerate(Items); void Enumerate(object items) { //i know the type so i can ...
c#
[0]
1,021,049
1,021,050
How to add code behind manually on asp.net
<p>I have a website on the IIS but it has only the aspx file. Now I need to add the code behind for some pages. How do I go about this?</p> <p>I've been trying to add the attribute "codebehind" and "autoeventwireup" on the top of the aspx file but no luck (the page_load event is not being called). Also, if I double cl...
asp.net
[9]
997,819
997,820
"image element".onerror method called when not expected
<p>relevant javascript source:</p> <pre><code> var e=o3('img'); e.className="c";e.name="bo_im";e.src=b.href+'favicon.ico';e.onerror=i3d(e); function i3d(a){a.src='http://www.archemarks.com/favicon1.ico';} </code></pre> <p>what about</p> <pre><code>e.onerror=function(a){a.src='http://www.archemarks.com/favicon1....
javascript
[3]
3,383,432
3,383,433
Javascript - overriding new Date() behavior to offset GMT
<p>I'm developing a website that uses Comet to transmit data back to web clients. My application is very time sensitive, I have a graph displaying points added every second.</p> <p>Since the web application is Comet driven there is no real need for the client to handle dates, it should only use the server timestamp to...
javascript
[3]
2,264,242
2,264,243
Get child tagname of an element
<p>I want to get the child tag name of an element.</p> <p>HTML:</p> <pre><code>&lt;div class="element"&gt; &lt;h1&gt;title&lt;/h1&gt; &lt;/div&gt; &lt;div class="element"&gt; &lt;img src="http://2.bp.blogspot.com/-ma66w8WJsZ0/UBVcmt3XS4I/AAAAAAAAAWw/4UyVd2eR8A0/s1600/olympic-logo.thumbnail.jpg" /&gt; &lt;/div...
jquery
[5]
4,464,418
4,464,419
Connection completed till Linkpoint
<p>After connecting to link point i am unable to get the error messge that the transaction is wrong .What should i do in order to get that eror message.How to write response using curl Actually i had wriiten curl function as given below</p> <pre><code> $url='connection to link point'; $po...
php
[2]
2,802,737
2,802,738
Rookie C# problem
<p>I am a rookie to C# and here is my question</p> <hr> <pre><code>class myClass { int start; int end; ....... } class program { public void main() { myClass[] a= new myClass[10]; for (int i = 1; i &lt; a.length; i++) { myClass b = new myClass(); a...
c#
[0]
142,759
142,760
Trouble iterating Generic list with custom object
<p>Here's the code:</p> <pre><code> ProductList products = xxx.GetCarProducts(productCount); List&lt;CarImageList&gt; imageList = new List&lt;CarImageList&gt;(); foreach(Product p in products) { string imageTag = HttpUtility.HtmlEncode(string.Format(@"&lt;img src=""{0}"" alt=""""&gt;", ImageUr...
c#
[0]