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
5,255,381
5,255,382
Jquery table filter
<p>I am trying to filter table results from Table B by clicking on a field in Table A using jquery. Table B contains all the data from a specific database and Table A just contains one of the fields. For example,</p> <pre>Table A MFG_Name |Count Dell | 15 Gateway|10</pre> <p>Clicking on Dell would filter all the results from Table B where MFG_Name = Dell and show them below Table A as follows:</p> <pre>Table B Inventory_No | MFG_Name | Model_Name | Description 0001 | Dell |Inspiron |Desktop 0002 | Dell |Optiplex |Desktop</pre> <p>how can I go about doing this? I've looked at using plugins that filter tables but my goal is not to have to print Table B until I have filtered it as it could contain 100000+ inventory numbers.</p>
jquery
[5]
1,118,310
1,118,311
How to get the amplitude when blowing into MIC on android device
<p>How to get the amplitude when blowing into MIC in android device.</p> <pre><code>MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); Timer timer = new Timer(); timer.scheduleAtFixedRate(new RecorderTask(recorder), 0, 1000); private class RecorderTask extends TimerTask { private MediaRecorder recorder; public RecorderTask(MediaRecorder recorder) { this.recorder = recorder; } public void run() { Log.v("", "amplitude is" + recorder.getMaxAmplitude()); } } </code></pre> <p>I am getting an error: </p> <pre><code>ERROR/AndroidRuntime(20927): Caused by: java.lang.RuntimeException: setAudioSource failed. ERROR/AndroidRuntime(20927): at android.media.MediaRecorder.setAudioSource(Native Method) </code></pre>
android
[4]
1,758,269
1,758,270
Insert image after a link
<p>I have a large table that one column contains e-mail addresses (+/- 60), and I was told to add an e-mail icon after each address. I have been trying to use <code>anchors</code>,<code>.href</code> and <code>.indexof</code> to select the e-mail links, but have gotten no where (hence no code).</p> <p>Can I get assistance on how to add <code>&lt;img src="/a/path/email.jpg" alt="e-mail" /&gt;</code> if the link's <code>href</code> contains a <code>mailto</code> using <strong>vanilla JavaScript</strong>, <em>no jQuery</em>.</p>
javascript
[3]
5,056,159
5,056,160
code snippet to display list of friends failing?
<p>I have those code snippet that checks the fans table and gets everyone who has fanned you. It then checks if you have fanned them as well and if so it displays their username and profile picture. </p> <p>It check if you have fanned them using $count I'm assuming this is where it's tripping up. but firebug isn't showing any errors.</p> <pre><code>&lt;?php $friendlist = mysql_query("SELECT * FROM fans WHERE username='$user'") or die(mysql_error()); while($row = mysql_fetch_array($result1)) { $friendname = $row['fanned']; $friendlist2 = mysql_query("SELECT * FROM fans WHERE username='$friendname' AND fanned='$user'") or die(mysql_error()); $count = mysql_num_rows($friendlist2); if($count == 1 ){ $avatar = mysql_query("SELECT * FROM users WHERE username='$friendname'") or die(mysql_error()); while($row3 = mysql_fetch_assoc($avatar)) { $filename = $row3['avatar']; if($filename != "") { $friendpic = '&lt;img id="headeravapic" src="profileavatars/' . $friendname . "/" . $filename . '" /&gt;'; } else { $friendpic = '&lt;img id="headeravapic" src="images/nopic.PNG" /&gt;'; } echo '&lt;div align="center" id="onlinepic"&gt;' . $friendpic . '&lt;p /&gt;' . $friendname . '&lt;/div&gt;'; } } }?&gt; </code></pre>
php
[2]
791,121
791,122
why "" is not empty?
<p>I am trying this code:</p> <pre><code>&lt;?php $form = $_POST['myformdata']; class validacoes { function validate_year($form) { $input_datas = $form['data']; foreach($input_datas as $val){ if($val&gt;1930 &amp;&amp; $val&lt;2012){ echo "correct"; } else echo "bad"; //show bad bad } } } $val = new validacoes(); $data = array(); var_dump($form['data']); try { if (!empty($form['data'])){// why this is true ? $data['livre'] = $val-&gt;validate_year($form); } else echo "empty"; } catch (Exception $e) { $data['livre'] = $e-&gt;getMessage(); } echo json_encode($data); ?&gt; </code></pre> <p>//var_dump</p> <pre><code>var_dump($form['data']); array 0 =&gt; string '' (length=0) 1 =&gt; string '' (length=0) </code></pre> <p>Why the function <code>validate_year($form)</code> is running without any input ? should be empty, correct ?</p>
php
[2]
4,055,060
4,055,061
How can I programmatically get memory, thread and CPU usuage from within my Java application?
<p>The question says it all!</p> <p>How can I programmatically get memory, thread and CPU usuage from within my Java application?</p> <p>Thanks</p>
java
[1]
1,236,684
1,236,685
Java, Create array if it doesn't already exist
<p>I couldn't find anything on that while googling so I want to create an array only if it doesn't already exists.</p> <p>EDIT: I mean not initialized</p> <p>I know how to check for values in the array</p> <p>Should be simple but I'm stuck</p> <p>best regards</p> <pre><code>static long f(long n) { int m = (int)n; **if (serie == null) { long[] serie = new long[40]; }** if (n == 0) { return 0; } else if (n==1) { return 1; } else { long asdf = f(n-1)- 2*(f(n-2)) + n; return asdf; } } </code></pre> <p>something like that a recursive function and I want to save the values in an array </p>
java
[1]
2,400,549
2,400,550
Honeycomb Hardware Acceleration
<p>I'm a little confused about the Honeycomb hardware acceleration. The documentation says to add a line to your manifest, but then it talks about hardware backing layers for views. If I simply add the manifest line, am I turning it on application-wide everywhere by default, or do I have to also turn it on for all the views in my app?</p> <p>Thanks!</p>
android
[4]
4,967,793
4,967,794
Need help using John Resig’s Simple Javascript Inheritance
<p>John Resig’s Simple Javascript Inheritance: <a href="http://ejohn.org/blog/simple-javascript-inheritance/" rel="nofollow">http://ejohn.org/blog/simple-javascript-inheritance/</a></p> <p>I tried to do such thing:</p> <pre><code>var SomeClass = Class.extend({ init: function() { var someFunction = function() { alert(this.someVariable); }; someFunction(); // should alert "someString" }, someVariable: "SomeString" }); var someClass = new SomeClass(); </code></pre> <p>This should alert "someString", but it doesn't because inside the closure function <strong>someFunction</strong>, the value of <strong>this</strong> doesn't refers to the class, it is changed. <strong>That makes me unable to get access to the properties and functions of the class inside a closure function.</strong></p> <p>Any suggestions?</p>
javascript
[3]
1,558,140
1,558,141
C# easy way to convert a split string into columns
<p>This is a rough one to explain. What I have is a string, </p> <pre><code>string startString = "Operations\t325\t65\t0\t10\t400" string[] splitStart = startString.Split('\t'); </code></pre> <p>I need to turn this into</p> <pre><code>Operations|325 Operations|65 Operations|0 Operations|10 Operations|400 </code></pre> <p>The problem is i need this so be dynamic to if it has 10 splits I need it to do the same process 10 times, if it has 4, then it needs to do 4.</p> <p>Any help would be awesome.</p> <p>Sorry for any confusion, Operations is just this string, so it's not static. It really need to be [0] of the string split.</p>
c#
[0]
4,190,793
4,190,794
reading value from registry and storing it in a bin file
<p>I am writing a C# module; and I need to retrieve the value of a key called 'LicenseKey' from the registry path 'HKEY_LOCAL_MACHINE/Software/Avtec, Inc/LicenseKey' and store the value in a bin file called "pml.bin"</p> <p>I have some problems with the code. Can anyone help me with the code? Thanks in advance. </p>
c#
[0]
608,733
608,734
jQuery height problem
<p>Probably error, my jQuery/JS isn't all that. Any ideas how to make this work? Currently it is correctly setting the background colour, but the height remains the same :(</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { var inside_height = $(".inside").height() - 500; $(".artists").height(inside_height).css(backgroundColor:"green"}); }); &lt;/script&gt; </code></pre> <p>Thanks!</p>
jquery
[5]
1,611,732
1,611,733
How to get first character of string?
<p>I have a string, and I need to get its first character.</p> <pre><code>var x = 'somestring' alert(x[0]); //in ie7 returns undefined </code></pre> <p>How can I fix my code?</p>
javascript
[3]
2,414,965
2,414,966
jQuery selector question. Select all nodes that do NOT START with (string)
<p>Trying to assemble a rather complex jQuery selector here, and having trouble.</p> <p>Essentially, I'm trying to grab all anchors that that 1) do not have a "rel" of "facebox", <strike>and</strike> <strong>OR</strong> 2) do not have an "href" that begins with "mailto".</p> <p>This is what I've been trying to do:</p> <pre><code>$('a[rel!=facebox], a[href!^="mailto"]') </code></pre> <p>Small variations of this don't seem to work. Is there some better way of going about this?</p> <p>These selectors seem to work individually, but not when sitting consecutively in the same selector:</p> <pre><code>$('a:not([rel=facebox]), a:not([href^=mailto])') </code></pre> <p><strong>Final solution:</strong> We have a winner!</p> <pre><code>$('a:not([rel=facebox],[href^=mailto])') </code></pre>
jquery
[5]
3,684,386
3,684,387
When do I use struct instead of having class in c#?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/85553/when-should-i-use-a-struct-instead-of-a-class">When should I use a struct instead of a class?</a> </p> </blockquote> <p>By Venkat K in the C# .NET forum. </p> <p>29-Apr-09 07:38 AM</p> <blockquote> <p>The only difference between "class" and "struct" is that a struct defaults to having public members (both data members and function members) and a struct defaults to public inheritance, whereas a class defaults to private members and private inheritance. That is the only difference. This difference can be circumvented by explicitly specifying "public", private", or "protected" so a struct can be made to act like a class in ever way and vice versa.by convention, most programmer's use "struct" for data types that have no member functions and that do not use inheritance. They use "class" for data types with member functions and inheritance. However, this is not necessary or even universallly acepted. </p> </blockquote> <p>*(Can this be true)</p>
c#
[0]
2,599,826
2,599,827
jQuery: Making a Favorite button with function?
<p>Right now i made this:</p> <pre><code>&lt;a href="#" title="[+] Add as favorite"&gt;&lt;div class="addFavorite"&gt;&lt;/div&gt;&lt;/a&gt; </code></pre> <p>the class="addFavorite", is a normal grey star.</p> <p>Then i have another class="AlreadyFavorite", that is a yellow star. </p> <p>I want to make a function, so when you click on the grey star, it sends an ajax call(?) and then on success it turns yellow(changing class to AlreadyFavorite).</p> <p>I know how to make a onclick function that send a ajax call, but how do i change the style/change the image icon to yellow?</p> <p>CSS:</p> <pre><code>.addFavorit{ background: url('../images/addFavorit.png'); width: 48px; height: 48px; } .alreadyFavorit{ background: url('../images/addFavorit_hover.png'); width: 48px; height: 48px; } </code></pre>
jquery
[5]
1,112,321
1,112,322
Set css style on DataListItem render as Td element of table
<p>I use clasic asp.net 4.0. I have big problem with set at DataListItem element css style. This item are render as td so I think that it will be easy, but is not :/</p> <p>U use code like: </p> <pre><code>&lt;%# (((DataListItem)Container).Styles["border-color"] = "Red")==""?"":"" %&gt; </code></pre>
asp.net
[9]
1,452,697
1,452,698
How can i notify the user if battery is need to be replace in android
<p>I want to develop an android application that will tell me if the battery of the phone is in good condition or if it needs to be replaced. can someone shed some light for me? I'm looking for an api for this but i cant seem to find one...</p> <p>is this correct sir? </p> <pre><code>public class BatteryInformationActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); Intent batteryStatus = registerReceiver(null, ifilter); if (batteryStatus.hasExtra(BatteryManager.EXTRA_HEALTH)) { int health = batteryStatus.getIntExtra(BatteryManager.EXTRA_HEALTH, BatteryManager.BATTERY_HEALTH_GOOD); if (health != BatteryManager.BATTERY_HEALTH_GOOD) { Toast.makeText(this, "Battery has a problem", Toast.LENGTH_SHORT).show(); } } } } </code></pre>
android
[4]
2,950,080
2,950,081
How to choose the right PHP Framework for web development?
<p>I'm a PHP Pro, but haven't use any PHP framework till now, so I have no clue on how to choose a PHP framework. Do you have some tips to help me choose the/a right PHP Framework?</p> <p>I want a stable and secure PHP framework for Projects with about 400 hours development time. It should be possible to use the framework on Shared-Hosting-Webservers. I don't need some AJAX support (I'm using extJS). It would be nice if the framework supports Rapid Application Development and object-relational mapping.</p> <p>Also some of the standard-functions (Authentification, form validation) would be nice. Caching would be a useful, but isn't needed.</p> <p>Needs for a <a href="http://www.phpkode.com/projects/category/php-development-framework/" rel="nofollow">PHP framework</a>:</p> <ul> <li>Shared-Hosting-Webserver-Support</li> <li>for Projects between 200 und 400 hours work</li> <li>Developing Modell "Rapid Application Development" supported</li> <li>object-relational mapping supported</li> </ul> <p>If possible:</p> <ul> <li>Caching</li> <li>Already finished Modules (e.g. Authentification, form validation, ..)</li> <li>Easy to learn</li> </ul> <p>Which PHP framework is the right one I am seeking for?</p>
php
[2]
2,711,449
2,711,450
Function scopes and global variables
<pre><code>var foo = '1', bar = '2'; console.log(foo, bar, window.foo); //1, 2, undefined (function(foo){ console.log(foo, bar); //2, 2 })(bar); </code></pre> <p>I have two trivial questions regarding the code above:</p> <ol> <li><p>Why is <code>window.foo</code> undefined? Aren't all global variables attached to the window object by default?</p></li> <li><p>Why is <code>foo ===</code>2 inside of the closure? I know that I'm passing the original <code>bar</code> with the alias <code>foo</code>, which is <code>2</code>, but outside of the function scope <code>foo</code> is still <code>1</code>. And as far as I know, the original <code>foo</code> can be accessed from inside of the closure as well. Is the "new foo" prioritized since it's passed as an argument to the IIFE?</p></li> </ol> <p><a href="http://jsfiddle.net/GbeDX/" rel="nofollow">http://jsfiddle.net/GbeDX/</a></p>
javascript
[3]
1,791,791
1,791,792
How to allow to make call for some contacts only?
<p>i am new to Android Application Development.</p> <p>I developed on application which represents retrieve the contacts from device and made call any one of those.I install that .apk file in my device,it is working good.</p> <p>But my requirement is I have to allow for some contacts only to make call ,means i have to control to make call for some contacts.</p> <p>please help to go forward.</p> <p>thank you,</p> <p>bye..</p>
android
[4]
5,193,624
5,193,625
How can I make my PHP script run at a certain time everyday?
<p>I have a PHP script that checks my database's code for validity. How can I have this run everyday at a certain time so then I can just have it run on autopilot.</p>
php
[2]
5,112,500
5,112,501
iPhone: Instruments 4.1 debugging tool tutorial
<p>I know there are so many questions like same. Someone might say this is a duplicate. But, the problem is, i am not finding any official and clear tutorial/doc, how to use Instruments 4.1(from Xcode 4.1) and find out the app crashes. My app crashes randomly with different reasons, but i'm not able to find out exactly what is the problem and where? As i'm new to Instruments, i don't know how can i find the functions where the crash might happened through Instruments.</p> <p>Please advise and suggest which tutorial is good to study to see the reason for the crashes through Instruments.</p> <p>Thank you!</p>
iphone
[8]
3,846,244
3,846,245
Write a file in android?
<p>I get my raw resource:</p> <blockquote> <p>InputStream myRawResource = context.getActivity().getResources().openRawResource(myID);</p> </blockquote> <p>How can I write this to a file? An MP3 file on the device.</p>
android
[4]
3,441,379
3,441,380
Using jquery $.each with multiple selectors
<p>I want get all the accesskeys that are on a button or link. I have the following.</p> <pre><code>$(":button[accesskey!=''], :a[accesskey!='']").each(function(i) { //code }); </code></pre> <p>You can see it here <a href="http://jsfiddle.net/QNPZU/" rel="nofollow">http://jsfiddle.net/QNPZU/</a></p> <p>I thought you could have multiple selectors by separating them using a comma but the above code does not work.</p> <p>If I do </p> <pre><code>$(":*[accesskey!='']").each(function(i) { //code }); </code></pre> <p>it will work, but I take it there will be a performance problem if the dom is huge?</p>
jquery
[5]
4,345,219
4,345,220
Writing in text view of different tabs in android
<p>I have to manage different text views in tabs for chatting in android.In my code if a list item is clicked new tab will be generated having one text view one EditText box and a button.With the construction of the tab a new class having will be initialized which will check whether there is any new message or not after every 30 seconds.If new message comes then this will write to that specific text view of the tab.My sample code is follwing:<code>ForPractice fp=new ForPractice(tabHost,"abcd");</code>When a tab is created this class is called.In its constructor I am sending tabtag and tabhost.And this class consists of following code: `public class ForPractice implements Runnable{ String str; Thread thrd; TabHost host;</p> <pre><code>public ForPractice(TabHost tabHost,String name) { str=name; thrd=new Thread(this, name); this.host= host; thrd.start(); } @Override public void run() { while(true) { try { str="This is for test\n"; thrd.sleep(30000); str=""; test(); } catch (Exception e) { // TODO Auto-generated catch block System.out.println(e.getMessage()); } } } private void test() { // get tab by tab, where tag=str (passed during the constructor) // access the textview in this tab // append text(str) in that textview } </code></pre> <p>}`----My question is how to do the codes in 'private void test()';</p>
android
[4]
2,255,682
2,255,683
jQuery - detect when 'replace' function performs action
<p>I use the jQuery replace function to ensure that users can only enter digits and hyphens into the phone number field (its a private web app, and JS has to be enabled to login). </p> <p>I want to add a css class (highlight red) to the input for x seconds after the replace function is fired so the user sees visually that the input is rejecting there input.</p> <p><strong>How do I add a css class to the input for x seconds after the replace function is activated? (only when a input is actually replaced)</strong></p> <pre><code>$("#v_phone").bind('keyup blur',function(){ $(this).val( $(this).val().replace(/[^\d-]/g,'') ); } ); </code></pre>
jquery
[5]
2,010,702
2,010,703
Open a file without loading it into memory at once
<p>Hi I have a problem to solve for college and I have a hard time understanding the sentence of the problem.</p> <p>This is the problem I have :</p> <blockquote> <p>Reverse the order of bytes from a file without loading the entire file into memory at once.You have to solve this problem in C# , Java , PHP and Python.</p> </blockquote> <p>Now there are two things that I do not understand here.</p> <p>First I am not sure if bytes refer to the actual characters of the file , or to something else.The problem does not state if it is a text file or not.</p> <p>Second I am not sure how to open a file without actualy loading into memory.</p> <p>This is how I would normaly approach this problem , but I think if I do it this way the file gets loaded into memory:</p> <pre><code> string fileName = 'file.txt'; reader = new StreamReader(fileName); string line; while ((line = reader.ReadLine()) != null) { Console.WriteLine(line + "\n"); } </code></pre> <p>Also I am not sure how I would actualy reverse all the characters if I am reading it one line at the time.</p> <p><strong>EDIT</strong> Sorry for posting in multiple languages I do not want the solution for the problem I only want to clarify it so I can solve it myself.I assumed that because I have to solve it in four different languages the concept would apply to all 4 and it did not matter who answer</p>
c#
[0]
1,786,167
1,786,168
How Can i Call an application which is on Desktop?
<p>I have a Server basically Apache Tomcat Server</p> <p>My Desktop is connected to the server</p> <p>I want my request which comes from browser to be redirected to the Desktop Via server</p> <p>Can any one tell me how can i do it?</p> <p>I got my solution... I amUsing RMI or even Socket Programming is an option to achieve what i want Thanks</p>
java
[1]
2,231,816
2,231,817
Different results using atoi
<p>Could someone explain why those calls are not returning the same expected result?</p> <pre><code>unsigned int GetDigit(const string&amp; s, unsigned int pos) { // Works as intended char c = s[pos]; return atoi(&amp;c); // doesn't give expected results return atoi(&amp;s[pos]); return atoi(&amp;static_cast&lt;char&gt;(s[pos])); return atoi(&amp;char(s[pos])); } </code></pre> <p><strong>Remark</strong>: I'm not looking for the best way to convert a <code>char</code> to an <code>int</code>.</p>
c++
[6]
5,468,915
5,468,916
check if an app work on jailbreak device
<p>I have one free app and hope to inform the users to upgrade app when there is new version. But I need to detect if the app works on a jailbreak device. Is there a way to check if an app work on jailbreak device? I try to read the info of Info.plist, but failed.</p> <p>Welcome any comment</p>
iphone
[8]
3,016,958
3,016,959
jQuery - As soon as a element is visible - Like Document.Ready
<p>with jQuery is there a way to say, instead of doc ready, as soon as this item is visible do XXXXXXX?</p> <p>Reason why is I have an app with 3 panels. The first panel by default is hidden and has a carousel. The carousel breaks if it is initiated when not visible. So I'd like to say as soon as the carousel or the div is visible, initiate the carousel.</p> <p>Thanks</p>
jquery
[5]
4,145,578
4,145,579
It will be black screen on app start if the apk has been signed
<p>My app works fine in debug mode but if I build a signed apk with the same code it will be black screen when it opens.</p> <p>This situation only appeard in android 4.0.3/samsung Galaxy II and 2.3.X with the same phone has no problem.</p> <p>Why? How to fix it?</p>
android
[4]
549,625
549,626
jQuery - if two classes - get the first one
<p>Example:</p> <p>Here we have <code>&lt;p class="tab1 current"&gt;&lt;/p&gt;</code></p> <p>How can I get only the first class?</p> <p><code>var GetFirstClass = $('p').attr('class').filter(':first');</code> ??</p> <p>Any help much appreciated. </p>
jquery
[5]
4,666,256
4,666,257
createObjectURL does not work in ie10
<p>I am reading a base64 encoded file from indexedDB and trying to link to it as a blob url. The code below works fine in Chrome but when I click the link in ie10 nothing happens. I can see on the properties of the link that the href is blob:66A3E18D-BAD6-44A4-A35A-75B3469E392B which seems right. Anyone see what I'm doing wrong?</p> <p>Download Attachment</p> <pre><code> //convert the base64 encoded attachment string back into a binary array var binary = atob(attachment.data); var array = []; for(var i = 0; i &lt; binary.length; i++) { array.push(binary.charCodeAt(i)); } //create a blob from the binary array var myBlob=new Blob([new Uint8Array(array)], {type: attachment.content_type}); //create a url hooked to the blob downloadURL = (window.webkitURL ? webkitURL : URL).createObjectURL(myBlob); //set the attachment link to the url $('#attachmentLink').attr("href", downloadURL); $("#attachmentLink").text(fileName); </code></pre>
javascript
[3]
5,699,056
5,699,057
How do I get the key of an item when doing a FOR loop through a dictionary or list in Python?
<p>I am new to Python.</p> <p>Say I have a list:</p> <pre><code>list = ['A','B','C','D'] </code></pre> <p>The key for each item respectively here is 0,1,2,3 - right?</p> <p>Now I am going to loop through it with a for loop...</p> <pre><code>for item in list: print item </code></pre> <p>That's great, I can print out my list.</p> <p>How do I get the key here? For example being able to do:</p> <pre><code>print key print item </code></pre> <p>on each loop?</p> <p>If this isn't possible with a list, where keys are not declared myself, is it possible with a Dictionary?</p> <p>Thanks</p>
python
[7]
1,844,123
1,844,124
What is the mathematical model of a Python's class?
<p>I understand that the classical model from the lambda-papers is not valid for Python.</p> <p>And the closures are not the mathematical model of the implementation of the Python system.</p> <p>So which model is it?</p>
python
[7]
430,120
430,121
how to get ul class name while clicking li - jquery
<p>How to get ul class name while clicking li - jquery</p> <pre><code>&lt;div class="div-class-parent"&gt; &lt;div class="div-class"&gt;test&lt;/div&gt; &lt;ul class="tabs"&gt; &lt;li class="node-205"&gt;&lt;/li&gt; &lt;li class="node-150"&gt;&lt;/li&gt; &lt;li class="node-160"&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p><strong>EDITED:</strong></p> <p><strong>For example when i clicking the "li" I need to get the class name of ul and class name of the div.</strong></p> <p>That is i need the class name "tabs" and "div-class".</p> <p>When i use the below code i get the parent class name of div that is i get "div-class-parent".</p> <pre><code>$('li').click(function() { alert($(this).closest('div').attr('class')); }); </code></pre> <p>How can this be done using jquery.</p> <p>thanks in advance...</p>
jquery
[5]
5,166,867
5,166,868
Android Junit test giving NULLpointer exception
<p>I have a question regarding Junit test case</p> <p>Let say I have 2 sepearate Junit classes each having its own setup and teardown These clases are in the same package</p> <pre><code>Package xyz; void setup() Class A { func A.f() } void teardown() Package xyz; void setup() Class B { func B.f() { A a = new A(); System.out.println(a.tostring()); } } void teardown() </code></pre> <p>My question is when i print this in the console, the new instantiated class a it shows null. Why is this so???</p>
android
[4]
679,454
679,455
splitting int from a string
<p>I have string with number on ints seperated by space delimiter. Can some one help me how to split the string into ints. I tried to use find and then substr. Is there a better way to do it ?</p>
c++
[6]
3,888,192
3,888,193
how to call startActivity(intent) from the phoneStateListener class?
<p>i am creating an application to send mail. I am using the class which extends the phoneStateListener class. this gives the problem at the time of startActivity function which says that "The method startActivity(Intent) is undefined for the type PhoneCallListener" where PhoneCallListener is a class extended by phonestatelistener and following code is written into it.</p> <pre><code> String to = "a.crack@gmail.com"; String subject = "testing"; String message = "this is it"; Intent email = new Intent(Intent.ACTION_SEND); email.putExtra(Intent.EXTRA_EMAIL, new String[]{ to}); email.putExtra(Intent.EXTRA_SUBJECT, subject); email.putExtra(Intent.EXTRA_TEXT, message); //need this to prompts email client only email.setType("message/rfc822"); startActivity(Intent.createChooser(email, "Choose an Email client :")); </code></pre> <p>please help me with how to start the activity so as to send my mail.</p>
android
[4]
3,545,086
3,545,087
jQuery.post establish data
<p>help solve the problem. We need to establish data for <code>jQuery.post</code> as: </p> <pre><code>{ var1:var1, var2:var2 } </code></pre> <p>from</p> <pre><code>&lt;div&gt;var1&lt;/div&gt; </code></pre> <p>... which can be from 1 to 5.</p> <p>I try: </p> <pre><code> var count = $('#hide').size(); var i; var arr = new Array(); var name = $('#hide').text(); for (i=0; i&lt;=count; i++){ arr.push(name); } </code></pre> <p>how establish data <code>{ var1:var1, var2:var2 }</code>?</p>
jquery
[5]
4,122,577
4,122,578
Which c++ sites do you prefer?
<p>just a simple question ... ist there a special board/forum .. or a blog you like . I'm new to c++ and i'd like to get deep in the matter :)</p> <p>so : what are the best c++ sites on this planet ? :)</p>
c++
[6]
700,945
700,946
android secure data storage
<p>i am developing one android application. it download videos from server and store it in mobile.</p> <p>i want to store those video in secure manner.(deny the user from copying. or deny them from viewing the video directly from sdcard)</p> <p>i found two ways to solve the problem.<br> 1)Store the video's inside the application.<br> 2)Encrypt the entire video</p> <p>but facing some problem in implementing solution<br> i)first solution found suitable. but i am fearing that. if we store too much video inside the application .it would become bulkier.and fore the user to uninstall. </p> <p>ii)but in second solution. i did not find any correct way to do so.</p> <p>so please help me to solve the problem. </p>
android
[4]
836,597
836,598
Jquery add / remove multiple attribute on select
<p>I want to change whether a user can select only, one or multiple options in a select box based on a tick box above. i.e. if the tick box is ticked the user can select multiple values, if not ticked they can only select one value. What is the best way to do this using jquery?</p>
jquery
[5]
3,951,441
3,951,442
suppress error using fread()
<p>I wrote a script for screen pops from our soft phone that locates a directory listing for the caller but occasionally they get "Can't read input stream" and the rest of the script quits.</p> <p>Does anyone have any suggestions on how to suppress error the error message and allow the rest of the script to run? Thanks!</p> <pre><code>$i=0; $open = fopen("http://www.411.ca/whitepages/?n=".$_GET['phone'], "r"); $read = fread($open, 9024); fclose($open); eregi("'/(.*)';",$read,$got); $tv = ereg_replace('[[:blank:]]',' ',$got[1]); $url = "http://www.411.ca/".$tv; while ($name=="unknown" &amp;&amp; $i &lt; 15) { ## try 15 times before giving up $file = @ fopen($fn=$url,"r") or die ("Can't read input stream"); $text = fread($file,16384); if (preg_match('/"name"&gt;(.*?)&lt;\/div&gt;/is',$text,$found)) { $name = $found[1]; } if (preg_match('/"phone"&gt;(.*?)&lt;\/div&gt;/is',$text,$found)) { $phone = $found[1]; } if (preg_match('/"address"&gt;(.*?)&lt;\/div&gt;/is',$text,$found)) { $address = $found[1]; } fclose($file); $i++; } </code></pre>
php
[2]
2,233,226
2,233,227
Android plurals treatment of "zero"
<p>If have the following plural ressource in my strings.xml:</p> <pre><code> &lt;plurals name="item_shop"&gt; &lt;item quantity="zero"&gt;No item&lt;/item&gt; &lt;item quantity="one"&gt;One item&lt;/item&gt; &lt;item quantity="other"&gt;%d items&lt;/item&gt; &lt;/plurals&gt; </code></pre> <p>I'm showing the result to the user using:</p> <pre><code>textView.setText(getQuantityString(R.plurals.item_shop, quantity, quantity)); </code></pre> <p>It's working well with 1 and above, but if quantity is 0 then I see "0 items". Is "zero" value supported only in Arabic language as the documentation seems to indicate? Or am I missing something?</p>
android
[4]
4,462,762
4,462,763
Javascript: parameter takes a random value when not passed in a callback function
<p>I am doing an ajax poll periodically. To achieve the same I have the following line of code:</p> <pre><code>window.setInterval(pollForBids, 5000); </code></pre> <p>The function pollForBids is defined as follows:</p> <pre><code>function pollForBids(supplierId){ alert(supplierId); $.ajax({ method: "GET", url : "/enterprize-sourcing/refreshBids.do", async : true, cache : false, data : {action : "refreshList", eventId : eventId, lastRetrieveTime: makeFinite(latestBidTime, 0), supplierId : makeFinite(supplierId, "")}, success: function(xml){ refreshBids(xml); } }); } </code></pre> <p>I have other places in the code where I need the parameter, but in this particular case I do not. But, the alert gives me a random integer value every 5 seconds. Shouldn't it always be undefined?</p>
javascript
[3]
2,409,224
2,409,225
Solaris10/F 9: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
<p>I have a java app which runs on Solaris9/CF7 and it is using dom4j library for parsing XML files. When testing the app on Solaris 10/CF 9 I get the following error:</p> <p>org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory </p> <p>It looks like the library is not included twice (I removed the library from the instance class path and I got an object instantiation error).</p> <p>Any ideas?</p> <p>Thanks. ags</p>
java
[1]
5,215,249
5,215,250
C# replace part of string but only exact matches possible?
<p>I have a <code>string beginString = "apple|fruitsapple|turnip";</code></p> <p>What I want to do is replace just apple with mango, not fruitsapple.</p> <p><code>string fixedString = beginString.Replace("apple","mango");</code> This doesn't work because it replaces both apple and fruitsapple.</p> <p>Any ideas?</p>
c#
[0]
2,946,409
2,946,410
Is there a way to open an iPhone app when there's an incoming call?
<p>Is there a way to open an iPhone app when there's an incoming call?</p>
iphone
[8]
4,586,481
4,586,482
jQuery: set opacity on div but don't apply to anchor tag inside div
<p>I need to be able to change the opacity of a div as people click on links (not inside the div). So I am setting the opacity to start with, and then changing it as need in my script.</p> <p>Here is my initial setting:</p> <pre><code>$('#config-title5a').css('background', '#ccc url(http://www.configureyourlaser.com/images/gradient.png) repeat-x 0 -10px').css({ opacity: 0.3 }); $('a#coolingtip').css({ opacity: 1.0}); </code></pre> <p><code>a#coolingtip</code> is the anchor inside the div, which is called <code>#config-title5a</code>. Currently, this script changes the opacity on everything. How do I get it to apply the opacity change to the div, but not the anchor tag inside the div?</p> <p>Here is the HTML:</p> <pre><code>&lt;div id="config-title5"&gt; Wavelength&lt;/div&gt; &lt;div id="config-title5a"&gt; &lt;a id="wavelengthtip" title="Wavelength" href="&lt;?php echo base_url(); ?&gt;application/views/tooltips/wavelengthtip.php" rel="&lt;?php echo base_url(); ?&gt;application/views/tooltips/wavelengthtip.php"&gt;Learn More ›&lt;/a&gt;&lt;/div&gt; </code></pre>
jquery
[5]
3,361,961
3,361,962
Extracting a part of string in java
<p><strong>I am having the following data in a text file:</strong></p> <pre><code> proc sort data=oneplan.cust_duplicates(dbindex=yes) out=mibatch.cust_duplicates; from oneplan.fsa_authorised_agencies (dbindex=yes) set oneplan.fsa_agency_permissions(where=(regulated_activity in ('103','106','107','108'))); set oneplan.customer_flags(where=(flag_id in(54,14,34))); from oneplan.document_history (dbindex=yes) set oneplan.product_references; proc sort data=oneplan.fast_track_log(where=(upcase(business_entry)="INCOME VERIFICATION FAST TRACKED")) out=fast_track_log; set oneplan.product_characteristics(rename=(value=filler)where=(characteristic_type="OFFS" )); set oneplan.mtg_offset_benefits (where=(modified_date between &amp;extractdate and &amp;batchcutoff) from oneplan.mtg_payment_options a; from oneplan.acc_retention_risk acr; from oneplan.acc_retention_risk_hist acr; from oneplan.account_repay_veh rv; from oneplan.repay_vehicle_map rvm; from oneplan.frozen_accounts as fa left join mibatch.accounts as a </code></pre> <p>Now i need to fetch the part from each line which starts with <code>oneplan.</code> and ends with a space. </p> <p>Also if the line has two <code>oneplan.</code> then each must be extracted separately.</p> <p>Example: <code>agtut oneplan.m htyutu oneplan.j hgyut</code></p> <p>i need the output as: <code>oneplan.m</code> and <code>oneplan.j</code></p> <p>kindly give me suggestions in doing this please...</p>
java
[1]
1,902,084
1,902,085
Using Class Template in Visual C++
<p>I wrote template which return matrix in Window Form Application .My template is below:</p> <pre><code> template&lt;class T&gt; class matrix1 { protected: public: T *data; const unsigned rows, cols, size; matrix1(unsigned r, unsigned c) : rows(r), cols(c), size(r*c) { data = new T[size]; } ~matrix1() { delete data; } void setValue(unsigned row, unsigned col, T value) { data[(row*cols)+col] = value; } T getValue(unsigned row, unsigned col) const { return data[(row*cols)+col]; } </code></pre> <p>I wrote this code in Main Project File in Windows Form Application.I defined 341*680 matrix with using this template :</p> <pre><code>matrix1&lt;double&gt;A(341,680); </code></pre> <p>I used function that do operation on this template and I defined it like this:</p> <pre><code>void function(matrix1&lt;double&gt; &amp;b,array&lt; double&gt;^ data) </code></pre> <p>And call it:</p> <pre><code>function(A,data); </code></pre> <p>(data is one dimensinonal data array that I have to use for my programming algorithm)</p> <p>For Example;When I want to print data that is located in the first row and first column.</p> <p>Visual C++ recognise <strong>getvalue</strong> and <code>setvalue </code> function ,but couldn't print anything and gave a lot of error interested with <strong>matrix1</strong> template</p> <p>I tried this template and function on <strong>CLR Console Application</strong> and it worked.How could I do this On Windows Form Application.And Where should I locate template class on Windows Form Application.</p> <p>Best Regards...</p>
c++
[6]
4,086,578
4,086,579
Handling Web User Control error on asp.net page
<p>How do you handle the Web User Control event? I notice my custom web user control have a event call OnError but it never fire when i tweak the control to fail. The control is basically a custom gridview control. I search for web user control event handling over the net but i haven't find a article that address what i looking for. Can someone do a quick explanation or point me to the right direction?</p> <p>thank</p>
asp.net
[9]
4,162,351
4,162,352
Accessing the default argument values in Python
<p>How can I programmatically access the default argument values of a method in Python? For example, in the following</p> <pre><code>def test(arg1='Foo'): pass </code></pre> <p>how can I access the string <code>'Foo'</code> inside <code>test</code>?</p>
python
[7]
1,759,593
1,759,594
How to post values to webservice in android
<p>I want to get some clues about posting the values to the webservice...</p> <p>When i post the values, i get the response in xml that has to be parsed. Any tutorials of posting the values to webservice will be of great help... </p>
android
[4]
3,592,734
3,592,735
how to download file from site (php)
<p>withought ftp.</p> <p>from site to my hosting folder. how i can do that?</p>
php
[2]
569,776
569,777
Copy Constructor with Java Interface
<p>I have a class that has a collection of interfaces and I need to clone this object. I do not want to use the clone interface and want to do things with copy constructors. I did some googling around and couldn't seem to find the answer to this. I realize there are other ways to do this with a copy method for example, but I'd prefer to not add that to my interface. Thanks for your help.</p> <pre><code>public Component(Component source){ for (Behavior behavior : behaviors) { behaviors.add(new Behavior(behavior)); }} </code></pre>
java
[1]
2,857,607
2,857,608
What does KeyboardView.closing() do?
<p>Does anybody know what KeyboardView.closing() does? It is undocumented, or rather it's description in the documentation is blank (like sooooo many other methods).</p> <p>Thanks in advance, Barry</p>
android
[4]
5,757,119
5,757,120
Is there a better solution to this loop?
<p>I'm making a website which basically displays a random image but I need a better bit of code of what I have at the moment. I'm hoping someone could come up with a better solution.</p> <pre><code>$p = $_GET["p"]; $qrynumrows = mysql_query("SELECT * FROM pictures"); $numrows = mysql_num_rows($qrynumrows); if (!isset($p)) { $randid = rand(1, $numrows); $qryrecord = mysql_query("SELECT * FROM pictures WHERE id='$randid'"); while ($row = mysql_fetch_array($qryrecord)) { $rowp = $row["p"]; $rowremove = $row["remove"]; } if ($rowremove == 1) { header("Location: http://www.lulzorg.com/"); exit(); } else { header("Location: http://www.lulzorg.com/?p=$rowp"); exit(); } } </code></pre> <p>So what it's doing is picking a random record from the database but it needs to check whether the record is allowed. The bit of code works fine but I'm sure there's a better/faster way to do it.</p> <p>If $rowremove is equal to 0 then the image is allowed to display. If $rowremove is equal to 1 then the image is NOT allowed to display.</p> <p>Thanks.</p>
php
[2]
627,069
627,070
error LNK2005, already defined?
<p>I have 2 files A.cpp and B.cpp files in a project "Win32 Console Application".</p> <p>Both 2 files have only 2 lines following code:</p> <pre><code>#include "stdafx.h" int k; </code></pre> <p>When compiling it threw the error</p> <pre><code>Error 1 error LNK2005: "int k" (?a@@3HA) already defined in A.obj </code></pre> <p>I don't understand what happen?</p> <p>Someone please explain to me?</p> <p>Many thanks,</p> <p>T&amp;TGroup</p>
c++
[6]
2,918,891
2,918,892
python: possible to filter dict?
<p>I have a dict with following structure:</p> <pre><code>{5:"djdj", 6:"8899", 7:"998kdj"} </code></pre> <p>The key is int typed and it's not sorted.</p> <p>Now I want all the elements whose key is >= 6.</p> <p>Is there easy way to do that?</p>
python
[7]
1,267,182
1,267,183
Is it possible to copy or retrieve text from Windows form title or lables on windows form?
<p>Is there any trick available using which I can copy text from Windows form title or labels on windows form?</p>
c#
[0]
2,861,109
2,861,110
how to display images stored in application directory
<p>how to display images stored in <strong>"/data/data/com.package/images/"</strong> directory in a GridView.</p>
android
[4]
3,610,865
3,610,866
asp.net slide shows
<p>I want different type of dot net slide show options can you give any suggestions or references or source code</p>
asp.net
[9]
4,925,904
4,925,905
Loading a Webpage from my emulator
<p>In My application i want to load a webpage by ckicking a TextView. How i can do this? Please Help.</p> <p>Thank You.</p>
android
[4]
2,079,534
2,079,535
Characters and numbers validation done for same editable ComboBox
<p>Am doing in Asp.net. There will be one ComboBox of name "combobox1" at the top, for that ComboBox from Database I retrive two table. I mean in combobox1 contains items as "tabel1" and "table2".</p> <p>Now below to tabel1,there will be two editable ComboBox named "combobox2".</p> <p>1) If i click on "combobox1", of item "tabel1", in "combobox2" items called "name list" gets uploaded from database. I want validation, if I enter numbers in "combobox2" it should give "regular expression validator" error message as "enter valid data to" "combobox2".</p> <p>2)------same as here-------</p> <p>If I click on "combobox1",of item "tabel2", in "combobox2" items called "number list" gets uploaded from database. I want validation, if I enter "characters" in "combobox2" it should give "regular expression validator" error message as "enter valid data to" "combobox2".</p> <p><strong>"If you have any doubt in my question please do let me know"</strong></p> <p>How to achieve this..Please do help me in this regard,and if code related ints,it will be appriciated.</p> <p>Thanks and Regards,</p> <p>Pradeep.</p>
asp.net
[9]
2,644,909
2,644,910
javax.swing.Timer vs java.util.Timer
<p>I heard all <code>javax.swing</code> classes should only be used if Iam actually building a <code>Swing GUI</code>. I would like to use <code>javax.swing.Timer</code> without <code>GUI</code> in order to create timer loop. Does it mean that without GUI shall i use <code>java.util.Timer</code>?</p> <p>Is it big error to use <code>javax.swing.Timer</code> without <code>GUI</code> ? Can it cause some performance error or slowdown?</p> <p>What are some approaches to creating a loop that will run passively or without halting the main thread?</p> <p>Thanks in Advance!</p>
java
[1]
3,429,667
3,429,668
Attempt to get HTML from website using PHP cURL does not work
<p>I am attempting to write a script that can retrieve the HTML from my school's schedule search webpage. I am able to visit the web page normally when I visit it using a browser, but when I try to get it to work using cURL, it gets the HTML from the redirected page. When I changed the </p> <pre><code>CURLOPT_FOLLOWLOCATION </code></pre> <p>variable from true to false, it only outputs a blank page with the headers sent. </p> <p>For reference, my PHP code is</p> <pre><code>&lt;?php $curl_connection = curl_init('https://www.registrar.usf.edu/ssearch/'); curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, false); curl_setopt($curl_connection, CURLOPT_HEADER, true); curl_setopt($curl_connection, CURLOPT_REFERER, "https://www.registrar.usf.edu/"); $result = curl_exec($curl_connection); print $result; ?&gt; </code></pre> <p>The website that I am trying to get the HTML of from cURL is <a href="https://www.registrar.usf.edu/ssearch/" rel="nofollow">https://www.registrar.usf.edu/ssearch/</a> or <a href="https://www.registrar.usf.edu/ssearch/search.php" rel="nofollow">https://www.registrar.usf.edu/ssearch/search.php</a></p> <p>Any ideas? </p>
php
[2]
3,773,481
3,773,482
Get text of element within same parent
<p>I have the following HTML. What I try to achieve is to get the back text of the <code>h4</code> in the change function what is called by <code>#my_id</code> selectbox.</p> <pre><code>&lt;div class="product_box"&gt; &lt;h4&gt;title&lt;/h4&gt; &lt;select id="my_id"&gt; &lt;option value="1"&gt;&lt;/option&gt; &lt;option value="2"&gt;&lt;/option&gt; &lt;option value="4"&gt;&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; </code></pre> <pre class="lang-javascript prettyprint-override"><code>$("#ajax_call").change(function(){ var count = $('#ajax_call :selected').val(); var prod_modul =$('#ajax_call').parents(); }); </code></pre>
jquery
[5]
3,331,351
3,331,352
What's the limit of BONITA Platform ? Can a Business Analyst generate a whole Java Web App with just pre-programmed connectors?
<p>I'm studying some systems that allow faster App dev cycles. So I stumbled upon BONITA. It seems that by preparing some connectors you can allow a Business to generate a whole App.</p> <p>What's the limit of Bonita and what is needed to improve it ?</p>
java
[1]
5,031,154
5,031,155
How to select all the option in listbox
<p>I have the following code</p> <pre><code>&lt;select id="first" size="5" multiple="multiple"&gt; &lt;option id="all" value="0"&gt;Select All&lt;/option&gt; &lt;option value="1"&gt;Have&lt;/option&gt; &lt;option value="2"&gt;a&lt;/option&gt; &lt;option value="3"&gt;Great&lt;/option&gt; &lt;option value="4"&gt;day&lt;/option&gt; &lt;/select&gt; </code></pre> <p>When click <code>Select all</code> all the options in the list box have to select.Please help me to correct the below code</p> <pre><code>$("#first").find("option").attr("selected", true); </code></pre>
jquery
[5]
511,011
511,012
Javascript object constructor vs object literal
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4597926/creating-objects-new-object-or-object-literal-notation">creating objects - new object or object literal notation?</a><br> <a href="http://stackoverflow.com/questions/12356994/literal-notation-vs-constructor-to-create-objects-in-javascript">Literal notation VS. constructor to create objects in JavaScript</a> </p> </blockquote> <p>I'm going through my very first Javascript tutorial.</p> <p>I just found two ways to create a JS object.</p> <pre><code>var person = new Object(); person.name = "Tom"; person.age = "17"; </code></pre> <p>and</p> <pre><code>var person = {}; person.name = "Tom"; person.name = "17" </code></pre> <p>Any difference between these two ways of object creation? Since the second looks simpler, can we always use it under any condition? </p>
javascript
[3]
5,861,692
5,861,693
CallLog.Calls Query By Date
<p>I am querying CallLog.Calls content provider for call details. Everything works fine except when I try to query by dates. That is, to get call details for a particular date or date range etc. I know the date are stored as long (millisecond format) so I tried to convert the date first and then query by it, but I must be doing something wrong here. Here's the query I am running, pls note that it works well when I remove the "WHERE DATE =" part or replace it by something like "WHERE TYPE=" etc. So, how do I run a query to get call details for a date or date range? Any help on this? Thanks. </p> <pre><code>Cursor c = getContentResolver().query(CallLog.Calls.CONTENT_URI, null, CallLog.Calls.DATE + "&lt;=?", new String[] { String.valueOf(dateSTR)}, ORDER_BY); startManagingCursor(c); </code></pre>
android
[4]
5,093,556
5,093,557
iPhone: Use apple sample code AVCam to open new view controller after capturing video
<p>I am using the apple sample code AVCam for capturing video</p> <p>But i want to navigate to another view after pressing stop capturing video button</p> <p>But i am unable to do this </p> <p>Please suggest me the proper way to do this task</p> <p>I am doing the follwing coding in AVCam sample code method</p> <pre><code>- (void)captureManagerRecordingFinished:(AVCamCaptureManager *)captureManager { CFRunLoopPerformBlock(CFRunLoopGetMain(), kCFRunLoopCommonModes, ^(void) { [[self recordButton] setTitle:@"Record"]; [[self recordButton] setEnabled:YES]; }); [self dismissModalViewControllerAnimated:YES]; NextViewController *test=[[NextViewController alloc]init]; [self.navigationController pushViewController:test animated:YES]; } </code></pre> <p>Please tell me where i am going wrong or any other way to do this task</p>
iphone
[8]
5,094,446
5,094,447
Difference between "as" and "cast" keyword in C#
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/132445/direct-casting-vs-as-operator">Direct casting vs &#39;as&#39; operator?</a> </p> </blockquote> <p>The as operator is similar to a cast. But i want to know the difference? And also i`ve doubt it is operator or keyword? :)</p>
c#
[0]
3,643,581
3,643,582
Different behaviour on iPhone and iPad
<p>I have a UITextView for which I want left/right/top/bottom content margins and the code I used is:</p> <pre><code>// Set the paddings UIEdgeInsets aUIEdge = [aTextView contentInset]; aUIEdge.left = 15; aUIEdge.right = 15; aUIEdge.top = 10; aUIEdge.bottom = 10; aTextView.contentInset = aUIEdge; </code></pre> <p>But this gives me correct output in iPhone and not in iPad. What to do, give some clue?</p>
iphone
[8]
4,227,074
4,227,075
Generating a user unique hash
<p>I need to generate an hash, that is unique for a user on an android device. Since they can have multiple users that seems difficult to me. I was about to use the IMEI of the device (or another device, if there is one), but since android supports multiple users, I have to use something else, without changing my permissions if possible (at the moment I have internet and read/write storage permissions)</p> <p>Any Ideas?</p> <p>For hashing itself I would use MD5 or SHA1.</p>
android
[4]
4,847,708
4,847,709
how can i import acm.program in eclipse?
<p>I watched one of the <a href="http://see.stanford.edu/see/courseinfo.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111" rel="nofollow">Stanford online video lectures</a> about java programming. The course relies on the acm.program, but when I try to import it using Eclipse, an error message ("The import acm cannot be resolved") appears. How should I deal with it?</p>
java
[1]
201,870
201,871
UserControl: How to set Output Cache duration programaticaly?
<p>UserControl: How to set Output Cache duration programaticaly?</p>
asp.net
[9]
4,970,850
4,970,851
How do I load an Activity from within a Library?
<p>I've got a projected marked as "Is Library" - it has all the activities. I've got a new Android project that references this library. How do I mark one of my library's activities as the first one that starts up?</p> <p>EDIT</p> <p>My original manifest looks like this:</p> <pre><code>&lt;activity android:name=".Welcome" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>All my activities are in the package <code>com.rjs.animator</code>.</p>
android
[4]
1,416,361
1,416,362
dangling pointers java using arrays
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4976668/creating-a-dangling-pointer-using-java">Creating a dangling pointer using Java</a> </p> </blockquote> <p>how to create dangling pointers in java but this time using arrays as memory allocators?</p>
java
[1]
969,164
969,165
Login OnClick Event not firing
<p>This is my first attempt at creating an asp.net website so please be kind. I'm attempting to fire a click event on a submit button in ASP.NET, the template I'm using has this html</p> <pre><code>&lt;div id="lightbox"&gt;&lt;/div&gt; &lt;div id="loginbox-panel"&gt; &lt;a href="#" id="lightbox-close"&gt;&lt;/a&gt; &lt;form action="#"&gt; &lt;fieldset&gt; &lt;div class="frame"&gt; &lt;h4&gt;TestSite&lt;/h4&gt; &lt;small&gt;Sign in to your account.&lt;/small&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;input type="text" value="Username" class="input-text autoclear" /&gt; &lt;input type="password" value="Password" class="input-text autoclear" /&gt; &lt;/div&gt; &lt;div class="separator"&gt;&lt;/div&gt; &lt;div&gt; &lt;input type="submit" value="Sign in" class="input-submit float-right" /&gt; &lt;a href="#" class="float-left"&gt;Forgot your password?&lt;/a&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>I believe the <code>input type="submit"</code> is client side but could be made to run a server side event using </p> <pre><code>&lt;input type="submit" value="Sign in" class="input-submit float-right" runat="server" onserverclick="LoginButton_Click"/&gt; </code></pre> <p>with code behind</p> <pre><code>protected void LoginButton_Click(object sender, EventArgs e) { //login handler } </code></pre> <p>However, the event is not firing! Please can someone advise how I can get the LoginButton_Click event to fire</p> <p>Thanks </p>
asp.net
[9]
2,944,363
2,944,364
How run an enrypted php file in a local server?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/232736/code-obfuscator-for-php">Code obfuscator for php?</a><br> <a href="http://stackoverflow.com/questions/470409/can-i-encrypt-php-source-or-compile-it-so-others-cant-see-it-and-how">Can I encrypt PHP source or compile it so others can’t see it? and how?</a><br> <a href="http://stackoverflow.com/questions/3172078/how-is-it-possible-to-protect-php-code">How is it possible to protect PHP code?</a> </p> </blockquote> <p>I want to encrypt PHP code so that others should not modify and cannot view the code. If I run that encrypted PHP file in the browser its functionality should work. I have used few codes and some software like PHP Bambalam PHP EXE Compiler/Embedder ,phc-win,zzee php etc., with those I am able to encrypt PHP code but failed to run in the server. It was showing Php encrypted code instead of its functionality. </p> <p>Can any one suggest me a way to encrypt a file which should be free and run that encrypted code in the server?</p>
php
[2]
1,847,081
1,847,082
jQuery ajax call to remote website from local filesystem
<p>Ey!</p> <p>Ok, i've come to understand that you can use AJAX calls to remote servers if your site is running on the local filesystem (using the file:// protocol). Yet using ajax calls with jquery fails every time.</p> <pre><code> $.ajax({ url: "https://dokus.no/products/", username: "user", password: "password", dataType: "json", isLocal: true, success: function() {alert("hhohoho");}, error: function(jq, text, exception) {alert("fail");} }); </code></pre>
jquery
[5]
5,372,079
5,372,080
Android framework
<p>If someone asks me the below questions What an Android Framework is? What does it do? </p> <p>How should I answer?</p> <p>Also what is the role of API's such as Activity Manager, Location Manager etc in the Framework?</p>
android
[4]
2,027,169
2,027,170
php manually redirect to 404 error page
<p>I want to redirect any incoming user to the 404 Error Page if s/he reaches the page I don't want him/her to reach. </p> <p>I don't want to redirect to the error page like</p> <pre><code>header("Location: err.php?e=404"); </code></pre> <p>Instead, it should seem like the page really doesn't exist.</p> <p>I googled about this but all I got was about .HTACCESS Custom Error page.</p>
php
[2]
693,554
693,555
How to debug VS-2008 application which is hosted in IIS ver 5.1
<p>I have written some JavaScript to do client-side validation. If I press F5 to execute the application, everything is working fine. But, if I host the application in IIS and if I run from IIS, JavaScript validation is not working at-all.</p> <p>Can anybody tell what could be the reason?</p> <p>Hence, I want to debug the application which is hosted in IIS. I am using IIS ver 5.1. How can I debug? means, what processes to attach?</p> <p>Thanks in advance</p>
asp.net
[9]
4,557,274
4,557,275
Identifying keys by looking at values in a dictionary
<ul> <li>I have a dictionary with key-value pairs like <code>{a : (b,c,d,e)}</code>. </li> <li>If i encounter a tuple <code>(b,c,d,e)</code>, i want to lookup in dictionary, the key having the same tuple as a value and delete that key from the dictionary. Can it be done like this in python?</li> </ul>
python
[7]
5,121,819
5,121,820
How to count word occurrences in an array of strings using c#?
<p>I'm new to programming, and I am trying to write a program that take in an array of strings (each index of the array being a word) and then count the occurrences of each word in the string. This is what I have so far:</p> <pre><code> string[] words = { "which", "wristwatches", "are", "swiss", "wristwatches" }; Array.Sort (words); for (int i = 0; i &lt; words.Length; i++) { int count = 1; for(int j = 1; j &lt; words.Length; j++) { if (words [i] == words [j]) { count++; } } Console.WriteLine ("{0} {1}", words[i], count); } </code></pre> <p>Ideally, I would like the output to be something like:</p> <p>are 1</p> <p>swiss 1</p> <p>which 1</p> <p>wristwatches 2</p>
c#
[0]
4,776,705
4,776,706
where can i find javax.swing.*; package API?
<p>where can i find javax.swing.*; package API?</p>
java
[1]
4,278,621
4,278,622
Using ImageGallery to display images from the SD card?
<p>How would I use ImageGallery to display images I have saved in a particular location on the sd card?</p>
android
[4]
2,189,366
2,189,367
Is there a yield return in java for lazy fetching in hibernate?
<p>I understand that a "yield return" (C# construct) is not available in Java. However, when I do lazy loading in Java/Hibernate. What is the recommended way to iterate over the collection using lazy loading and something similar to yield return ?</p>
java
[1]
4,626,868
4,626,869
Chrome and probably Opera sort object properties automatically
<p>Problem is: Chrome automatically sorts properties of object.</p> <p>If I have an object like:</p> <pre><code>var obj = {4: "first", 2: "second", 1: "third"}; </code></pre> <p>then when I do next:</p> <pre><code>for(var i in obj) { console.debug(obj[i]); } </code></pre> <p>I see next:</p> <p><code>third</code> <code>second</code> <code>first</code></p> <p>but expect:</p> <p><code>first</code> <code>second</code> <code>third</code></p>
javascript
[3]
342,388
342,389
How to show the selected user is admin in php
<p>In one query i am getting all the user details in the user table.</p> <pre><code>$userDetails = $dbUser -&gt;getAllUsers(); </code></pre> <p>In second query i am getting the user details which are there in the selected group.</p> <pre><code>$groupMemberDetails = $dbGroupMembers -&gt;getAllGroupMembers($groupId); </code></pre> <p>But if the user is in selected group i have to show them as selected remaining user as unselected and also if he is owner show it as admin append to his name. </p> <p>I have done following code but i am not getting properly.</p> <p>Please correct me.</p> <pre><code>foreach ( $userDetails as $user ) { $userId = $user['user_id']; $userFirstName = $user['first_name']; $userName = ''; $selected = ""; foreach ( $groupMemberDetails as $groupMemberDetail ) { $groupMemberId = $groupMemberDetail['user_id']; if($groupMemberId == $userId) { $selected = "selected"; } $isAdmin = $groupMemberDetail['is_owner']; if($isAdmin) { $userName = $userFirstName . "(admin)"; } else { $userName = $userFirstName; } } echo '&lt;option value="'.$userId.'" '.$selected.'&gt;'. $userName . '&lt;/option&gt;'; } </code></pre>
php
[2]
2,235,639
2,235,640
How to move expandible list dynamically
<p>How can a <code>ExpandibleList</code> be moved to a particular index dynamically in <strong>Android</strong>. e.g. there are 100 groups in <code>ExpandibleList</code> and on some menu click I want the list to move from index 0 to index 50.</p> <p>Thanks.</p>
android
[4]
1,000,638
1,000,639
Passing Member Function Pointers Between Modules
<p>Just a curiosity question! <a href="http://www.codeproject.com/KB/cpp/FastDelegate.aspx" rel="nofollow">This</a> seems to suggest that member function pointers are in fact different sizes pending compiler and compile options used, and <a href="http://stackoverflow.com/questions/653697/is-it-safe-to-pass-function-pointers-as-arguments-to-dll-functions-and-invoke-the">this</a> seems to suggest that function pointers are passed just fine between modules, so what about member function pointers? I mean with all the hassles that are already presented in passing data between modules it would seem rather silly to even attempt this? Or what about scenarios involving static libraries? If two different compilers are used am I wrong to assume that any scenario involving the passing of a member function pointer would be fruitless?</p>
c++
[6]
3,182,367
3,182,368
Java issue with object
<p>I have a class called</p> <pre><code>public class UserSettings { public static String sessionId; public static int vrefresh; public static int mrefresh; } </code></pre> <p>Then in another class I have this method </p> <pre><code>public static void parseBusinessObject(String input, Object output) </code></pre> <p>And this method writes into the output Object.</p> <p>But in this case there are still static variables, so I can pass the class without creating an object?</p>
java
[1]
2,192,103
2,192,104
Android send a image and save url
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2938502/send-post-data-in-android">Send post data in android</a> </p> </blockquote> <p>How to send a image via http post along with the form data i.e image name etc</p> <p>to a specified url .. which is the url of a <strong>aspx</strong>.</p>
android
[4]