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,598,059
2,598,060
php - regexp - multi match result
<pre><code>string string {format mat=34/} string string string string string string string string string string {format mat=34/} string string string string string string string string </code></pre> <ol> <li><p>$pattern = "/{format[a-z0-9=\s]*\/}/i";</p> <p>str_replace($pattern, 'test', $strings);</p> <p>it will replace all formats in string, i want to replace only first "format", and remove all another "format". How ? </p></li> <li><p>when get match result is "{format mat=34/}". i want to find string begin with "mat=".</p></li> </ol> <p>So i have this </p> <pre><code>$string = "{format mat=34/}"; $pattern = "/^mat=[0-9]*/"; // result is null $pattern = "/mat=[0-9]*/"; // ok, but also effect with "{format wrongformat=34/}" </code></pre> <p>How to match string that begin with "mat="</p>
php
[2]
1,208,144
1,208,145
Interview query. 'Difference between a php abstract and interface class'
<p>I'm not sure that this question is in the correct place. If not can someone move it there?</p> <p>Should all php developers know how to answer this question correctly in a technical interview? </p> <p>What is the difference between a abstract and interface class. What weight should it be given? I always thought this question was more suited for java developers.</p>
php
[2]
1,910,475
1,910,476
Multiple Types of in app purchase
<p>I want to know is it possible to have multiple types of in app purchase in my app.</p> <p>For example: can I have non consumable &amp; subscription based product in my app?</p> <p>Thanks in advance.</p>
iphone
[8]
2,558,361
2,558,362
C# : Implicit conversion between '<null>' and 'bool'
<p>I got a weird error message when I tried to convert an <code>object</code> to <code>bool</code>, here is my code:</p> <pre><code>public partial class ModifierAuteur : DevExpress.XtraEditors.XtraForm { public ModifierAuteur(object getKeyDecesCheckBox) { decesCheckBox.Checked = getKeyDecesCheckBox == null ? null : (bool)getKeyDecesCheckBox; } } </code></pre> <p>and this is the error message :</p> <blockquote> <p>Type of conditional expression cannot be determined because there is no implicit conversion between <code>&lt;null&gt;</code> and <code>bool</code></p> </blockquote>
c#
[0]
3,484,355
3,484,356
asp.net validation control is not working after publishing
<p>I have a web app using validation control such requiredvalidator. When I run it from VS 2008 directly, it worked perfectly (validated the missing input). But the moment I published it to IIS, it does not validate it anymore..</p> <p>any ideas?</p> <p>thanks</p>
asp.net
[9]
2,378,523
2,378,524
how to Play movie in portrait mode
<p>Can i play movie in portrait mode?If yes than how to play?</p>
iphone
[8]
5,612,673
5,612,674
jquery: pass an object to event handler using jquery trigger method
<p>Following code for passing an object to event handler is not working: </p> <pre><code>$('a.another').live('click', function(e, data) { alert(data); // **alerts '[{isMachineClick:true}]'** alert(data.isMachineClick); // **alerts 'undefined'** }); $('a.another').trigger('click', "[{isMachineClick:true}]"); </code></pre> <p>Please have a look at this.</p> <p>PS: solution provided at link <a href="http://stackoverflow.com/questions/3686949/pass-an-object-through-jquery-trigger/">pass an object through jquery trigger</a> is not working, so posting a new thread.</p>
jquery
[5]
4,282,781
4,282,782
Gigantic arrays
<p>I'm planning to store gigantic arrays into serialized files and read from them in order to display data within them. The idea is to have a simple, document-oriented, filesystem database. Can anyone tell me if this would be a performance issue? Is it going to be slow or very fast?</p> <p>Is it worth, filesystem is always really faster? </p>
php
[2]
689,223
689,224
Storing a set of arrays of different types
<p>As a matter of interest, lets say I have the following class:</p> <pre><code>class Data { public: template&lt;class T&gt; std::vector&lt;T&gt; getData(std::string&amp; dataName); private: ... }: </code></pre> <p>So the class stores a set of vectors of any type. Each vector has a name and I know its type when retrieving it. What container might I use to store this data within the Data class? A <code>std::vector&lt;std::pair&lt;std::string,std::vector&lt;T&gt;&gt;&gt;</code>?</p> <p><strong>UPDATE</strong>:</p> <p>I will also need to iterate over this class and the items must be in the same orders as I added them.</p> <p>For example, I might have:</p> <pre><code>ownerNames: std::vector&lt;std::string&gt;; ipAddress: std::vector&lt;char&gt;; </code></pre> <p>in my store. So when I iterate I need them in this order.</p>
c++
[6]
1,774,139
1,774,140
PHP improve a simple if/else statement
<pre><code>&lt;?php echo isset($areas['footer']) ? $areas['footer'] : null; ?&gt; </code></pre> <p>Any way to improve that?</p>
php
[2]
2,694,167
2,694,168
Saving out a javascript object?
<p>Is it possible to save out some javascript object purely on client-side?</p> <p>My question come from the following workflow: a user enters and posts a text, i do some processing on the server side and return processed text to the user. The user can do some modifications to the returned text, if he doesn't like some processed parts of it. Is there any client-side javascript functionality so the user pressed the button 'save' and it pops a save file dialog as if the user downloaded this file from a server? Or I need a server interaction for example to post the results and return them to the users as a file?</p>
javascript
[3]
1,754,022
1,754,023
Encrypting app.config File
<p>I have an app.config file that I need to distribute with my application. It was created because of a Service Reference to an ASMX web service I added. </p> <p>It isn't a huge deal if this file is modified/viewed, but I still would like to make it secure. I already check the hash of the config and make sure it is valid, but I still want an added layer of protection.</p> <p>Here is my config: <a href="http://pastie.org/private/zjdzadnfwrjvwkmlbdsqw">http://pastie.org/private/zjdzadnfwrjvwkmlbdsqw</a></p> <p>So is there anything in there that I can encrypt or anything?</p>
c#
[0]
5,594,887
5,594,888
android : I need a scrollbar to the activity without affecting the lists
<p>I'm using 2 lists in the my activity, and I have to add scroll bar but I need to see all the elements in my lists.</p> <p>if I put all the elements in scrollbar , I can see only the first element of the list. If I put the elements of my activity in linearlayout I can't scroll anymore to see the other elements below the list.</p> <p>thx 4 ur suggestions.</p>
android
[4]
4,612,295
4,612,296
how to call a function when auto_ptr is a parameter of it!
<pre><code>#include &lt;iostream&gt; #include &lt;memory&gt; class test { private: int x , y; public: test(int a , int b):x(a),y(b){} void fun() { std::cout&lt;&lt; x&lt;&lt;" "&lt;&lt;y&lt;&lt;" "&lt;&lt;std::endl; } }; void show(std::auto_ptr&lt;test&gt; t1) { t1-&gt;fun(); } int main() { show(new test(3,4)); } </code></pre> <p>I am getting a compilation error , please tell me what's wrong in this code?Thanks in advance.</p>
c++
[6]
2,047,107
2,047,108
database example in android
<p>I am new to android.I want to have a sample code program of saving database in sd card of android..Can anybody guide me...</p> <p>Thanks in advance Tushar </p>
android
[4]
2,435,299
2,435,300
Timezone issue - android
<p>I'm trying to get the timezone in android </p> <pre><code> Calendar cal = Calendar.getInstance(); TimeZone tz = cal.getTimeZone(); System.out.println("timezone = " + tz.toString()); </code></pre> <p>I should be getting</p> <pre><code>sun.util.calendar.ZoneInfo[id="Europe/London",offset=0,dstSavings=3600000 ..... </code></pre> <p>But when i print in ddms i get the below value</p> <pre><code>org.apache.harmony.luni.internal.util.ZoneInfo@9e54425b </code></pre>
android
[4]
5,894,452
5,894,453
Asp.Net set Visibility of Dropdown list inside gridview in aTemplate Field
<p>I have a Gridview with Template field</p> <pre><code>&lt;asp:TemplateField HeaderText="Scoring"&gt; &lt;ItemTemplate&gt; &lt;asp:DropDownList ID="ddlY_N_NA" runat="server" Visible='&lt;%#Eval("IsTextBox")%&gt;' &gt;&lt;/asp:DropDownList&gt; &lt;asp:TextBox ID="txtAudit" runat="server" Visible='&lt;%#Eval("IsTextBox")%&gt;' &gt;&lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>I need to set the visibility of drop down based on the visibility of Textbox. Either of the two has to be shown per row but not both. Can any help me in this.</p> <p>Thanks in advance.</p>
asp.net
[9]
2,968,135
2,968,136
How to read text and images from this URL?
<p>How could i read the text from this url for each row and the images.</p> <p>And the populate a row for each item. Populating the images in a imageview and the text in a text view?</p> <p><a href="http://www.movieweb.com/movies/2011/week" rel="nofollow">http://www.movieweb.com/movies/2011/week</a></p>
android
[4]
998,074
998,075
Clean way of creating list of hours
<p>I'd like to create a list of hours that is a tuple of the 24-hour based time (in a digit) and a string representation of a 12-hour based time.</p> <p>The format would be like this:</p> <pre><code>[(0, "12 AM"), (1, "1 AM), ..., (13, "1PM"), ... ] </code></pre> <p>I was able to get something like this</p> <pre><code>hours = [(0,"12 AM")] hours += [(hour,str(hour) + " AM") for hour in range(1, 12)] hours += [(12,"12 PM")] hours += [(hour+12,str(hour) + " PM") for hour in range(1, 12)] </code></pre> <p>But I feel that there is a cleaner way of doing this, but can't figure it out.</p>
python
[7]
4,571,669
4,571,670
Executing a function if a script crashes in between
<p>I have a script that takes quite a long time to execute. Is there a way to run some code or call a function in case for example the user closes the window while the script is still running? Ideally I would like to run code to set a status as failure in the database.</p>
php
[2]
4,392,006
4,392,007
Persistent delayed jobs queue for Java
<p>I'm looking for an existing system to replace an existing slow and complicated self written mechanism of job management. The existing system:</p> <ul> <li>1 MySQL DB with a long massive table of jobs - the queue</li> <li>Multiple servers (written in java) all extracting jobs from the queue and processing them</li> <li>a job might NOT be deleted from the queue after processing it, to rerun it later</li> <li>a job might create other jobs and insert them to the queue</li> </ul> <p>The limitations:</p> <ul> <li>As more and more jobs are created and inserted in to the queue, it takes longer to extract jobs from it. (The jobs are chosen by priority and type) - create a bottle neck</li> </ul> <p>I'm looking for an existing system that can replace this one, and improve it's performance. Any suggestions?</p> <p>Thanks</p>
java
[1]
4,828,101
4,828,102
Global.asax page ? In Asp.net?
<p>In web application [asp.net] shall we write code that can retrive data from datbase or insert something in database. in any event of global.asax. when i am writing code in "Application_BeginRequest" even like :</p> <p>Session["abc"]= 10; it is throwing exception that session can't declare some thing.Session state is not available in this context.</p>
asp.net
[9]
5,755,651
5,755,652
How to combine variable with string value
<p>I want to combine variable with string value in (ofstream) file path </p> <p><strong>Example:</strong></p> <pre><code>long phNumber; char bufPhNumber[20]; ofstream ifile; cout &lt;&lt; "Phone Number: "; cin &gt;&gt; phNumber; itoa(phNumber,bufPhNumber,20); ifile.open("c://" + bufPhNumber + ".txt",ios::out); // error in this line </code></pre> <p>How to combine this variable (bufPhNumber) with that strings ( "c://" + variable here + ".txt" )</p>
c++
[6]
4,291,211
4,291,212
Why do I need "out" with string in c#?
<p>I know string is a value type in c#. I understand everything in c# are passed by value</p> <p>But if its value type anyway there is no need 'out' or 'ref' ?</p>
c#
[0]
6,009,655
6,009,656
Is there any option to block messages of a specific person without blocking him from calling?
<p>Is there any option to block messages of a specific person without blocking him from calling in android phones.? also, will sender be able to know that he is blocked on calling/messaging to the phone in which he is being blocked?</p>
android
[4]
232,146
232,147
fetching date and time into excel sheet through c#
<p>I am exporting a label's text field into an excel sheet. The problem is that when i export the date and time from the label's text field it is shown as '#' in that excel sheet. How can I convert it into normal date time Here is my code</p> <pre><code>myrange.cells[6,1]=label1.text.Tostring(); </code></pre> <p>myrange is the object to my excel application</p> <p>Please help</p>
c#
[0]
2,889,635
2,889,636
ERROR PROMPT: Object reference not set to an instance of an object
<pre><code>public static string GetCurrentEmployeeName() { return db.Employees.SingleOrDefault( c =&gt; c.NTUserName == CurrentUsername() ).Last_First; } </code></pre> <p>There's no NULL data.</p>
c#
[0]
4,687,445
4,687,446
how to send sms using clickatell with source code
<p>how to send sms using clickatell with source code</p>
java
[1]
2,822,759
2,822,760
Is !$page == false or $page in php?
<p>I saw the following code which uses if ($page!==false). What are the differences if I use if ($page)?</p> <pre><code>if($id){ // check that page exists $page=dbRow("SELECT * FROM pages WHERE id=$id"); if($page!==false){ $page_vars=json_decode($page['vars'],true); $edit=true; } </code></pre> <p>Thanks in advance.</p>
php
[2]
304,781
304,782
ASP.net hosting problems
<p>I was desperately trying to upload a mvc 2 .net 4 application at hosting provider.. Initially it didnt work. I noticed unexplained behavior that i need some explanation.</p> <p><strong>Problem 1</strong> Even after deleting bin ,web.config and everything application was still there it was working. It wasnt browser cache thing as i deleted everything and response time from server was current time.</p> <p><strong>Problem 2</strong> I noticed that through a proxy server returned error then. Like cache was per ip ?! Response wasnt cached as time was current.No session variable and identical requests returned different responses (only different ip)</p> <p><strong>Problem 3</strong> Changing something and publishing again the app via ftp , either application didnt work at all or it had the previous version. I noticed that visiting the site from another ip , or after some time fixes the problem. </p> <p>What should i do ??? It is IIS6.0 and routing worked only when i added .aspx at each controller... But with .mvc didnt work or server didnt updated the project....</p>
asp.net
[9]
5,778,882
5,778,883
How to install server JRE in windows7 64 bit?
<ol> <li><p>I downloaded server-jre-7u21-windows-x64.tar.gz from the link</p> <p><a href="http://www.oracle.com/technetwork/java/javase/downloads/server-jre7-downloads-1931105.html" rel="nofollow">http://www.oracle.com/technetwork/java/javase/downloads/server-jre7-downloads-1931105.html</a></p></li> <li><p>Unzipped the .gz file and got file server-jre-7u21-windows-x64 without extension.</p></li> <li><p>I tried to install it by just double click. But unable to install?</p> <p>Can anybody suggest me how to do this?</p></li> </ol>
java
[1]
5,853,510
5,853,511
line-separated to ucwords in js
<p>Does anybody knows how to transform <strong>name1-name2-name3</strong> to <strong>name1Name2Name3</strong> in javascript () ?? (looking for elegant solution)</p> <p>Thanks</p>
javascript
[3]
3,592,304
3,592,305
Does shuffle() function makes query faster?
<p>I have two tables with more than 150000 rows of numbers, and I have this code:</p> <pre><code>$q=$_GET["q"]; $negative = strlen($q); $reverse = strrev($q); while ($a = mysql_fetch_array($sql)) { if (strlen($q) &gt; 0) { $hint=""; for($i=0; $i&lt;count($a); $i++) { if ($reverse==substr($a[$i],-$negative,strlen($q))) { if ($hint=="") { $hint=$a[$i]; } } } } echo $hint . "\t"; } </code></pre> <p>This query takes 27 seconds to return the results, and I wanted to shuffle all the results, but when I added shuffle() function like this:</p> <pre><code>while ($a = mysql_fetch_array($sql)) { shuffle($a); </code></pre> <p>The performance changed amazingly, now it takes only two seconds to return the results, and I have tried many times it's the same. Does it make faster?</p>
php
[2]
506,132
506,133
Override compareTo and sort using two strings
<p>Lets say i've a Album class. How do i code the compareTo method so that when i've a ArrayList of Album object and i call </p> <p><em>Collections.sort()</em></p> <p>it will sort them in by title follow by singer in ascending order.</p> <pre><code>Public class Album implements Comparable{ private String title; private String singer; private double price; ..... public int compareTo(){ // How to } } </code></pre>
java
[1]
3,740,572
3,740,573
jquery toggle on multiple divs only working on first element
<p>ive created a page but it's only toggling the first div and the other 2 arent working... can't work out why! Thanks in advance</p> <pre><code>var levelopen=false; $(document).ready(function() { $('.contentlevel').hide(); $('#levelopener').click(function(){ if(levelopen==false) { $('#levelopener').html('[less]'); levelopen=true; } else { $('#levelopener').html('[more]'); levelopen=false; } $(this).next(".contentlevel").slideToggle(100); return false; }); }); </code></pre> <p><a href="http://jsfiddle.net/q2qxX/4/" rel="nofollow">http://jsfiddle.net/q2qxX/4/</a></p>
jquery
[5]
5,937,443
5,937,444
Possible to check if imagecreatefromjpeg is going to cause memory exhausted fatal error before I run it?
<p>I've done some searching for this and I understand that it is not possible to recover from an exhausted memory fatal error. I have a script that runs imagecreatefromjpeg. I tried catching the exception, I tried running the function with @ and then checking the return value for null or false, I tried running it with 'die()'. Nothing works. So I can't 'recover' from it. </p> <p>So is it possible to anticipate it before I get to it? Is it possible to check the uncompressed size of a jpeg and then die gracefully? I want to sent a message to my users along the lines of "The image $image is too large to process. You will need to create a thumbnail manually".</p> <p>My shared host won't allow me to increase memory size beyond 64mb so that's not an option. My code is as follows...</p> <pre><code>function createthumb($section,$filename,$constrain=100) { $dir = "$section/thumbs_$constrain"; if(file_exists($workingdir."$section/thumbs_$constrain/$filename")) return 1; if(!file_exists($dir)) mkdir($dir); $src = imagecreatefromjpeg($workingdir."$section/$filename"); ... </code></pre>
php
[2]
4,145,288
4,145,289
How to enforce an integer limit in an argument hint in Java
<p>I'm new to Java after working for a few years in PHP and I'm trying to get an idea of some of the best practices and norms when working with Java.</p> <p>I'm wondering if it makes sense to make a whole class to act as a custom type just to enforce a limit on the range of an integer argument? </p> <p>For example:</p> <pre><code>class Person() { private int age; public Person(int age) { if(age &lt; 0) { throw new IllegalArgumentException(); } this.age = age; } public int getAge() { return age; } } </code></pre> <p>Or:</p> <pre><code>class Person() { private Age age; public Person(Age age) { this.age = age; } public int getAge() { return age.toInt(); } } class Age() { private int age; public Age(int age) { if(age &lt; 0) { throw new IllegalArgumentException(); } this.age = age; } public toInt() { return age; } } </code></pre> <p>Also, in the second example I'm converting the Age object to an int in Person.getAge(), which is convenient but somehow feels wrong since Person's constructor takes an Age object. Any thoughts?</p> <p>Thanks!</p>
java
[1]
2,806,290
2,806,291
setting the thread's name when Thread object is created?
<p>I'm new to Java. Can anyone explain what happens in the main method??</p> <pre><code>class Demo { public static void main(String []args) { //setting a name using the constructor Thread t=new Thread("main"){ //what is this? a static block?? need an explanation to this. {setName("DemoThread");} }; //output is DemoThread. Since it set the name again. System.out.println(t.getName()); } } </code></pre>
java
[1]
2,715,550
2,715,551
Assigning values to object properties
<p>Is there a quicker way to do the following? Want to cut down the number of lines of code.</p> <pre><code>var item = new SpecialObject(); var dictionary = new Dictionary&lt;string, object&gt;(); dictionary.Add("key1", "value1"); dictionary.Add("key2", "value2"); item.Name = "name"; item.Id = 1; item.Dictionary = dictionary; </code></pre> <p>Thanks..</p>
c#
[0]
5,708,191
5,708,192
How to get the specific data format from different domain using jQuery?
<p>What kind of data format is this and how can i parse it using jQuery?</p> <pre><code>s:7:"resdata";a:8:{s:8:"greeting";s:7:"abc9999";s:4:"svID";s:6:"Serwer";s:7:"version";s:3:"2.1";s:4:"lang";s:2:"pl";s:6:"svDate";s:19:"2010-08-31T12:53:51";s:6:"access";s:3:"all";s:10:"connection";s:2:"OK";s:10:"ip:connect";s:13:"11.111.11.111";} </code></pre>
jquery
[5]
4,354,522
4,354,523
Where is the syntax error in this bit of JavaScript?
<p><strong>Error from firebug:</strong> </p> <pre><code>missing ) after condition [Break on this error] else if (($(this).parent...nt().hasClass('plaing')==true) ) { </code></pre> <p><strong>The code:</strong></p> <pre><code>$(".myButtonPlay").live('click',function(){ if ($(this).parent().parent().hasClass('current')==false){ console.log($(this).children().attr('src')); var media=$(this).parent().parent().attr('media'); var id=$(this).parent().parent().attr('id'); $(this).parent().parent().addClass('plaing'); $(this).find('img').attr('src','http://localhost:8000/silver/images/btn_pause.gif') play_media(media, id); } else if (($(this).parent().parent().hasClass('current')==true) $$ ($(this).parent().parent().hasClass('plaing')==true) ) { $(this).parent().parent().removeClass('plaing'); $('#mediaPlayer').attr('player').pause(); $(this).find('img').attr('src','http://localhost:8000/silver/images/btn_pause.gif'); } else if ( ($(this).parent().parent().hasClass('current')==true) $$ ($(this).parent().parent().hasClass('plaing')==false) ){ $(this).find('img').attr('src','http://localhost:8000/silver/images/btn_paly.gif'); $(this).parent().parent().addClass('plaing'); $('#mediaPlayer').attr('player').play(); } }); </code></pre> <p>Where is the problem? Looks like error is in conditions of second <code>if</code> statement....</p>
javascript
[3]
4,541,805
4,541,806
Error with __init__ 'module' object is not callable
<p>I was creating my module and when I tested it, I got an error. The code was like this:</p> <pre><code>class test: def __init__(self,size,type): self.type = type self.size = size </code></pre> <p>And after I import the module, when I type:</p> <pre><code>x=test(10,'A type') </code></pre> <p>It says:</p> <pre><code>TypeError: 'module' object is not callable </code></pre> <p>Please help me.</p>
python
[7]
1,576,731
1,576,732
Trim exception message
<p>I'm trying to trim an exception message with the below code:</p> <pre><code>Response.Redirect("IllegalCharactersError.aspx?error="); string message = ex.Message; string cleanMessage = message.Substring(message.IndexOf("=") + 1); Session.Add("IllegalCharactersError", cleanMessage.Replace("\\", "")); </code></pre> <p>Here is a sample of the string: A potentially dangerous <code>Request.Form</code> value was detected from the client </p> <pre><code>(ctl00$Main$EmployerRegistrationCtrl$CompanyDetails$CompanyTradingAs="'&lt;'My Company Trading"). </code></pre> <p>I only want to display <code>'&lt;'My Company Trading</code> but my label is displaying <code>\"'&lt;'My Company Trading\").</code> with back slashes so its not displaying and I cant seem to remove, any ideads how to acheive this?</p> <p>Thanks Darren</p>
asp.net
[9]
5,019,785
5,019,786
iPhone Application Local or Remote Database
<p>I am planning to write an iPhone app and I am weighing in the options to either make the database local (on the device) or host on my server and access it through web services. What are the advantages/disadvantages of these two different approaches? </p>
iphone
[8]
3,907,903
3,907,904
How to control verbose logs in user builds?
<p>I can see LOGV message is USER builds (in logcat).</p> <p>On user builds typically verbose logging is disabled ? or at least that is what I thought. how we could ensure that our LOGV messages show up in userdebug but not on user builds ?</p> <p>Thanks Himanshu</p>
android
[4]
4,586,920
4,586,921
jquery use plugin on dynamic content
<p>I'm trying to create an image gallery from an rss feed with the galleryview plugin. When the html content is statically in the page the plugin works but when I generate the html dynamically from the rss feed calling the plugin seems to do nothing. Here is the code I'm using:</p> <pre><code>function getScrollerContent() { $.get('photos.rss', {}, function(xml) { var contentHtml = ''; var filmStripHtml = '&lt;ul class="filmstrip"&gt;'; $('item', xml).each(function(i) { contentHtml += '&lt;div class="panel"&gt;'; var imgSrc = $(this).find('image').text(); contentHtml += '&lt;img src="' + imgSrc + '" /&gt;'; contentHtml += '&lt;div class="panel-overlay"&gt;'; contentHtml += '&lt;h2&gt;&lt;a href="' + $(this).find('link').text() + '"&gt;' + $(this).find('title').text() + '&lt;/a&gt;&lt;/h2&gt;'; contentHtml += '&lt;p&gt;' + $(this).find('desc').text() + '&lt;/p&gt;'; contentHtml += '&lt;/div&gt;'; contentHtml += '&lt;/div&gt;'; filmStripHtml += '&lt;li&gt;&lt;img src="' + imgSrc + '" /&gt;&lt;/li&gt;'; }); filmStripHtml += '&lt;/ul&gt;'; contentHtml += filmStripHtml; $('#photos').append(contentHtml); }); $('#photos').galleryView({ panel_width: 800, panel_height: 300, frame_width: 100, frame_height: 100 }); } $(getScrollerContent); </code></pre> <p>What am I doing wrong?</p>
jquery
[5]
2,465,026
2,465,027
Javascript Arranging Images as Pile of Cards
<p>Im new to javascript so im sure there is a lot i am missing in its understanding. What i am trying to do it create a layer of images so that it looks like a pile of cards.</p> <p>have seen similar codes and have tried to follow their idea but i just cant get the images to position properly. All 10 or so images are place in the exact same location.</p> <p>Can any help to see why they not positioning? Also what is "em". I cant find any literature on it but assume it is the measurement em like px ?? Why is it in "" ?</p> <pre><code>function Display() { var el; var left = 0; var top = 0; var i=0; var n = deck.length; var cardNode; var img = document.createElement("IMG"); img.src = "wendell7_back.png"; el = document.getElementById('deck'); el.appendChild(img); while (el.firstChild != null) el.removeChild(el.firstChild); for (i = 0; i &lt; Math.round(n / 5); i++) { cardNode = document.createElement("DIV"); cardNode.appendChild(img); cardNode.style.left = left + "em"; cardNode.style.top = top + "em"; el.appendChild(cardNode); left += 0.1; top += 0.1; } } </code></pre>
javascript
[3]
4,015,996
4,015,997
button textcolor not changed
<pre><code> button3.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub button3.setBackgroundResource(R.color.buttonDarkSelected); button4.setBackgroundResource(R.color.buttonMediumUnselected); button3.setTextColor(R.color.yellow); } }); button4.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub button4.setBackgroundResource(R.color.buttonDarkSelected); button3.setBackgroundResource(R.color.buttonMediumUnselected); button4.setTextColor(R.color.yellow); } }); } </code></pre> <p>I am trying to change Button's background and textcolor clicking in that buttons. the background is fine working fine but textcolor always black (instead I want it be yellow) what's my problem here.</p>
android
[4]
1,083,480
1,083,481
Reading Bundle version from PList
<p>Is there a way to read the app's bundled plist file, I am wanting to pull the value for Bundle version.</p>
iphone
[8]
2,200,098
2,200,099
How to turn on the intelligence for the UITextField in iPhone
<p>When you type something in iPhoneSearchBar it shows the text with the help of intelligence. I want to turn on the same for a UITextField. So how to do it.</p>
iphone
[8]
5,201,572
5,201,573
Iphone app getting slow after sometime,how to make it work?
<p>I've made a game in objective-C for iphone and is getting slow after playing it for 20- 30 times.I am using 3 timers but i am also releasing them.I am allocating 9 UIImageViews but again releasing them also. Please help?</p>
iphone
[8]
4,590,127
4,590,128
how to implement delete functionality from the iphone photo library?
<p>I am implementing photo galary.now i want to implement delete photo functionality(animation) from the gallery same as default delete functionality in the iphone photo library.So please advice me.</p>
iphone
[8]
3,478,199
3,478,200
C# removing items from listbox
<p>I have a listbox being populated from a SQLDATA pull, and it pulls down some columns that i dont want like OBJECT_dfj, OBJECT_daskd. The key is all of these being with OBJECT_, is there a way to remove these from the listbox? I cannot change my SQL statement.</p> <p>i tried this:</p> <pre><code> foreach (string item in listBox1.Items) { string removelistitem = "OBJECT"; if(item.Contains(removelistitem)) { listBox1.Items.Remove(item); } } </code></pre> <p>but it gave me the error:<br> List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change.</p>
c#
[0]
3,343,681
3,343,682
Selecting all first tier elements of another first tier element
<p>Is there a more elegant way to select all the first tier <code>&lt;dt&gt;</code>s than what I am showing. I was thinking something like <code>$('#myDiv').children('dl&gt;dt')</code> but it doesn't work. Thanks</p> <pre><code>$('#myDiv dl').children('dt'); $('#myDiv').children('dl').children('dt'); &lt;div id="myDiv"&gt; &lt;dl&gt; &lt;dt&gt;good&lt;/dt&gt; &lt;dd&gt;good &lt;dl&gt;&lt;dt&gt;Bad&lt;/dt&gt;&lt;dd&gt;Bad&lt;/dd&gt;&lt;/dl&gt; &lt;/dd&gt; &lt;dt&gt;good&lt;/dt&gt;&lt;dd&gt;good&lt;/dd&gt; &lt;/dl&gt; &lt;/div&gt; </code></pre>
jquery
[5]
4,579,591
4,579,592
DateTime.Now as parameter value C#
<p>I have a method that has a parameter of type DateTime that must not be in the past, which indicates when some other stuff executes. So naturally I want to use this method and pass DateTime.Now to it, so that everything happens as soon as possible.</p> <p>The problem here is that DateTime.Now at the time of the call and DateTime.Now at the time it is actually checked will probably be different values, so how do I make sure that the date is not in the past, yet allow the method to be called with something like DateTime.Now? I don't want to add magic numbers here, but a general solution.</p> <p><strong>UPDATE.</strong> I've found this question <a href="http://stackoverflow.com/questions/307582/how-frequent-is-datetime-now-updated-or-is-there-a-more-precise-api-to-get-the">How frequent is DateTime.Now updated</a></p>
c#
[0]
2,951,450
2,951,451
How to use COM in C#
<p>How to reference VB 6.0 component(.dll) with C# in Visual Studio .NET 2005</p> <p>After I referenced this DLL file, I can see the new icon in the reference folder icon in solution explorer. But this new icon has "!" sybbol. I double clicked this new icon that said "This project cannot be viewed in the object browser because it is unavailable or not yet built. Please ensure that the projects is available and built."</p>
c#
[0]
1,962,896
1,962,897
For in loop returns a string not an object
<p>I have javascript object that contains nested objects. I want to iterate over these using a 'for in' loop but this returns a string instead of an object?</p> <p>Code:</p> <pre><code>var myObject = { myNestedObject : { key1 : value 1 } } </code></pre> <p>And then if i loop:</p> <pre><code>for(theObject in myObject){ alert(typeof theObject); } </code></pre> <p>This returns the string 'myNestedObject' but not the object itself.</p> <p>Why?</p>
javascript
[3]
3,151,996
3,151,997
Sorting a string based on the number of occurences of a character
<p>If the input string is <code>ABbCcc</code> then the sort should give <code>cccbba</code>, <code>lower</code> and <code>upper</code> case does not matter</p>
c++
[6]
2,444,145
2,444,146
Python and Server Load
<p>Hello i wonder if there is a way through python to check periodically the server load of a linux machine and inform me with some way.</p> <p>Thanks</p> <p>Antonis </p>
python
[7]
2,973,930
2,973,931
some thing wrong with array index in byte[]
<p>I have string like this</p> <pre><code>String text = "f001050000000000003d61c1c1df400200c0000009181600ef014000003f20" </code></pre> <p>I converted it to bytes to loop through it as bytes</p> <pre><code>byte[] bytes = new BigInteger(text,16).toByteArray(); for (int i = 0; i &lt; bytes.length; i++) { System.out.print(String.format("%02x ", bytes[i])); } </code></pre> <p>But when I print array values it adds byte <code>00</code> at the beginning of the actual string! It should start with <code>f0</code> but it starts with <code>00</code>!</p> <p>When I start index with <code>1</code> this <code>00</code> disappear. From where this <code>00</code> come!?</p>
java
[1]
1,724,407
1,724,408
PHP Method chaining Confusion
<p>i have been lately introduced to method chaining, and am not sure if what I'm doing here is illegal, or I'm doing it wrong. I have a database Class like:</p> <pre><code> class Database { private $connection; private $resultset, $last_query, $current_row; function __construct() { $this-&gt;connect(); } public function connect() { // Connect to the database } public function query($query) { $this-&gt;last_query = $query; $this-&gt;resultset = mysql_query($query, $this-&gt;connection); } public function fetchObject() { $this-&gt;current_row = mysql_fetch_object($this-&gt;resultset); return $this-&gt;current_row; } } </code></pre> <p>I tried using it like:</p> <pre><code>$db-&gt;query("SELECT * FROM users WHERE name='JimmyP'")-&gt;fetchObject(); </code></pre> <p>I also tried </p> <pre><code>$db-&gt;fetchObject()-&gt;query("SELECT * FROM users WHERE name='JimmyP'"); </code></pre> <p>But i get the error: "Call to a member function fetchObject() on a non-object"</p> <p>Can someone please explain to me what Im doing incorrectly here as it relates to using method chaining. Thank you.</p>
php
[2]
3,897,651
3,897,652
how to create desktop sharing web conference through web application?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/10042573/is-it-possible-to-share-desktop-screen-on-web-site-through-net-c">is it possible to share desktop screen on web site through .net c#?</a> </p> </blockquote> <p>I want to create a desktop sharing web conference like application where one user will demonstrate anything on its desktop and others will view what he is doing. Is any one having detailed steps about it?</p>
c#
[0]
1,527,242
1,527,243
how to create .json file and how to write json object into json file ...In android
<p>I am using this code for creating the new file and write the json object in test.json file but I am unable to create file.Please find mistake and give the best result One things I have also write the code for permission in manifest file..</p> <p>Thanks,</p> <pre><code>String fileName = "test"; File file = new File("/data/data/packagename/test.json"); file.createNewFile(); DataOutputStream fos = new DataOutputStream(openFileOutput(fileName , Context.MODE_PRIVATE)); if(file.exists()){ fos.write(jsString.getBytes()); fos.close(); } </code></pre>
android
[4]
2,982,729
2,982,730
PHP - Convert file data into an array based on common strings in the file
<p>I have a file that has several lines of data. I would like every 33 lines of data to be grouped into an array, after that data is grouped into an array I'd like to colon delimitate the data into sub arrays like so:</p> <pre><code>&lt;? print_r(explode(':', $line)); ?&gt; </code></pre> <p>How do I prep the every 33 lines of data in the file to get ready to become my $line variable in the snippet above?</p>
php
[2]
2,939,967
2,939,968
image span appearing even after ellipsize in Android textView
<p>I have an TextView which have ImageSpan content.I have ellipzise ="end" for TextView . After ellipsize, the imagespans are appearing after ... </p>
android
[4]
2,658,470
2,658,471
iPhone provisional vs distribution installation on device
<p>Is there a way to install a provisional app on the iPhone without it overwriting the distribution app? I would like to have both running since the provisional development app points to our test servers, while the distribution app, which is from the app store, points to our production servers.</p> <p>Any help would be wonderful. Thanks!</p>
iphone
[8]
2,986,767
2,986,768
deleting a file after user download it
<p>i am using this for sending file to user</p> <pre><code>header('Content-type: application/zip'); header('Content-Length: ' . filesize($file)); header("Content-Disposition: attachment; filename="file.zip"); readfile($file); </code></pre> <p>i want to delete this file after user download it, how can i do this ?</p> <p>thx</p> <p>EDIT: my scenario is like that, when user hits download button, my script will create a temp. zip file and user download it then that temp zip file will be delete</p> <p>EDIT2: OK best way seems running a cron job that will be cleaning temp files once an hour.</p> <p>EDIT3: I tested my script with <code>unlink</code> , it works unless user cancel the download. if user cancel the download, zip file stays on the server. so that is enough for now :)</p> <p>EDIT4: WOW! <code>connection_aborted()</code> made the trick !</p> <pre><code>ignore_user_abort(true); if (connection_aborted()) { unlink($f); } </code></pre> <p>this one will delete the file even if user cancel the download. </p>
php
[2]
5,697,348
5,697,349
script not terminating immediately
<p>I have a script that lets the user download files (stored in a blob field after doing a bin2hex() )</p> <p><PRE> function hex2bin($h){ ... } // code to get $filecontent,$filesize,$uploadname from database header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header("Content-Length: $filesize"); header('Content-Disposition: attachment; filename="'.$uploadname.'"'); echo hex2bin($filecontent); </PRE></p> <p>everything is working fine, except the browser is taking 3 to 4 seconds after downloading the file to finally terminate the http session.</p> <p>Any clue whats causing that.</p> <p>thanks. Pari</p>
php
[2]
1,703,118
1,703,119
Dynamic Drop down with jquery?
<p>I used dynamic drop down with jquery.I am getting data into drop down but when i selected specific item that time it is fetching first record in list.</p> <p>My coding: This function is response from ajax.</p> <pre><code>function updateItem() { var item= xmlhttp.responseXML.getElementsByTagName("ExpenseType"); var itemId = "0"; var itemName = "--"; document.getElementById("reportAhcc_Item_ID_S").length = 0; if(item.length != "0") { for(var i=0;i&lt;item.length;i++) { itemId=item[i].getElementsByTagName("ItemId")[0].childNodes[0].nodeValue; itemName=item[i].getElementsByTagName("ItemName")[0].childNodes[0].nodeValue; document.getElementById("reportAhcc_Item_ID_S").options[i]=new Option(itemName,itemId); } } else { document.getElementById("reportAhcc_Item_ID_S").options[0]=new Option(itemName,itemId); } } </code></pre> <p>Below code to create combobox</p> <pre><code>$( "#reportAhcc_Item_ID_S" ).combobox() </code></pre> <p>for fetching selected item from list i used</p> <pre><code>var getItem = $("#reportAhcc_Item_ID_S option:selected").text(); </code></pre> <p>hear i am facing problem.Always it is fetching first record in list.</p> <p>Could you help how to fetch my selected item from list.</p> <p>with regards, Chandrasekhar</p>
jquery
[5]
3,161,633
3,161,634
Asp.net - implementing Help window
<p>I am working in ASP.Net Web Application. In my application , i have model dialogs opened. After opening model dialog , if i press F1 using keyboard , which should open <strong>.htm help</strong> files.</p> <p>In windows application . i have help provider control. But i could not able to find anything here.</p> <p>Kindly help me in this.</p>
asp.net
[9]
2,485,135
2,485,136
Universal app for iPhone SDK 4.0
<p>I have updated my SDK to the latest version: 4.0. So now I am able to create iPhone apps and iPad apps. I want to create a universal app. How can I do this?</p> <p>If we created a universal app, does this mean this app works on both iPhone and iPad? How is this possible, as the screen size should be varied according with UI designs. I am not sure about this. And also, I already created an iPod touch application using iPhone SDK 3.1.2, can I make this app a universal app?</p> <p>Can anyone help me?</p> <p>Thanks in advance</p>
iphone
[8]
2,414,071
2,414,072
Iterate over attributes in DOM
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2048720/get-all-attributes-from-a-html-element-with-javascript-jquery">Get all Attributes from a HTML element with Javascript/jQuery</a> </p> </blockquote> <p>I need to retrieve all attributes of a DOM element. I've seen the <code>getAttribute()</code> method, but I don't know the names of the attributes in advance. If I use <code>getElementById()</code> to retrieve an element, how do I then access all attributes of that element and their values?</p>
javascript
[3]
3,131,495
3,131,496
iterate over array and compare values
<p>Using jQuery, I'm attempting to iterate over an array and compare to a value, but am running into issues that are stumping me. Here's the code:</p> <pre><code>var cF = ['first','last','email']; var fFound = 0; cj(this).children('.section').each(function(f){ var fId = cj(this).attr('class'); fId = fId.replace('-section', ''); console.log('fId: ',fId); cj.each(cF, function( cFi, cFv ){ console.log('cFv: ',cFv); if ( cFv == fId ) { console.log('found!'); fFound = 1; } }); console.log('fFound: ',fFound); }); </code></pre> <p>Basically what I'm doing is searching through a series of divs (passed with 'this'), retrieving the class name, stripping the suffix to the class, and then comparing it with my cF array. If found, I want to set fFound to 1 (it's my flag to indicate the value is present).</p> <p>Originally I was using jQuery.inArray() but wasn't having much luck. When I send fId and cFv to the console -- they match -- but the comparison doesn't recognize them as matching.</p>
jquery
[5]
1,314,454
1,314,455
Preload background images with jQuery?
<p>I have a div thats currently set to display none, The Div has a background image that is approx 5000px wide, 2000px high. </p> <p>I toggle the div display attirbute with jquery on a button click only with the image being so big the div loads and the image loads 1/2 seconds afterwards; is there a function where I can show a preloader until the image is ready and then display it?</p> <p>Thanks</p>
jquery
[5]
846,679
846,680
sendTextFromHtml - Object doesnt support this property or method
<p>I am trying to have a flash analog clock in my application and in its corresponding js i am trying to pass a value 'indiatime' which is system time.</p> <pre><code> document.getElementById('SBI_GLS_Analog_Latest').sendTextFromHtml(indiatime) </code></pre> <p>But this throws a script error in IE saying 'Object doesnt support this property or method'</p> <p>Please help.</p> <p>Thanks</p>
javascript
[3]
175,799
175,800
According to HTML, CSS, and jQuery standards, is php good?
<p>I think the title is self explanatory. is php good?</p>
php
[2]
4,733,471
4,733,472
Problem with jQuery array
<pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/jscript"&gt; $('document').ready(function (){ var clickNo=0; $('div#pics&gt;img').hide() $('div#pics&gt;input').click(function(event){ $('div#pics&gt;img')[0].show('slow'); }) }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="pics"&gt; &lt;input type="button" value="next" /&gt; &lt;--a bunch of img tags .I had to resort to this comment because the system won't let me include the img tag in the code--&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I can't understand why the line <code>$('div#pics&gt;img')[0].show('slow');</code> is not working.</p>
jquery
[5]
2,690,985
2,690,986
Asynchronus thread in android
<p>I want to invoke web service request every 1 minute. I m not able to understand what should i use. </p> <p>Any source code upon this would be great help.</p> <p>Thanks</p>
android
[4]
1,098,279
1,098,280
PHP Error Log Shows Maximum execution time error VERY early on in script
<p>I am looking at php_errors.log which logs PHP errors and the only error I see [often 10-20 times within a 3 second window] is the following:</p> <pre><code>[@TIMESTAMP@] PHP Fatal error: Maximum execution time of 30 seconds exceeded in @PATH@ on line 5 </code></pre> <p>The thing that confuses me is these are the first five lines:</p> <pre><code>&lt;?php session_start(); if (isset($_SERVER) &amp;&amp; isset($_SERVER['SERVER_NAME']) &amp;&amp; strpos($_SERVER['SERVER_NAME'],'local.') !== 0) </code></pre> <p>Not anything that I would expect to lock the system up.</p> <p>Does anyone have any ideas why this would be happening?</p> <p><strong>UPDATE:</strong> To clarify this never happens on my local development machine just occasionally on the production machine.</p>
php
[2]
2,478,220
2,478,221
Replace HTML in div when link is clicked
<p>Here is my scenario, a ul list with a "holder" div that has HTML in it. I would like to have the ul list have links that when the user clicks should populate the holder div. I have some experience with Jquery but not much. I am able to replace it once but wanted to be able to replace the "holder" div with different blocks of HTML. What I want is the holder div to be populated with the corresponding package HTML. </p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Package 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Package 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Package 3 3&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div class="holder"&gt; &lt;p&gt;replace this text here&lt;p&gt; &lt;/div&gt; &lt;div&gt; Package 1 HTML &lt;/div&gt; &lt;div&gt; Package 2 HTML &lt;/div&gt; &lt;div&gt; Package 3 HTML &lt;/div&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $("li a").click(function() { $("div.holder").text($(this).next().text()); return false; }); }); &lt;/script&gt; </code></pre>
jquery
[5]
5,231,437
5,231,438
Jquery selected item value for dropdowns
<p>I have two dropdowns and a button on my page and I know how to see the value of one dropdown selected value, But I want to see the values of both dropdown items in an alert box when I click on button. Please help....</p>
jquery
[5]
2,027,085
2,027,086
jQuery Messi modal window plugin
<p>I'm trying to configure the jQuery Messi (modal window) plugin.</p> <p>I've checked the documentation and examples but there is no way I can get the Close button to center in the modal window.</p> <p>Can anyone help me out with this?</p>
jquery
[5]
5,055,936
5,055,937
Extendable array
<p>I want to create an extendable array. Whenever you try and add another element into the current array, and it's full it should copy every element from the current array into the new one (including the new element that you want to add) and then delete the old array. Would anyone be able to give me some pointers on how to do this?</p> <p><strong>EDIT:</strong> note: I can't use arraylists for this</p>
java
[1]
3,435,943
3,435,944
Elliptic curve cryptography in java
<p>i want to implement ECC in java.whether jdk1.7 alone to implement it or need anyother open source like bouncy castle or JCE provider. if bouncy castle is used how to install the package for it.i dont know exact procedure. pls say the procedure to implement it.pls kindly clarify my doubt.</p>
java
[1]
1,985,490
1,985,491
How do i add the or use While loop in my code
<p>I want to use the while loop so it can catch any invalid input like letters or random %%$@@...etc</p> <p>Im new to java...THANKS alot for ur guys help :) here is what im working on:</p> <pre><code>import java.util.Scanner; public class AreaCircle { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // read the keyboard System.out.println("This program will calculate the area of a circle"); System.out.println("Enter radius:");//Print to screen double r = sc.nextDouble(); // Read in the double from the keyboard double area = (3.14 *r * r); String output = "Radius: " + r + "\n"; output = output + "Area: " + area + "\n"; System.out.println("The area of the circle is " + area); } } </code></pre>
java
[1]
5,759,139
5,759,140
Storing a list to another list
<p>If I had the following declaration of the list:</p> <pre><code>List&lt; Integer&gt; b = new ArrayList&lt; Integer&gt;(); </code></pre> <p>and</p> <pre><code>List&lt; HashSet &lt; Integer&gt;&gt; c = new ArrayList&lt; HashSet&lt; Integer&gt;&gt;(); </code></pre> <p>I was wondering how would I be able to add <code>b</code> to <code>c</code>?</p> <p>I've tried <code>c.add(b);</code> but this doesn't work.</p> <p>Thanks for any help!</p>
java
[1]
5,336,762
5,336,763
Method parameters confusion
<p>Often time methods take more than 3 parameters which are all of the same type, eg.</p> <pre><code>void mymethod (String param1, String param2, String param3) </code></pre> <p>then it's very easy for the client to mix up the parameters orders, for instance inverting param1 and param2:</p> <pre><code>mymethod (param2, param1, param3); </code></pre> <p>...which can be the cause of much time spent debugging what should be a trivial matter. Any tips on how to avoid this sort of mistake (apart from unit tests) ?</p>
java
[1]
1,051,081
1,051,082
Question about webservices and apple acceptance
<p>I have used web services to transfer money...</p> <p>Actually my server handles all requests and sends data to main server...</p> <p>will apple accept my application..??</p>
iphone
[8]
268,283
268,284
How to achieve the role played by "public static variables of Java" in JavaScript or a webpage?
<p>On my homepage I have to set a cookie using the name of the logged in user. The cookie <code>set</code> and <code>get</code> part has to be done in JS. On the subsequent sub pages I have to retrieve the <code>cookie(username)</code> using the <code>set</code> variable name. </p> <p>How can I store the username/cookie name so that it is publicly accessible across all the pages? This username will obviously change with each new user and is not constant.</p> <p>I have tried doing this using external JS file but in every new page the value is reset to default which I don't want.</p> <p>The exact solution to my problem is like the work done by:</p> <pre><code>public static variable </code></pre> <p>in Java (not final). I want to achieve this in JS.</p>
javascript
[3]
914,850
914,851
PHP heredoc syntax error
<p>How come this code is giving me an error?</p> <pre><code> &lt;?php $content = &lt;&lt;&lt;EOF $error &lt;form action="form2.php" method="post"&gt; &lt;label for="username"&gt;username:&lt;/label&gt;&lt;br /&gt;&lt;br /&gt; &lt;input type="text" name="username" class="text" /&gt; &lt;label for="password"&gt;Password&lt;/label&gt;&lt;br/&gt;&lt;br /&gt; &lt;input type="password" name="password" class="text" /&gt; &lt;input type="submit" value="login" /&gt; &lt;/p&gt; &lt;/form&gt; EOF; ?&gt; </code></pre> <p>The error is 'PHP heredoc syntax error'. </p>
php
[2]
4,888,121
4,888,122
How to implement TOTP C/S (Time One Time Password Client/Server) in C#?
<p>I want to create a client/server application using C#, and my application must have the ability to deal with time one time passwords, meaning that my server can authenticate a client after a (TOTP) entry.</p> <p>I searched over the internet for any example that might be close to something like this or thing but coudln't find anything at all.</p> <p>Do you happen to have an idea about implementing TOTP, even if its not the same situation I have in here , I just need someone to give me some clues.</p>
c#
[0]
4,273,799
4,273,800
In assignment operator function, is array being memcpy implicitly
<p>OK. We know the following code cannot be compiled.</p> <pre><code>char source[1024]; char dest[1024]; // Fail. Use memcpy(dest, source, sizeof(source)); instead. dest = source; </code></pre> <p>But, the following code can be compiled and behave correctly.</p> <pre><code>class A { char data[1024]; }; A source; B dest; dest = source; </code></pre> <p>I was wondering, in operator assignment function, is array will be memcpy implicitly?</p> <p>The following are the complete test code.</p> <hr> <pre><code>#include &lt;cstdio&gt; #include &lt;memory&gt; class A { public: char data[1024]; }; int main() { { A source; A dest; // Initialization char *data = "hello world"; memcpy (source.data, data, strlen(data) + 1); printf ("source.data = %s\n", source.data); printf ("address source.data = %x\n", source.data); // Works! Does this in the operator assignment function, memcpy is // being performed implicitly on array. dest = source; printf ("dest.data = %s\n", dest.data); printf ("address dest.data = %x\n", dest.data); } { char source[1024]; char dest[1024]; // Initialization char *data = "hello world"; memcpy (source, data, strlen(data) + 1); printf ("source = %s\n", source); printf ("address source = %x\n", source); // '=' : left operand must be l-value // dest = source; // Works with memcpy. memcpy(dest, source, sizeof(source)); printf ("dest = %s\n", dest); printf ("address dest = %x\n", dest); } getchar(); } //RESULT : //source.data = hello world //address source.data = 12fb60 //dest.data = hello world //address dest.data = 12f758 //source = hello world //address source = 12f344 //dest = hello world //address dest = 12ef3c </code></pre>
c++
[6]
4,016,788
4,016,789
What is the location of a file 'config.ini' in C# ?
<p>The code below creates the file "config.ini" with the values used by the User when the app is closed.</p> <pre><code> void Form1_FormClosing(object sender,FormClosingEventArgs e) { IniFile ini=new IniFile(Application.StartupPath+@"\\config.ini"); </code></pre> <p>When running the app in Visual Studio 2010 Ultimate, the file config.ini will be saved in the app directory\bin\Debug.</p> <p>By publish, install and run the app, I can not find the file config.ini.</p> <p>What is the location of the file config.ini?</p> <p>Thanks in advanced, ocaccy</p>
c#
[0]
2,970,397
2,970,398
Resigning responder of textview
<p>How to resign virtual keyboard for text view? is there any way same as textfieldshouldresignresponder?</p>
iphone
[8]
1,717,194
1,717,195
Print Combining Strings and Numbers
<p>To print strings and numbers in Python, is there any other way than doing something like:</p> <pre><code>first = 10 second = 20 print "First number is %(first)d and second number is %(second)d" % {"first": first, "second":second} </code></pre>
python
[7]
5,229,854
5,229,855
Android CallLogs Listener
<p>I want to write an application in which every call information should be logged. Till now I can log all incoming calls by making use of <code>PhoneStateListener</code> but dont know how to listen outgoing calls. If anyone had worked on such issue please let me know the way how to do the same. </p> <p>Thanks in advance.</p>
android
[4]
1,441,376
1,441,377
C# reference question
<p>Why does <strong>b.b</strong> would not change to "a2" as with f.f?</p> <p>Thanks.</p> <pre><code>public class Test { public static void Main() { Foo f = new Foo { f = getStr() }; Boo b = new Boo { b = f.f }; f.f = "a2"; Console.WriteLine(f.f); Console.WriteLine(b.b); } public static string getStr() { string a = "a1"; return a; } } public class Foo { public string f { get; set; } } public class Boo { public string b { get; set; } } </code></pre>
c#
[0]
4,826,786
4,826,787
How to display PST time irrespective of the location of the user?
<p>I need to write a javascript function that returns current PST date time even if the page is opened in another timezone. I am not the brightest javascript head... any ideas?</p>
javascript
[3]
5,765,211
5,765,212
javascript functionality to detect the mouse event
<p>I am new to javascript. In most of the sites developed like... they create some anchor tag. When wepress that anchor tag they showthe content under that anchor element.after that when we click the mouse on out side of displayed content, it is dissapeared. How we actually develop this one. </p> <p>Please suggest me on this.</p> <p>Thanks &amp; Regards,</p> <p>C.Govindarajulu.</p>
javascript
[3]
4,770,489
4,770,490
import Excel colums to listboxes
<p>I need to import 3 columns from Excel to 3 different listboexs</p> <ul> <li>Col a to listbox 1</li> <li>Col b to listbox 2</li> <li>Col c to listbox 3</li> </ul>
c#
[0]