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
3,644,467
3,644,468
python adding new line at the end of each line
<p>how can I preserve the file structure after substitution.</p> <pre><code># -*- coding: cp1252 -*- import os import os.path import sys import fileinput path="C:\\Search_replace" # insert the path to the directory of interest #os.path.exists(path) #raise SystemExit Abspath=os.path.abspath(path) print(Abspath) dirList=os.listdir(path) print ('seaching in',os.path.abspath(path)) for fname in dirList: if fname.endswith('.txt') or fname.endswith('.srt'): #print fname full_path=Abspath+"\\"+fname print full_path for line in fileinput.FileInput(full_path,inplace=1): line = line.replace("þ","t") line=line.replace("ª","S") line=line.replace("º","s") print line print "done" </code></pre>
python
[7]
2,742,443
2,742,444
How do I set a textbox's value using an anchor with jQuery?
<p>I have a textbox whose value I want to set based on the inner text of an anchor tag. In other words, when someone clicks on this anchor:</p> <pre><code>&lt;a href="javascript:void();" class="clickable"&gt;Blah&lt;/a&gt; </code></pre> <p>I want my textbox to populate with the text "Blah". Here is the code I am currently using:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $("a.clickable").click(function(event){ $("input#textbox").val($(this).html()); }); }); &lt;/script&gt; </code></pre> <p>And in my html there is a list of anchor tags with the class "clickable" and one textbox with the id "textbox".</p> <p>I've substituted the code above with code to just show a javascript alert with $(this).html() and it seems to show the correct value. I have also changed the $(this).html() to be a hardcoded string and it setes the textbox value correctly. But when I combine them the textbox simply clears out. What am I doing wrong?</p>
jquery
[5]
4,953,481
4,953,482
How to make the jQuery popup dialog box pop up on "login link" clicks
<p>I am working on this site: <a href="http://www.problemio.com" rel="nofollow">http://www.problemio.com</a> and I would like the login dialog popup box to pop up whenever the user clicks on the "log in" link. These links appear throughout the site like on the top-right of the home page, and also on pages the user can not access without being logged in like their home page: <a href="http://www.problemio.com/account/member_home.php" rel="nofollow">http://www.problemio.com/account/member_home.php</a></p> <p>Right now I am able to get the dialog box to pop up using jQuery when users submit forms and are not logged-in, like in this form: <a href="http://www.problemio.com/add_problem.php" rel="nofollow">http://www.problemio.com/add_problem.php</a> (has to have some input in there).</p> <p>But how do people get the popup to pop-up on clicks of specific regular links?</p> <p>Thanks!</p>
jquery
[5]
676,204
676,205
What is the differnce between these two types using jquery
<pre><code> $('tr td:first-child').click(function() { var foobar = $(this).text(); $("#showgrid").load('/Product/List/Item?id=' + foobar); }); </code></pre> <p>when I am seding foobar value like this in the Actionresult method I am getting string id value perfectly but I am not able to display the grid?</p> <p>but intresting thing is when I am seding like this</p> <pre><code> $("#showgrid").load('/Product/List/Item?id=' + "12345"); </code></pre> <p>then I am able to display the grid.. foobar result is same 12345..</p> <p>what is the differnt between these two types?</p> <p>can any body help me out.. </p> <p>thanks</p>
jquery
[5]
3,651,347
3,651,348
How can run a script tag in html page which is already generated by an external javascript file
<p>extenal javascript file: var someVariable="document.write('JavaScript text');";</p> <p>and output should be: JavaScript text</p>
javascript
[3]
3,168,113
3,168,114
Expanding a function to call a module into a custom cms i have built
<p>I have created a simple small cms and in this section of code calls a module (sorta speak) of a poll to my page content which works perfectly however i have come across the need to pass a variable to my include file and I cant figure out how to do it.</p> <p>Here is working code right now not passing any variables:</p> <pre class="lang-php prettyprint-override"><code>&lt;? $pageContent = "&lt;p&gt;Please fill in our poll.&lt;/p&gt; &lt;p&gt; {{poll}} &lt;/p&gt;"; //ENABLE MODULES $modules = array( 'poll' =&gt; 'mods/poll/poll.php', ); //START MODULER function parseTemplate($templateText, $params){ foreach ($params as $key =&gt; $value) { ob_start(); include($value); $includeContents = ob_get_contents(); ob_end_clean(); $templateText = str_replace('{{'.$key.'}}', $includeContents, $templateText); } return $templateText; } $params = $modules; $pageContent = parseTemplate($pageContent, $params); //END MODULER print $pageContent; ?&gt; </code></pre> <p>I would like to put <code>{{poll?pollID=3}}</code> that way when <code>mods/poll/poll.php</code> is brought into my <code>$pageContent</code> i could load a specific poll.</p>
php
[2]
3,189,580
3,189,581
C# The type 'XXXX' cannot be resolved
<p>I've included a custom validator and included the refrence to the DLL. But I'm getting error below:</p> <pre><code>Warning: System.ArgumentException: The type 'Custom.Validator, CustomValidators, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' cannot be resolved. Please verify the spelling is correct or that the full type name is provided. </code></pre> <p>I've got a custom.Validator class which is used for custom validation in Enterprise Library.</p> <p>The following code results the above error:</p> <blockquote> <p>var results=results = Validation.Validate(msg);</p> </blockquote> <p>Could someone please tell me how to fix this error message.</p> <p>Thank you</p>
c#
[0]
528,239
528,240
Runtime Error in ASP.Net Application
<p>I am modifying a website using asp.net pages which was created using asp. In the web.config file I am using </p> <pre><code>&lt;system.web&gt; &lt;compilation debug="true" strict="false" explicit="true" tarrgetFramework="4.0"/&gt; &lt;httpRuntime requestValidationMode="2.0" maxRequestLength="1048576" executionTimeout="3600" /&gt; &lt;customErrors mode="Off"/&gt; &lt;/system.web&gt; </code></pre> <p>and also tried </p> <pre><code> &lt;customErrors mode="RemoteOnly" defaultRedirect="error.htm"/&gt; </code></pre> <p>But still an error occuring as</p> <p><strong>Runtime Error</strong></p> <p>Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.</p> <p>Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".</p> <pre><code>&lt;!-- Web.Config Configuration File --&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;customErrors mode="Off"/&gt; &lt;/system.web&gt; &lt;/configuration&gt; </code></pre> <p>Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.</p> <pre><code>&lt;!-- Web.Config Configuration File --&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/&gt; &lt;/system.web&gt; &lt;/configuration&gt; </code></pre> <p>What is its solution??</p>
asp.net
[9]
5,619,003
5,619,004
How do I use methods in jquery plugin?
<p>I found <a href="https://github.com/can3p/iviewer/wiki/Docs-for-0.6" rel="nofollow">this plugin</a>, and it has a couple of methods: <code>containerToImage</code> and <code>imageToContainer</code>. How can I utilize these? I am trying to figure out what these actually do, but I don't even know how to call them in a page. I have a <a href="http://jsfiddle.net/thindery/SsN42/" rel="nofollow">working fiddle here</a>.</p> <p>Can anyone show me how to use these methods?</p>
jquery
[5]
4,948,899
4,948,900
On session timeout capture info
<p>Trying to implement data to be saved on the session timeout.how can i capture the <code>session timeout event</code>.</p>
asp.net
[9]
3,731,955
3,731,956
Strict Standards: Declaration of RPA::PreLoadField() should be compatible with that of Foundation::PreLoadField()
<p>When I run index.php and loads the page, it comes up with below error:</p> <blockquote> <p>Strict Standards: Declaration of RPA::PreLoadField() should be compatible with that of Foundation::PreLoadField() in C:\xampps\htdocs\Res\RPA.php on line 39</p> </blockquote> <p>I've had a look at line 39 of RPA.php and this is class called:</p> <pre><code>class RPA extends Foundation </code></pre> <p>any ideas on this error?</p> <p>This function is from foundations class:</p> <pre><code>public function PreLoadField($table, $column, $rowid, $coldata, &amp;$value, $disabled=false) { $retval = false; if ($table === 'photos') { if ($column === 'blogentry') { $value = LookUpBlogEntries ($column, $coldata[$column]); $retval = true; } } return $retval; } </code></pre> <p>This function is from RPA class:</p> <pre><code>public function PreLoadField($table, $column, $rowid, $coldata, &amp;$value) { $retval = parent::PreLoadField($table, $column, $rowid, $coldata, &amp;$value); return $retval; } </code></pre> <p>RPA extends Foundation..</p>
php
[2]
5,085,897
5,085,898
assistance with using the £ symbol in php echo
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3716178/encoding-issue-pound-symbol-appearing-as-symbol">Encoding issue: &#163; pound symbol appearing as &lt;?&gt; symbol</a> </p> </blockquote> <p>I am doing some basic echo statements and when i use echo "£" it puts a capital A before the pound sign any ideas why?</p> <pre><code> echo ("£"): output = A£ </code></pre> <p>the A has a symbol above.</p>
php
[2]
4,902,708
4,902,709
disable all the links in my slider panes using jquery?
<p>How do i disable all the links in my slider panes using jquery?</p> <p>Basically every single <code>&lt;a href...</code> within my parent div</p>
jquery
[5]
4,298,440
4,298,441
Sum of a string of one-digit numbers in javascript?
<p>I'm trying to write a script that adds the left side of a string and validates it against the right side.</p> <p>For example:</p> <pre><code>var left = "12345" var right = "34567" </code></pre> <p>I need to do some sort of sum function that adds 1+2+3+4+5 and checks if it equals 3+4+5+6+7.</p> <p>I just don't have a clue how to do it.</p> <p>I think I need to use a for loop to iterate through the numbers such as for (var i = 0, length = left.length; i &lt; length; i++)</p> <p>But I'm not sure how to add each number from there.</p> <p><em><strong>EDIT</em></strong> the var is actually being pulled in from a field. so var left = document.blah.blah</p>
javascript
[3]
906,506
906,507
Best way to completely destroy a session - even if the browser is not closed
<p>Is it enough to </p> <pre><code>session_start(); // Must start a session before destroying it if (isset($_SESSION)) { unset($_SESSION); session_unset(); session_destroy(); } </code></pre> <p>when the user selects <code>Log out</code> from a menu, but does not quit his browser? I want to totally remove all existence of the session and <code>$_SESSION</code></p>
php
[2]
2,317,414
2,317,415
How to apply the html tags to Uilabel text
<p>Iam developing one application.In that iam using the uilabels.And my problem is i need to apply the html effects to that label data.For example i need to add the anchor tag to that text.Then i need to use the anchor tag for that text.So please tell me how to use that one.</p>
iphone
[8]
190,111
190,112
jquery content hide/show panels
<p>I didn't write this code myself but a colleges has asked me to help resolve an issue. I'm not having much look with google so thought I'd give it a shot here.</p> <pre><code>function($) { var accordion = $('dl &gt; dd').hide().slice(0, 1).show(); $('dl &gt; dt &gt; a').click(function() { accordion.slideUp(); if($(this).parent().next().is(':hidden')) { $(this).parent().next().slideDown(); } return false; }); })(jQuery); </code></pre> <p>This code is supposed to open and close panels on the page. </p> <p>If we change this line </p> <pre><code> var accordion = $('dl &gt; dd').hide().slice(0, 1).show(); </code></pre> <p>to this line</p> <pre><code> var accordion = $('dl &gt; dd').hide(); </code></pre> <p>Everything works as should but we would like the first panel to show when the page loads.</p> <p>With the code as is when you open a panel the open ones don't close.</p>
jquery
[5]
3,521,600
3,521,601
Scroll to a comment which is in a scroll area
<p>Hi i have a window which is a bit like this : <a href="http://d.pr/i/r8m1" rel="nofollow">http://d.pr/i/r8m1</a></p> <p>As you can see, the sidebar and the header remains static, while the comments window can be scrolled. Data is appended when the user scrolls to the end of the window. </p> <p>I am using codeigniter, so i append paginated data and kept a counter to increment by the number of paginated data each time the end of the window is reached. </p> <p>Each comment has a comment id, for example #S334 is an id associated with the latest comment. The comments can be in any paginated page such that the first 20 comments will be in the first paginated window like this: <a href="http://site.com/" rel="nofollow">http://site.com/</a>. The next 20 comments will be in the second paginated page like this: site.com/20 and so on. </p> <p>I want to give the user the option to scroll to any comment. I guess i will have to use the .scroll() function. </p> <p>I tried this: </p> <pre><code>$('#S344').scroll(); </code></pre> <p>and it didn't work.</p> <p>Any help please?</p>
jquery
[5]
3,641,308
3,641,309
can scriptname be empty when supplying command-line arg?
<p>using module sys one can get command line arguments like this</p> <pre><code>import sys for x in sys.argv: print x </code></pre> <p>then at command shell[ubunto]</p> <pre><code>&gt;&gt;python file.py 1, 2, 3 </code></pre> <p>this will print file[filename] 1 2 3 Now comes my doubt in python documentaion 3.0.1 it is mentioned that</p> <p><strong>If no script name was passed to the Python interpreter, argv[0] is the empty string.</strong></p> <pre><code>&gt;&gt;python 1, 2, 3 </code></pre> <p>if i pass no script name , it will lead to error that 'can't open a file'. How would argv[0] be intitialized to an empty string when you are not passing script name ?</p>
python
[7]
572,027
572,028
Jquery drag drop bug in IE9
<p>I’m working on a JQuery "Nettuts drag and drop" from <a href="http://nettuts.s3.amazonaws.com/127_iNETTUTS/demo/index.html" rel="nofollow">iNETTUTS demo</a>.</p> <p>Which I have downloaded from <a href="http://www.1stwebdesigner.com/freebies/drag-drop-jquery-plugins/" rel="nofollow">webdesigner.com</a>.</p> <p>The demo works excellently in all the browsers except IE9. If anyone has a solution, I would appreciate it. Thanks in advance.</p>
jquery
[5]
1,266,341
1,266,342
i want TimerTask pause and resume
<p>i am working in a game so i have need to use time which update in every second.i am using TimerTask.I want to pause time When i clicked on a button and want to resume it again when i clicked on resume button from other activity.How to do it please help me.</p> <pre><code>t=new Timer(); { t.scheduleAtFixedRate(new TimerTask() { public void run() { runOnUiThread(new Runnable() { @Override public void run() { TextView tv = (TextView) findViewById(R.id.time); tv.setText(String.format("%02d:%02d",minute,seconds)); time += 1; seconds += 1; if(seconds==60) { seconds=0; } minute=time/60; } }); } }, 0, 1000); } </code></pre>
android
[4]
4,000,674
4,000,675
insert code which require where clause
<p>i need to insert some data in a raw. suppose first i insert username, firstname lastname etc and then i create a session "username" from the username field</p> <p>now i need to insert gender, education, photourl where username= session"username"</p> <p>i am using maltiview and view </p> <pre><code>Protected Sub btnSubmitD1_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'Dim temp As Integer = (DateTime.Now.Subtract(Convert.ToDateTime("txtDOB.Text")).Days) / 365 Dim objcmd As New SqlCommand((((("insert into Registration(UserName,FName,LName,Gender,Religion,Language,Status) values('" &amp; Session("UserName").ToString() &amp; "','") + txtFName.Text &amp; "','") + txtLName.Text &amp; "','" &amp; ddlGender.SelectedValue.ToString() &amp; "','") + txtReligion.Text &amp; "','") + txtMotherTongue.Text &amp; "','" &amp; ddlMaritalStatus.SelectedValue.ToString() &amp; "')", con) </code></pre>
asp.net
[9]
967,927
967,928
Extracting all links from webpage
<p>I want to write a function that takes a web page URL, downloads the web page and returns a list of the URLs in that page.(with using urllib module) any help would be appreciated</p>
python
[7]
3,370,176
3,370,177
Check to see if Alpha or symbols are in textField with iPhone SDK
<p>I need to check to see if the user has input an alpha key or any symbol other than the decimal (.). I'm putting this inside an if statement, curious if there is an easy place to find this script. Any help would be greatly appreciated.</p>
iphone
[8]
214,216
214,217
error with std::ostringsteam and std::string
<p>Hi i want to save many different csv files from a function with a naming convention based on a different double value. I do this with a for loop and pass a string value to save each .csv file differently. Below is an example of what I'm trying to do the desired result would be </p> <pre><code>1.1_file.csv 1.2_file.csv </code></pre> <p>but instead i get </p> <pre><code>1.1_file.csv 1.11.2_file.csv </code></pre> <p>Here is a working sample code, what can i do to fix this</p> <pre><code>#include &lt;sstream&gt; #include &lt;iomanip&gt; #include &lt;cmath&gt; #include &lt;iostream&gt; #include &lt;vector&gt; int main(){ std::string file = "_file.csv"; std::string s; std::ostringstream os; double x; for(int i = 0; i &lt; 10; i++){ x = 0.1 + 0.1 *i; os &lt;&lt; std::fixed &lt;&lt; std::setprecision(1); os &lt;&lt; x; s = os.str(); std::cout&lt;&lt;s+file&lt;&lt;std::endl; s.clear(); } return 0; } </code></pre>
c++
[6]
78,491
78,492
Why does my service get instantiated multiple times?
<p>IIUC, there should only be one instance of a given Android service, it is a singleton.</p> <p>However, my service gets instantiated multiple times, although I do nothing for it.</p> <p>When the service crashes (for example when I uninstall the app through adb), it gets scheduled for restart ("Scheduling restart of crashed service.. "). I understand this is an effect of the service being sticky.</p> <p>After that, when my app starts, it calls startService() and bindService(), and the service gets appropriately started and bound. But the service is then reinstantiated and onCreate() is called repeatedly, as many times it was scheduled for restart.</p> <p>Each instance then wait for clients to bind and register, but onBind() is only called in the "main" service instance. The additional instances wait a bit for client to bind, and since that doesn't happen, they call stopSelf().</p> <p>But stopSelf() has absolutely no effect in these "dead" instances, onDestroy() is never called.</p> <p>The "main" service instance does work as expected, and when it decides to call stopSelf(), onDestroy() is indeed called.</p> <p>Worse, all these dead instances accumulate, they never gets destroyed. Therefore, their only possible end is a crash (which happen every time I launch/install through adb), and thus scheduled restart.</p> <p>So that in the end I get many of these dead instances, which are restarted progressively once by minute approximately.</p> <p>Does anyone know what's going on?</p>
android
[4]
1,703,791
1,703,792
url_to_absolute query
<p>right, i am building a web crawler and there is a section of my code which translates to absolute urls instead of /macbookpro/ to <a href="http://www.apple.com/macbookpro" rel="nofollow">http://www.apple.com/macbookpro</a>. but when i echo my code, it only prints one result, which is the first link it sees why. Do i have to create an array, because when i did, i echoed the array and listed was the word 'Array'</p> <pre><code> &lt;?php require_once('simplehtmldom_1_5/simple_html_dom.php'); require_once('url_to_absolute/url_to_absolute.php'); $URL = 'http://www.theqlick.com'; // change it for urls to grab // grabs the urls from URL $file = file_get_html($URL); foreach ($file-&gt;find('a') as $theelement) { $links = url_to_absolute($URL, $theelement-&gt;href); } echo $links; ?&gt; </code></pre>
php
[2]
5,771,047
5,771,048
Single servlet for application
<p>Is it possible to have an application such as shopping cart, to have a single servlet in the entire application, which will result into a single entry in web.xml? If yes, how?</p>
java
[1]
5,374,494
5,374,495
Any way programatically to check the version of android platform
<p>Is there any programatically way for my android application to know which version of android platform (1.6 or 2.0 or 2.3) that it is currently running on?</p> <p>Thank you.</p>
android
[4]
4,779,458
4,779,459
Call Jquery Function from BookMarklet script
<p>I have a bookmarklet that runs a .js file. I now want to split that .js file into more focused modules.</p> <p>In scriptA I am using the following code to load scriptB:</p> <pre><code> $.getScript("LoadXML.js")(function(){ loadAllXML() }); </code></pre> <p>This function is in scriptB:</p> <pre><code>function loadAllXML() { $.ajax({ type: "GET", url: "/dataSource.xml", dataType: "xml", success: function (xml) { //how to return xml to ScriptA? } }); } </code></pre> <p>I think the code in scriptA is continuing to run before the loadAllXML has completed so have tried things like jquery's <a href="http://api.jquery.com/jQuery.when/" rel="nofollow">when</a> but have had no joy.</p> <p>How do I return the xml to scriptA? </p> <p>Also, how do I make calls to loadAllXML() from outside $.getScript?</p> <p>Thanks</p>
jquery
[5]
5,953,242
5,953,243
Restart incomplate process in android device
<p>I am searching solution for one issue, I am doing some work in Service,I have implemented that service in android application. Now my service done some process(task) and if device reboot at that time, then how can again restart that service without starting the application and I just want remaining task to do,Not whole process(task) again. </p> <p>Can anyone give me some suggestion? Thanks in Advance.</p>
android
[4]
3,899,911
3,899,912
Why isn't the function is_null accurate with $_FILES?
<p>I want to test if the user selected a file or not , so I tested if <code>$_FILES['input_name']['name']</code> is not null. </p> <p>I used the PHP function <code>is_null($_FILES['input_name']['name'])</code> but the code goes to the statements where it's supposed a file was selected ! </p> <p>So I replaced my test with <code>$_FILES['input_name']['name'] != ""</code> .</p> <p>So why isn't <code>is_null</code> accurate with $_FILES['name'] ?</p>
php
[2]
2,162,820
2,162,821
Why is this php function call failing?
<p>I am attempting to use the following PHP class:</p> <pre><code>&lt;?php class Service { public $code, $description; public static $services = array( "A" =&gt; "Shipping", "B" =&gt; "Manufacturing", "C" =&gt; "Legal", "D" =&gt; "Accounts Receivable", "E" =&gt; "Human Resources", "F" =&gt; "Security", "G" =&gt; "Executive", "H" =&gt; "IT" ); public function _construct( $c, $d) { $this-&gt;code = $c; $this-&gt;description = $d; } public static function getDescription( $c ){ return $services[$c]; } public static function generateServiceList() { $service_list[] = array(); foreach ($services as $k =&gt; $v ){ $service_list[] = new Service( $k, $v ); } return $service_list; } } ?&gt; </code></pre> <p>...in the following way:</p> <pre><code>&lt;?php $services = Service::generateServiceList(); ?&gt; </code></pre> <p>...but getting the following error:</p> <pre><code>Warning: Invalid argument supplied for foreach() in /classes/service.php on line 31 </code></pre> <p>Any idea why? Is this some kind of an access issue? Thanks.</p>
php
[2]
5,698,020
5,698,021
Motivation for Using Static Factory Methods
<p>The motivation for using Static Factory methods staes as:</p> <blockquote> <p>The most obvious motivation for Replace Constructor with Factory Method comes with replacing a type code with subclassing. </p> <p>You have an object that often is created with a type code but now needs subclasses. The exact subclass is based on the type code. </p> <p>However, constructors can only return an instance of the object that is asked for. So you need to replace the constructor with a factory method.</p> </blockquote> <p>Can anyone please explain this with code? And what does this <strong>type code</strong> mean?</p>
java
[1]
5,773,528
5,773,529
Custom Callback Handler
<p>I am trying to understand mechanism of callback handler. How is the handle() method invoked? Can anybody give an example of usage of custom callback handler (other than those used in Login Modules of JASS or so) in non Swing application?</p>
java
[1]
5,208,964
5,208,965
PHP form post gives Page Not Found 404 error in Internet Explorer while Firefox and Chrome give expected results
<p>I have a PHP page (search_employee.php) where I use three different hidden form input elements on three different forms to direct users where I need them to go. The page posts back on itself for each of these submittals.</p> <pre><code>if (isset($_POST['submitted'])) {... } elseif (isset($_POST['bypassed'])) {... if (isset($_POST['multicheck'])) {... } </code></pre> <p>I am having a problem with Internet Explorer 8 in that when I try to submit on a post back to this same page (search_employee.php) with this form:</p> <pre><code>&lt;form action="search_employee.php" method="post"&gt; &lt;input type="submit" name="select" value="Select" /&gt; &lt;input type="hidden" name="multicheck" value="TRUE" /&gt; &lt;input type="hidden" name="id" value="' . $id . '" /&gt; &lt;input type="hidden" name="eid" value="' . $row['eid'] . '" /&gt; &lt;/form&gt; </code></pre> <p>I get a Page Not Found 404 error, even though the 404 page has the exact same url as before the post, character for character. This is after I have successfully processed the "submitted" post back multiple times (search function that users can repeat).</p> <p>I have tested my code in both Firefox and Chrome, and both process the "multicheck" post back exactly as desired. Is this something that is a known bug in IE, and is there a workaround? I'm at a loss for where to look next since this works in FF &amp; Chrome.</p> <p>Thanks in advance for any assistance you can provide.</p>
php
[2]
3,302,102
3,302,103
FaceBook dynamic Image URL
<p>friend's, I am working in Facebook,here i need to change the image url value string has dynamic one, here my code</p> <pre><code>intent .putExtra( "attachment", "{\"name\":\"" + Html.fromHtml(title) + "\",\"href\":\"" + Html.fromHtml(url_val) + "\",\"description\":\"" + Html.fromHtml(desc_val) + "\",\"media\":[{\"type\":\"image\",\"src\":\"http://www.naicu.edu/imgLib/20070913_small_seal.jpg\",\"href\":\"http://alumni.brown.edu/\"}]}"); this.startActivityForResult(intent, MESSAGEPUBLISHED); </code></pre> <p>here image source given in code has static,but i need to assign an simple string variable in the place of double quoted image url,for example i want to place string <strong>temp_url</strong> in the place of **src\":\"http://www.naicu.edu/imgLib/20070913_small_seal.jpg**,how can i get it.</p> <p>Thanks in advance.</p>
android
[4]
708,521
708,522
What's this language feature called?
<pre><code>JPanel panel = new JPanel() { public void setBackground(Color c) { Logger.global.info("setBackground: c=" + c); super.setBackground(c); } }; </code></pre> <p>I only know I can do <code>JPanel panel = new JPanel();</code></p> <p>Why can someone do the above? What's the name for it?</p>
java
[1]
4,566,215
4,566,216
Singleton modal dialog
<p>Is it possibile to create a modal dialog form following the singleton pattern?</p> <p>The idea is:</p> <pre><code>public partial class Singleton : Form { private static Singleton _instance = null; private Singleton() { // Initialization code } public static Singleton Instance { get { if (_instance == null) _instance = new Singleton(); return _instance; } } private void Singleton_FormClosing(object sender, FormClosingEventArgs e) { _instance.Hide(); e.Cancel = true; } private void buttonClose_Click(object sender, EventArgs e) { this.Close(); } } </code></pre> <p>This code works fine if the form is non-modal (so, if the Show() method is used), but does not work if the form is modal (so, if the ShowDialog() method is used) because this will also hide the parent form.</p>
c#
[0]
4,677,827
4,677,828
Cannot scroll down ScrollView/TextView on creation of activity
<p>I have an activity with textview, where a certain file is printed. I need to autoscroll it all way down to the end. Code below doesn`t work in onCreate, though when I call the same method (last two lines) from button (onClick) on the screen of that activity, everyhing works just fine. Could you please inform me where the trick is? </p> <p>Code:</p> <pre><code>public class LogViewer extends AndroidClientBase implements OnClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!hasWindowFocus()) { setContentView(R.layout.log_viewer); } TextView myHelpTV = (TextView) findViewById(R.id.textLog); myHelpTV.setMovementMethod(LinkMovementMethod.getInstance()); myHelpTV.scrollTo(0,0); // set button listeners // that part (see below) works fine in onClick, but not in //onCreate, onStart or onResume: //read some text to textview... //scroll down scrollview wrapper ScrollView myHelpSV = (ScrollView) findViewById(R.id.logScrollView1); myHelpSV.fullScroll(View.FOCUS_DOWN); } </code></pre> <p>what might it be? thanks for your advice in advance!</p>
android
[4]
1,862,256
1,862,257
How does one implement IsPrime() function
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/1510124/program-to-find-prime-numbers-in-c">Program to find prime numbers in C#</a><br> <a href="http://stackoverflow.com/questions/886540/prime-numbers-c">prime numbers c#</a><br> <a href="http://stackoverflow.com/questions/1042902/most-elegant-way-to-generate-prime-numbers">Most elegant way to generate prime numbers</a> </p> </blockquote> <p>Hi Guys.</p> <p>How does one check if a number is prime or not?</p>
c#
[0]
4,912,487
4,912,488
Enter method output into class object
<p>I'm trying to directly enter the data that is being generated from <code>domeinnaamemailadres()</code> into a specific class object, for example <code>a</code>. I want the data to be entered into the domeinnaam attribute. How would I do this?</p> <pre><code>class Customer: "De klasse customer" def __init__(self, naam, adres, woonplaats, email, domeinnaam= ""): self.naam = naam self.adres = adres self.woonplaats = woonplaats self.email = email self.domeinnaam = domeinnaam def domeinnaamemailadres(self): c = self.email[self.email.find("@"):] a = Customer('Name1', 'address', 'Utrecht', '[email protected]', domeinnaamemailadres) b = Customer('Name2', 'Bonestaak', 'Maarssen', 'Bijjaapishetaltijdraakhotmail.com') </code></pre>
python
[7]
5,369,833
5,369,834
Force an android phone to sleep, in order to test?
<p>I'm writing an android application that depends on network activity and the alarm manager sometimes waking the phone up from a sleeping state.</p> <p>My question is how can I reliably test this on device? Ideally, how can I force the phone into a full-on sleeping state. Failing that, how can I know for sure when the phone has fully gone to sleep?</p> <p>How do you test your Alarm Manager / Wake Lock / Sleep handling code?</p>
android
[4]
979,077
979,078
How to move current view any where in android?
<p>I want to move my current bar chart view left and right of the screen. I have create bar chart , added onTouch event, but when I'm moving current view to the left it just movies up to zero value of x-axis.. waht can i do ti move it to -x axis.</p> <p>Thank You</p>
android
[4]
1,358,953
1,358,954
Media Player error when playing Video in Emulator
<p>I'm trying to play video from youtube using this code but I get this error from my log cat:</p> <pre><code>06-28 16:23:09.794: E/MediaPlayer(621): error (1, -2147483648) </code></pre> <p>Here is my code:</p> <pre><code>public class PromoActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(com.frux.kfcmobile.R.layout.promo); VideoView videoView = (VideoView)this.findViewById(com.frux.kfcmobile.R.id.videoView); String path = "rtsp://v4.cache5.c.youtube.com/CjYLENy73wIaLQmofK96HM6gyhMYDSANFEIJbXYtZ29vZ2xlSARSBWluZGV4YJWAl-O04anmTww=/0/0/0/video.3gp"; Uri vid = Uri.parse(path); videoView.setVideoURI(vid); videoView.setMediaController(new MediaController(this)); videoView.start(); videoView.requestFocus(); } } </code></pre> <p>Can anyone help me?</p>
android
[4]
5,018,164
5,018,165
how to bind labels for different numbers of values
<p>i had written this code to bind each text box values to labels this works for each single value but now i want label bind each and every values for numbers of times means i m using for loop for this so that i can bind different values and shows it dynamically for number of iterations so how is it possible.</p> <pre><code>protected void Button1_Click(object sender, EventArgs e) { string name = TextBox1.Text; string order = TextBox2.Text; int qty = Convert.ToInt32(TextBox3.Text); int rate = Convert.ToInt32(TextBox4.Text); int discount = Convert.ToInt32(TextBox5.Text); int c = (Convert.ToInt32(TextBox3.Text) * Convert.ToInt32(TextBox4.Text) - Convert.ToInt32(TextBox5.Text)); TextBox6.Text = c.ToString(); int total = Convert.ToInt32(TextBox6.Text); string j=""; for (int i = 1; i &lt; 5; i++) { j += i + ""; Label1.Text = j + "customer name is:-" + name; Label2.Text = j + "order item is:-" + order; Label3.Text = j + "quantity is:-" + qty; Label4.Text = j + "rate of the item is:-" + rate; Label5.Text = j + "discount given to the item is:-" + discount; Label6.Text = j + "Total of the item is:-" + total; } TextBox1.Text = string.Empty; TextBox2.Text = string.Empty; TextBox3.Text = string.Empty; TextBox4.Text = string.Empty; TextBox5.Text = string.Empty; TextBox6.Text = string.Empty; } </code></pre>
asp.net
[9]
2,246,946
2,246,947
Why does "[] == False" evaluate to False when "if not []" succeeds?
<p>I'm asking this because I know that the pythonic way to check whether a list is empty or not is the following: </p> <pre><code>my_list = [] if not my_list: print "computer says no" else: # my_list isn't empty print "computer says yes" </code></pre> <p>will print <code>computer says no</code>, etc. So this leads me to identify <code>[]</code> with <code>False</code> truth-values; however, if I try to compare [] and False "directly", I obtain the following: </p> <pre><code>&gt;&gt;&gt; my_list == False False &gt;&gt;&gt; my_list is False False &gt;&gt;&gt; [] == False False </code></pre> <p>etc... </p> <p>What's going on here? I feel like I'm missing something really obvious.</p>
python
[7]
2,979,207
2,979,208
How to create an Custom Object with a Custom Object?
<p>In Javascript how would I create a Custom Object that has a property this is another Custom Object. For Example.</p> <pre><code>function Product() { this.prop1 = 1; this.prop2 = 2; } function Work(values) { this.front = values.front || "default"; this.back = values.back || "default"; this.product = Product; } var w = new Work(); alert(w.product.prop1); //no worky </code></pre>
javascript
[3]
1,040,514
1,040,515
Creating Objects with variable object names from a mysql database
<p>I am trying to create objects with variable names, when I print out my objectname variable the correct name is assigned to it. But when i try and create an object using the objectname variable, the object created is literally called "objectname", not using the string assigned to the variable. My code is below:</p> <pre><code>class Customer: # Initiliaise method, creating a customer object def __init__(self,name): self.name = name print "Customer %s Added" % (self.name) # Print out details def output(self): print "This is the customer object called %s" % (self.name) ## Create the Customer objects, from the Customer table # Pull the Customers out of the Customer table # SQL cursor.execute("SELECT * FROM Customer") result = cursor.fetchall() for record in result: objectname = 'Customer' + str(record[0]) print objectname # This prints "Customer1..2" etc # customername is the exact name as in the database customername = str(record[1]) # Use the above variables pulled from the database to create a customer object objectname=Customer(customername) # We need to count the number of customer objects we create customercount = customercount + 1 </code></pre> <p>So all that will create is a single object called objectname, opposed to multiple objects "Customer1,2,3" etc, based on the number in the Customer DB table. The variable name is based on the string "Customer" and the row ID in the database.</p> <p>I assume I am referencing the variable incorrectly,</p> <p>Thanks for your help.</p>
python
[7]
102,254
102,255
What JavaScript library should I use for parsing URL parameters?
<p>How do I parse URL parameters in JavaScript? (These are the parameters I would ordinarily call GET parameters or CGI parameters, but in this case the page is basically submitting to itself, not a server, so there is no GET request and definitely no CGI program.)</p> <p>I've seen a number of routines on the net that I can copy, but I have no idea how robust any of them are. I'm used to other languages like Perl and Java where I can rely on an extremely well-tested and robust library that I know will handle millions of little edge-cases in the standard. I would like the same here, rather than just cutting and pasting an example.</p>
javascript
[3]
3,886,044
3,886,045
How do you test to see if a double is equal to NaN in Java?
<p>I have a double in Java and I want to check if it is <code>NaN</code>. What's the best way to do this?</p>
java
[1]
4,870,202
4,870,203
facebook and twitter in iphone doubts
<p>HA II, i am doing a application in iphone, it contains text sharing to twitter and Facebook.</p> <p>I already done text sharing to Facebook and twitter by using their apis.</p> <p>In normal case when we share a text we have to login to Facebook and twitter for authentication.</p> <p>There is a login popup for Facebook and twitter,on the text sharing page,but my client wants this login(authentication)done on the some other page with a button click.</p> <p>When the user tap the Facebook and twitter login button it logs in and the user is able to post his text to Facebook and twitter without displaying the loginpage in the text sharing page.</p> <p><strong>Is this possible?</strong></p> <p>This is my first question in stack-overflow.Sorry for the poor question method.</p>
iphone
[8]
730,947
730,948
Jquery not working with the widgets
<p>I am using <strong>IGoogle interface</strong> kind of <strong>Jquery and Css</strong> for which im referring some Script tags at the bottom of my aspx page as below:</p> <pre><code>&lt;script type="text/javascript" src="/IGUI Utilities/jquery-1.2.6.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/IGUI Utilities/jquery-ui-personalized-1.6rc2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/IGUI Utilities/inettuts.js"&gt;&lt;/script&gt; </code></pre> <p>Everything works perfect, but when i drop one more control which needs Jquery interaction again as below:</p> <pre><code>&lt;script type="text/javascript" src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $("#tabs").tabs("div.description", { event: 'mouseover' }); }); &lt;/script&gt; </code></pre> <p><strong>mouseover event doesn't work</strong> :( and <em>if i drop the same control other than this page it works fine.... I tried changing the order of referring tags but no use</em>...</p> <p>Please help me on this...</p>
jquery
[5]
3,700,862
3,700,863
Exctract minus sign from a variable
<p>I've a peculiar situation, I need to split variable into two parts [sign] and [number]</p> <p>So I can have following integers (this is not a sequence, I can have only 1 integer at a time):</p> <pre><code>-15,...,-1,0,1,...,15 </code></pre> <p>When there is minus sign I need to split it into [-] part and [integer] part when there is no sign I need [+] and [integer]</p> <p>How would I do this?</p> <p>I was thinking to use explode with explode("-" but if there is no minus sign it will give errors... Any easy way to achieve what I want instead of writing multiple if functions?</p>
php
[2]
4,595,395
4,595,396
Jquery: Body background scrolling to the left?
<p>I'm breaking my head trying to make this work. I want my page's body background to scroll sideways. </p> <pre><code>&lt;html&gt; &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; &lt;script&gt; $(function(){ $("body").animate({backgroundPosition : "500 0"}, 2000); }); &lt;/script&gt; &lt;body style="background-image: url('bg.jpg')"&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
jquery
[5]
1,422,490
1,422,491
Namespacing in Javascript Classes
<p>I'm trying to create a timer in Javascript and I have a specific issue with how I'm implementing it. </p> <p>Right now it's like this</p> <pre><code>function CountUpTimer(seconds,name,targetId,submitButtonId){ this.time = seconds; this.currentTime = 0; this.minutes = Math.floor(seconds/60); this.submitButtonId = submitButtonId; this.seconds = seconds - this.minutes*60; this.currentSeconds = 0; this.currentMinutes = 0; this.targetId = targetId; this.name = name; this.isPaused = false; this.init = function(){ setInterval(this.name + ".tick()",1000); } this.pause = function(){ this.isPaused = true; } this.unpause = function(){ this.isPaused = false; } this.tick = function(){ if(this.isPaused == false){ if(this.currentTime &lt;= this.time){ if(this.currentSeconds == 59){ this.currentSeconds = 0; this.currentMinutes++; } this.updateTimer(); this.currentTime++; this.currentSeconds++; } else{ this.endTiming(); } } } </code></pre> <p>Now, the problem with this is that I can't dynamically create CountUpTimer objects, because I need to know the name of the variable that I am assigning to that object. Is there some way I can work around this - so let's say something like </p> <pre><code>setInterval(this.tick(),1000); </code></pre> <p>?</p>
javascript
[3]
1,126,820
1,126,821
there must be a better way to do this
<p>This is an ugly, high maintenance factory. I really just need a way to use the string to instantiate an object with a name that matches the string. I think metaclass is the answer but I can't figure out how to apply it:</p> <pre><code>from commands.shVersionCmd import shVersionCmd from commands.shVRFCmd import shVRFCmd def CommandFactory(commandnode): if commandnode.attrib['name'] == 'shVersionCmd': return shVersionCmd(commandnode) if commandnode.attrib['name'] == 'shVRFCmd': return shVRFCmd(commandnode) </code></pre>
python
[7]
1,152,778
1,152,779
Thread safe method without using any type of lock
<p>how we can create a thread safe method without using any type of lock?Any Help will be highly appericiated. thanks</p>
c#
[0]
4,682,532
4,682,533
How to play video player in surface view
<p>Hi friends I want to play video giving fixed height and width not whole screen can anybody tell how to play video in surface view in android please provide sample code</p> <p>Thanks</p>
android
[4]
2,075,058
2,075,059
php limit request per second
<p>Hello i'm having trouble with making like a simple waiting time between 2 php requests like... i have this code (for example) :</p> <pre><code>readfile($link); </code></pre> <p>the visitor request this php code to download a file ... but within 10 seconds he requests another one ... i want to make a limit for the time like if he requested once he has to waiting from the first download to the allowance to the second request (download) 30 seconds ... any idea of how could this be done ? in php ... thank you in advance :) </p> <p>edit : i tried with the help of the post below but did not work</p> <pre><code>if (!isset($_SESSION['last_download'])) $_SESSION['last_download'] = 0; { if (time() - $_SESSION['last_download'] &gt; 10){ $_SESSION['last_download'] = time(); echo $_SESSION['last_download']; }else {echo"".time() - $_SESSION['last_download']."";}} </code></pre> <p>but its not saving the session ... any help ?</p>
php
[2]
2,898,959
2,898,960
Event for resize stopped
<p>Is there an event that tells me when the user has stopped resizing by letting go of the mouse button? I'm looking at $(window).resize, and it's firing for every pixel movement. I just need to know when they've stopped.</p>
jquery
[5]
3,179,400
3,179,401
Convert command line argument to string
<p>I don't know C++.</p> <p>I have a program that reads hard coded file path and I want to make it read file path from command line instead. For that purpose I changed the code like this:</p> <pre><code>#include &lt;iostream&gt; int main(char *argv[]) { ... } </code></pre> <p>but, <code>argv[1]</code> variable exposed this way seems to be of type pointer, and I need it as a string. What should I do to convert this command line argument to string?</p>
c++
[6]
4,033,227
4,033,228
display html code inside a javascript on a html page
<p>I will try my best to explain what I wish to do and do correct me or question me if I did not get my question across correctly.</p> <p>I have a jquery function as follows:</p> <pre><code>function processResult(xData, status) { $(xData.responseXML).find("z\\:row").each(function() { var liHtml = "&lt;a href=" + $(this).attr("ows_Title") + "&gt;&lt;img src=" + $(this).attr("ows_snapshot_file_location") + " width=120 height=90&gt;&lt;strong&gt;" + $(this).attr("ows_video_description") + "&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;" + $(this).attr("ows_video_description") + "&lt;em&gt;" + $(this).attr("ows_video_length") + "&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;"; $("#videoplaylist").append(liHtml); }); } </code></pre> <p>I have a HTML code as follows:</p> <pre><code>&lt;div id="playlist"&gt; /*** Something to be derive from #videoplaylist ***/ &lt;/div&gt; </code></pre> <p>Actually, I can just call the jquery function as follows:</p> <pre><code>&lt;div id="videoplaylist"&gt; &lt;/div&gt; </code></pre> <p>inside the </p> <pre><code>/*** Something to be derive from #videoplaylist ***/ </code></pre> <p>but what I actually want was that the code to reflect all the <code>"lihtml"</code> variable.</p> <p>If the <code>"lihtml"</code> variable contain </p> <pre><code> &lt;em&gt;Hello World&lt;/em&gt; </code></pre> <p>it will display <code>"Hello World"</code> in the <code>"/*** Something to be derive from #videoplaylist ***/"</code> and not </p> <pre><code> &lt;em&gt;Hello World&lt;/em&gt; </code></pre> <p>Appreciate any insight. </p>
jquery
[5]
1,690,652
1,690,653
select drop down opening upwards in ie 8
<p>I'm having trouble with a simple select drop down. The drop down looks fine in Chrome, Safari, and Firefox but when i try it in explorer 8 the drop down sort of floats of and aligns with the top of the screen. You find the page here (for an FB-application I'm working on).</p> <p><a href="https://utvecklingtesttco.se/fb/jstest.html" rel="nofollow">https://utvecklingtesttco.se/fb/jstest.html</a></p> <p>Please help!</p>
jquery
[5]
2,607,166
2,607,167
PHP escape user input for filename
<p>I have a form where users can upload files, and I'd like to name the file something along the lines of <code>[id]_[lastname]_[firstname].pdf</code>. The name is entered by the user, and I'm afraid of them entering something with a slash in it. Otherwise, something like <code>$path = $dir.$filename</code> could result in <code>$path = 'uploads/2_smith_john/hahaimajerk.pdf'</code> if the firstname is <code>john/hahaimajerk</code>.</p> <p>I don't really want to force users to restrict their names to anything; I don't mind changing their names a little in the file name as long as I can tell the original name. What characters do I need to escape, or is there some other way to do this? Or...do I just use <code>mysql_real_escape_string</code>?</p>
php
[2]
1,769,639
1,769,640
Control parts of code through external on off config file?
<p>I want to have a config file that basically says something like (Account: on/off), where an admin can choose on or off. And then, in my main script, i want a bunch of if else statements that says if its on, do this, if off, do this.</p> <p>Any suggestions?</p>
php
[2]
3,450,251
3,450,252
PHP: What's wrong with this code, and why won't the variable increment?
<pre><code>$blogDir = 'blog/'; $blogdirHandle = opendir( $blogDir ); $checkingFile; $number = 0; $codeNumber = '-'.$number.'-'; if( $blogdirHandle = opendir( 'blog/' ) ) { while( ( $checkingFile = readdir( $blogdirHandle ) ) !== false ) { if( $checkingFile != '.' &amp;&amp; $checkingFile != '..' &amp;&amp; !is_dir( $checkingFile ) &amp;&amp; strpos( $checkingFile, $codeNumber ) !== false ) { $number++; } } closedir( $blogdirHandle ); } </code></pre> <p>What I'm trying to do is:</p> <p>Go through the $blogDir directory, and search for a file that has the same $codeNumber ( -$number- ), and if a file is found, then increase $number by one and search until all files are searched through. For some reason it's not working. It won't increase the value of $number, even though there are files with the same $codeNumber in the directory.. Any help?</p>
php
[2]
3,188,331
3,188,332
How to get id of element in jquery dynamically
<p>i have code like this</p> <pre><code>function slideelement(element1) { $("#"+element1).slidein(); } </code></pre> <p>it is not working</p>
jquery
[5]
1,133,825
1,133,826
how to parse xml from EditText?
<p>i try to build an application with xml parser.</p> <p>ex : <a href="http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser" rel="nofollow">http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser</a></p> <p>but i want to parse xml file from EditText, how it work ? </p>
android
[4]
2,482,259
2,482,260
Elucidate an obfuscated javascript code block
<p>Is there a way to elucidate an obfuscated javascript code block???</p>
javascript
[3]
3,486,647
3,486,648
ScriptManager.RegisterHiddenField in Chrome
<p>I'm working with some code that utilizes the ScriptManager.RegisterHiddenField to keep track of modifications to a datamodel. It works fine in IE and FF, but Chrome is having trouble. A simple example of the problem occurs if you add something like:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { ScriptManager.RegisterHiddenField(this, DateTime.Now.ToString(), "keith"); } </code></pre> <p>on a page. When you first load the page it works correctly, you will see a hidden field like:</p> <pre><code>&lt;input type="hidden" name="12/17/2010 9:55:13 AM" id="12/17/2010 9:55:13 AM" value="keith" /&gt; </code></pre> <p>However, if you do anything that requires a post back it will not generate a new date/time for the name of the hidden field. It usually generates a cached version of the field from hours before. Any thoughts on why Chrome performs this way with RegisterHiddenField? Thank you for any help.</p> <p>Keith</p>
asp.net
[9]
1,038,051
1,038,052
custom super global in PHP
<p>Is it possible to define a custom super global variable? (whether in code, or using php.ini)</p> <p>Example, for all projects I use a custom framework. The framework essentially stores all data about running instance of the script (template loaded, template variables, etc.) in a single variable. I'd like that variable to become cross-system accessible.</p> <p>I am perfectly aware of <code>$_GLOBALS</code> and <code>global</code>, however the question is asking if it is possible to define custom super global variable, e.g. $foo, which would become accessible by the same name in any scop.</p>
php
[2]
3,791,343
3,791,344
C++: overloaded destructor?
<p><a href="http://www.boost.org/doc/libs/1_46_1/libs/utility/enable_if.html" rel="nofollow">enable_if doc page</a> says:</p> <blockquote> <p>Constructors and destructors do not have a return type; an extra argument is the only option.</p> </blockquote> <p>Are destructors overloadable?</p> <p>Thank you.</p>
c++
[6]
4,515,580
4,515,581
How to show dynamic character coming from server to textView in android
<p>Please any one tell me that how can I show character like �cija in android textview. i.e some spanish word I have to show in textview</p>
android
[4]
709,843
709,844
how to implement url rewriting in php
<p>I am developing a php web site. Here I want to make the site as clean URL. My index page is domain/news/index.php?i=1. I want to display this URL as clean URL. But I am the beginner of URL rewriting. Does anyone help me??? How to write this URL Thanks in advance</p>
php
[2]
1,554,131
1,554,132
How to store and retrieve data in Jquery using arrays via hidden form elements
<p>I am building a dynamic form creator that allows users to add form elements and change the properties. I need to find a way to store this data on the client side without the complexity of XML or JSON. The user could add 50 form elements from text box to radio to textarea. Each element has a different number of changeable variables.</p> <p>I am currently storing them in hidden fields values like:</p> <pre><code>type:text, size:30, required:yes, top:30, left:30 type:textarea, cols:30, rows:5, top:50, left:60 </code></pre> <p>I am using jquery to add each item and the hidden.</p> <pre><code>var typeVariable = 'type:input'; var startPosLeft = 'left:' + Math.round($(newElem).offset().left$('.container').offset().left); var startPosTop = 'top:' + Math.round($(newElem).offset().top - $('.container').offset().top); var newElemValue = typeVariable + ',' + startPosTop + ',' + startPosLeft; // creates hidden form elements to store data $('&lt;input&gt;').attr({'type': 'text', value:newElemValue, 'name':'hidden' + newNumDivs, id:'hID' + newNumDivs}).appendTo('.hiddenDiv'); </code></pre> <ol> <li><p>Is this the best way to store and retrieve data without doing a ton of ajax calls</p></li> <li><p>How can I call a specific element from a string like: </p> <p>type:text, size:30, required:yes, top:30, left:30</p></li> </ol> <p><strong>I will need 'text' not 'type:text' .</strong></p> <p>How can I update a specific element in this string? If size:30 changes to size:50 how do I change this data stored in a hidden field and insert it into </p> <pre><code>type:text, size:50, required:yes, top:30, left:30 </code></pre>
jquery
[5]
1,859,102
1,859,103
I have an app organizer that opens multple apps from one interface..... but
<p>I have this app that allows users to have all my productivity apps under one interface. the organizer is free but i am thinking of integrating the organizer into every app. the problem is if the organizer is the first screen then everytime i open an app from the interface the organizer will lauch as it is the main activity for each app. is there a way to load a specific activity instead of loading with the package name. can i do load package.name.now/specificactivity this way i wont get stuck in this endless loop of opening the organizer. </p> <p>here is my code in the organizer now currently is searches device to open by package name and if not present directs user to market to download it.</p> <pre><code>public void onClick(View v) { tracker.trackEvent( "Clicks", // Category "Button", // Action "Pipe", // Label 77); tracker.dispatch(); try { Intent i = new Intent(Intent.ACTION_MAIN); PackageManager manager = getPackageManager(); i = manager.getLaunchIntentForPackage("com.pipe.fittings.kevin"); i.addCategory(Intent.CATEGORY_LAUNCHER); startActivity(i); } catch (Exception e) { passIntentToMarket("com.pipe.fittings.kevin"); } } }); </code></pre>
android
[4]
4,133,926
4,133,927
make enter button clickable?
<p>I have an <code>EditText</code> box and when you click it the soft keyboard comes up as usual, but how do make it so that when the enter button gets pressed it performs a action like your pushing enter, search, or go?</p> <p>thank you.</p>
android
[4]
1,099,447
1,099,448
Convert String to a JMS BytesMessage in Java
<p>I am trying to convert a String to a JMS BytesMessage. Is there a good way to do this? </p> <p>I need to do this because I have a method that takes in a String that is decrypted and I need to convert it into a BytesMessage in order to decrypt the message.</p> <p>Thanks</p>
java
[1]
725,856
725,857
column value in datagridview
<p>i use these following codes to get cell's value in datagridview. these codes show me each cell has been clicked. i want to use some codes just show me special column for example column with index 1 but these codes show me each which has been clicked. Imagine i just want to show column 1 with it's clicked cell. please help me to solve this</p> <pre><code>string str = dataGridView1.CurrentCell.Value.ToString(); </code></pre> <p>Thanks in advance</p>
c#
[0]
3,385,895
3,385,896
c++ fork, without wait, defuncts execl
<p>Looking to fork a process, in c++, that wont hang its parent process - its parent is a daemon and must remain running. If i wait() on the forked process the forked execl wont defunt - but - it will also hang the app - not waiting fixes the app hang - but the command becomes defunt.</p> <pre><code>if((pid = fork()) &lt; 0) perror("Error with Fork()"); else if(pid &gt; 0) { //wait here will hang the execl in the parent //dont wait will defunt the execl command //---- wait(&amp;pid); return ""; } else { struct rlimit rl; int i; if (rl.rlim_max == RLIM_INFINITY) rl.rlim_max = 1024; for (i = 0; (unsigned) i &lt; rl.rlim_max; i++) close(i); if(execl("/bin/bash", "/bin/bash", "-c", "whoami", (char*) 0) &lt; 0) perror("execl()"); exit(0); } </code></pre> <p>How can I fork the execl without a wait(&amp;pid) where execl's command wont defunct? </p> <p><strong>UPDATE</strong> Fixed by adding the following before the fork</p> <pre><code>signal(SIGCHLD, SIG_IGN); </code></pre> <p>Still working with my limited skills at a more compatible solution based on the accepted answer. Thanks!</p>
c++
[6]
4,178,231
4,178,232
Jquery- Hide div
<p>I have a div inside form something like</p> <pre><code>&lt;form&gt; &lt;div&gt; showing some information here &lt;/div&gt; &lt;div id="idshow" style="display:none"&gt; information here &lt;/div&gt; &lt;/form&gt; </code></pre> <p>i am population information inside div(idshow) on some button click event. what i want whenever i ill click outside div(idshow), it should be hide. just like i click on menu then menu is display and when i click outside menu it goes hide. I need everything using jquery</p>
jquery
[5]
3,055,244
3,055,245
Android Charting Package that supports annotating data points/animating image
<p>I am using AndroidPlot library for a data display that plots the vehicle distance travelled versus the vehicle elevation. Every 5 data point displayed on the graph requires that the grade value of the road be displayed. Finally a truck icon image needs to be animated on the left side of the screen that needs to rotate depending on the slop of the line.</p> <p>I've posted on the Android plot forum that I am able to annotate points on the graph but the annotations disappear after the graph runs for a minute. </p> <p>I'm also concerned that I won't be able to animate the truck image "over or above" the graph image. The graph is in a relative layout for this case.</p> <p>Does anybody know of a charting package that supports annotating data points and animation? The charting package can be open source or commercial. </p> <p>I'm aware that a question regarding available android charting packages are avaialable. It would be good to know what plotting library supports data point annotation and animation.</p>
android
[4]
3,529,541
3,529,542
Javascript not working
<p>I have a JavaScript function, in this function i will write</p> <pre><code>&lt;script type='text/JavaScript' language='JavaScript'&gt;alert('ha')&lt;/script&gt; </code></pre> <p>But while executing this page it doesn't work. This is my code</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;script language="javascript" type="text/javascript"&gt; function asd() { document.write("&lt;script language='javascript' type='text/javascript'&gt;alert('asdasd');&lt;/" + "script&gt;"); } &lt;/script&gt; &lt;/head&gt; &lt;body onload="asd();"&gt; &lt;span id="gdfg"&gt;&lt;/span&gt; &lt;span&gt;dgdfghfghfghfg&lt;/span&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript
[3]
5,835,377
5,835,378
map() get() confusion
<p>I'm just going through the jQuery API and I'm a bit confused on map() &amp; get() method. I know I'm wrong but the map() method looks a lot like an .each() statement? Except the documentation says it returns a new jQuery object. I've been playing with this on jsfiddle trying to get my head around it, but I'm not quite there. <a href="http://jsfiddle.net/BnP45/">here</a> is the jsfiddle link: </p> <p>Also here is the snippet of code:</p> <pre><code>$.fn.equalizeHeights = function() { var two = $(this).map(function(i, e) { return $(e).height(); }); console.log(two); console.log(two.constructor); console.log(two.get()); console.log(two.get().constructor); return this.height(Math.max.apply(this,two.get())); } $('input').click(function() { $('div').equalizeHeights(); }); </code></pre> <p>I see they are extending jQuery using prototype to create a function called 'equalizeHeights()'. And $(this) represents the selector for all the 'div' elements on the page. The map() call iterates through each of the items in the array of divs and returns its height? But what I'm confused about is what I'm logging to the console. One is an object and the other is an array? Could someone elaborate on what map() and get() are doing in this snippet of code? </p> <p>Thanks in advance.</p>
jquery
[5]
5,674,822
5,674,823
what is my appID on developer.paypal
<p>I want to create a paypal functionality on android. I have created a test sandbox account at developer.paypal.com</p> <pre><code>i want to use this fuction in my coding:- PayPal pp = **PayPal.initWithAppID(this, "what should i write here",PayPal.ENV_SANDBOX);** please tell me what should i write in second argument.? i have error in project that Error: **Authentication failed, button not enabled.** </code></pre> <p>Thank you in advance.</p>
android
[4]
2,228,619
2,228,620
How to find if a file is an exe?
<p>How can I be sure that a file passed to my program is a valid exe file ?</p> <p>actually my program takes a file as input and runs it, but user can input any file so I have to make sure that the input is a valid exe.</p>
c#
[0]
989,172
989,173
Android ProgressDialog not working.when creating a new activity
<p>i've searched most of the "progressDialog not working" threads here but none of the answers seem to work for me.</p> <p>I'm trying to create a new activity that calls a method which executes on a different thread (takes up to 30-5o seconds).</p> <pre><code>public class FLActivity extends ListActivity { private ProgressDialog mProgressDialog; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mProgressDialog = ProgressDialog.show(FLActivity.this, "", "Loading..."); OtherClass.LongDurationMethodWhichStartsAWorkedThread(); mProgressDiagog.dismiss(); } } </code></pre> <p>The long duration method is:</p> <pre><code>// in some other class public static LongDurationMethodWhichStartsAWorkedThread() { Runnable r = new FFThread(); Thread thread = new Thread(r); thread.start(); try { thread.join(); } catch (InterruptedException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } </code></pre> <p>I've used thread.join() to wait for the worker thread to execute and then continue.</p> <p>However, no message is displayed.</p> <p>Can anyone see the problem?</p>
android
[4]
3,805,803
3,805,804
Append information to TableLayout in Thread
<p>I am trying to figure out how to access the View from a thread in my MainActivity class. I need to be able to append information to the table every 5 seconds as it is gathered. How would I go about doing this when the function is in a <code>Thread()</code>?</p> <p>Thanks.</p>
android
[4]
273,004
273,005
Android Animated App Walkthrough
<p>I have a project where my customer asked to create animated help for each screen. What he means by animated help is the one like when you start a new emulator, it shows a hand that tells you what to do. I would really appreciate your help guys if you can give me any clues where to start.</p> <p>Thank You</p>
android
[4]
1,798,868
1,798,869
To avoid bugs is it necessary to erase the stack?
<p>What do you need to do to clean up an int or char (not a pointer)? </p> <p>Is it necessary to clean up this type of data after use?</p> <p>sample ex:</p> <pre><code> // MAX = 100 ; class Simple { int a[ MAX ] ; public : ~Simple ( ) ; ... // some declaration to fill, initialize ... }; </code></pre> <p>Is it essential to clean up data on the stack, e.g. the array <code>a[ MAX ]</code> in the example?</p>
c++
[6]
5,410,425
5,410,426
illegal forward reference in java
<pre><code> import java.io.*; import jxl.*; class Xlparsing { Workbook wb =wb.getWorkbook(new File( "C:\\Documents and Settings\\kmoorthi\\Desktop\\ak\\new.xls")); // Illegal forward reference What it means Sheet st = wb.getSheet(0); Cell cell1 = st.getCell(0,0); String a1 = cell1.getContents(); public static void main(String s[]) { System.out.println(new Xlparsing().a1); } } </code></pre> <p>Hi When i tried to extract data from excel sheet illegal forward reference error comes in the file object creation please resolve this . Thanks in Advance</p>
java
[1]
301,707
301,708
UTF-8 and JTextArea
<p>i have 2 JTextArea that one of these contain Unicode Code point like this \u0645 i want another JTextArea </p> <p>show Character representation of this Unicode code point.but when pass this code point to JTextArea , it show</p> <p>code point not Character but if i set code point to JTextArea setText method directly it work correctly !</p> <p>why ? and which can i pass String of Codepoint from one JTextArea to another ?</p> <p>thanks</p>
java
[1]
4,134,013
4,134,014
Home screen takng time to load after the application in android
<p>i have an application which i have made. Once i use this application for sometime and if i press the home screen, it takes the home screen sometime to load and a progress dialog appears telling me that it's loading.</p> <p>My application is not a graphics intensive application. It just parsers data from the an XML and displays.</p> <p>Is is because of the coding of my application that the home screen is taking time to load?</p> <p>thank you in advance.</p>
android
[4]
2,984,649
2,984,650
issue with using std::copy
<p>I am getting warning when using the std copy function.</p> <p>I have a byte array that I declare. </p> <pre><code>byte *tstArray = new tstArray[length]; </code></pre> <p>Then I have a couple other byte arrays that are declared and initialized with some hex values that i would like to use depending on some initial user input. </p> <p>I have a series of if statements that I use to basically parse out the original input, and based on some string, I choose which byte array to use and in doing so copy the results to the original tstArray.</p> <p>For example:</p> <pre><code>if(substr1 == "15") { std::cout&lt;&lt;"Using byte array rated 15"&lt;&lt;std::endl; std::copy(ratedArray15,ratedArray15+length,tstArray); } </code></pre> <p>The warning i get is warning C4996: 'std::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct.</p> <p>A possible solution is to to disable this warning is by useing -D_SCL_SECURE_NO_WARNINGS, I think. Well, that is what I am researching.</p> <p>But, I am not sure if this means that my code is really unsafe and I actually needed to do some checking?</p>
c++
[6]
2,237,909
2,237,910
Images fades into each other in slider
<p>I'm working on a jQuery slider. Currently, the images are fading out, and then the next image in the slider fades in. But what I would need, is the images the be fading into each other. So I won't see the page background during the transition.</p> <p>Here's my jQuery code :</p> <pre><code>$('.slider .slide:first').addClass('active').fadeIn(900); function rotate(index) { $('.slider .slide.active').removeClass('active').fadeOut(900, function() { $('.slider .slide:eq(' + index + ')').addClass('active').fadeIn(900); }); } $('.slider-nav li').click(function() { clearInterval(timer); $(this).siblings('.active').removeClass('active'); $(this).addClass('active'); var index = $(this).index('li'); rotate(index); timer=setInterval(go, 5000); return false; }); $('.slider-nav li:first').click(); var timer=setInterval(go, 5000); function go() { var $next = $('.slider-nav li.active').next(); if ($next.length == 0){ $next = $('.slider-nav li:first'); } $next.click(); } </code></pre> <p>Any idea? Thank you!</p>
jquery
[5]
3,799,512
3,799,513
Android webview: How do I get the double tab to zoom IN and not OUT
<p>I have a webview that starts with a zoom level of 100. When I double tap, it zooms out. How can I make it zoom IN on the first double tap?</p>
android
[4]
1,776,262
1,776,263
Scroll bar is not showing the whole screen
<p>I have created a scroll bar using the following XML:</p> <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scroll" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"&gt; &lt;!--added more layout inside this--&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>Now when I'm running my app its showing black screen below the layout if my app is not filled the whole screen.</p> <p>Does anybody know why this might be happening?</p>
android
[4]
5,393,520
5,393,521
Android app - how to display a list of items and make them clickable
<p>I need to display a list of text items to the screen and make them clickable. So it would be something like a list of links on a web application.</p> <p>How can I do that in an Android Activity screen? </p> <p>It would be some random number of items that I have to pull from a db and display all as links.</p> <p>Any idea how that can be done?</p> <p>Thanks!</p>
android
[4]
6,019,251
6,019,252
computedStyle for -webkit-column-count
<pre><code>document.defaultView.getComputedStyle(div, null).webkitColumnCount </code></pre> <p>this JavaScript gives me the correct column count when explicitly stating it in my CSS, but if I don't state the count in CSS - this property will return 'auto'.</p> <p>I am wondering if there is anyway of returning the number of columns, even though the -webkit-column-count is in 'auto' mode. (as these columns still technically exist).</p>
javascript
[3]